在 inkscape 中插入 LaTeX 与 ConTeXt 标签

在 Linux 桌面应用较为广泛的 inkscape 可以通过 textext 扩展实现在矢量图形中插入 LaTeX 标签的功能。昨天因为 CTeX bbs 上 cvgmt 询问类似的功能,我推荐了 inkscape + textext,然后顺便 hack 了一下,让这个扩展可以支持 ConTeXt MkIV。这篇文章对这个 hack 过程稍做总结。

继续阅读

MkIV 会错误的吃掉中文字符与半角标点之间的空白

给 Hans 发了邮件,不过他没搭理我。尴尬……

Hi Hans,

In scrp-cjk.lua, the function "process" can eat some glue node between
CJK glyphs. But the following glue nodes between CJK glyph and
half_width_open/half_width_<wbr/>close glyphs should not be eaten.

For example:

\starttext
中国 (Chinese) 的未来
\stoptext

Its output need stay the same.

Therefore I think the function "process" need add some codes for the
test of half_width_open/half_width_<wbr/>close glyphs. This is a patch for
it.

--- /opt/context/tex/texmf-context/tex/context/base/scrp-cjk.lua        2010-08-20
01:35:20.000000000 +0800
+++ /home/garfileo/scrp-cjk.lua 2010-08-30 17:08:31.000000000 +0800
@@ -553,7 +553,8 @@
                        if not pcjk                 or not ncjk
                            or pcjk == "korean"     or ncjk == "korean"
                            or pcjk == "other"      or ncjk == "other"
-                            or pcjk == "jamo_final" or ncjk ==
"jamo_initial" then
+                            or pcjk == "jamo_final" or ncjk == "jamo_initial"
+                           or pcjk == "half_width_close" or ncjk == "half_width_open" then
                            previous = "start"
                        else -- if head ~= first then
                            remove_node(head,first,true)

使用 gnuplot 的 ConTeXt 终端

gnuplot 针对许多图形格式提供了相应的输出终端,可这样查看到它们:

$ gnuplot
gnuplot> set term

Available terminal types:
           canvas  HTML Canvas object
              cgm  Computer Graphics Metafile
          context  ConTeXt with MetaFun (for PDF documents)
            corel  EPS format for CorelDRAW
           dpu414  Seiko DPU-414 thermal printer [small medium large]
             dumb  ascii art for anything that prints text
              dxf  dxf-file for AutoCad (default size 120x80)
            eepic  EEPIC -- extended LaTeX picture environment
              emf  Enhanced Metafile format
            emtex  LaTeX picture environment with emTeX specials
         epslatex  LaTeX picture environment using graphicx package
... ...

上面所列举的只是部分输出终端,其中“context”终端是本文所讲述的重点内容。

继续阅读

跟 Asymptote 认识了一下

在 2010 年初的某一个寒冷的晚上,一个叫做 Garfileo 的人类打开空调之后,开始考虑学习 Asymptote 的事情。这原本是他计划之外的事情。原来的计划是学习 MathGL,不过当他打开了 MathGL 的源码,看到许多类似下面那样的代码,很快就放弃了。

继续阅读