首字下沉
Taco 从 LaTeX 的 lettrine.sty 宏包中 port 过来一个 t-lettrine,使得 ConTeXt 可以很方便地处理首字下沉问题。
\usetypescriptfile[type-gyr]
\usetypescript[palatino][qx]
\setupbodyfont[11pt,palatino]
\usemodule[lettrine]
\setuplettrine[Nindent=0pt]
\starttext
\lettrine{M}{an} was last to come but the first to use his brain for the purpose of conquering the forces of nature. That is the reason why we are going to study him, rather than cats or dogs or horses or any of the other animals, who, all in their own way, have a very interesting historical development behind them.
\stoptext
\usetypescript[palatino][qx]
\setupbodyfont[11pt,palatino]
\usemodule[lettrine]
\setuplettrine[Nindent=0pt]
\starttext
\lettrine{M}{an} was last to come but the first to use his brain for the purpose of conquering the forces of nature. That is the reason why we are going to study him, rather than cats or dogs or horses or any of the other animals, who, all in their own way, have a very interesting historical development behind them.
\stoptext
页眉与页脚
若采用 Van de Graaf 版式,那么页面的外部留白较宽,页眉和页脚如果还是像传统那般分别设置在版心的正上和正下方,版面会显得过于紧张。应当将页眉和页脚向外侧都延伸过去一些才好,就像下面的这种样式:
偶数页的左侧页眉显示当前的章标题,奇数页的右侧页眉显示当前的小节标题。为了与页眉呼应一下,我将页码置于页脚的外侧。
下面是 ConTeXt 实现:
\def\Offset{\hbox to -1.6cm{}}
\def\CurrentChapter{%
\tinyframed{第 \headnumber[chapter] 章}%
\hbox to 1em{}%
\tightframed{\getmarking[chapter]}%
}
\def\CurrentSection{%
\tinyframed{\headnumber[section]}%
\hbox to 1em{}%
\tightframed{\getmarking[section]}%
}
\setupheadertexts
[text][]
[{\CurrentSection\Offset}]
[{\Offset\CurrentChapter}][]
\setupfootertexts
[text][]
[\pagenumber\Offset]
[\Offset\pagenumber][]
\setupfooter[style=\tfx]
\setupheader[style=\tfx]
\def\CurrentChapter{%
\tinyframed{第 \headnumber[chapter] 章}%
\hbox to 1em{}%
\tightframed{\getmarking[chapter]}%
}
\def\CurrentSection{%
\tinyframed{\headnumber[section]}%
\hbox to 1em{}%
\tightframed{\getmarking[section]}%
}
\setupheadertexts
[text][]
[{\CurrentSection\Offset}]
[{\Offset\CurrentChapter}][]
\setupfootertexts
[text][]
[\pagenumber\Offset]
[\Offset\pagenumber][]
\setupfooter[style=\tfx]
\setupheader[style=\tfx]
\Offset 的具体大小,这个要根据具体的情况来定。比如,如果在边注区域显示一些文字、图形,为了保持版面协调,可以将 \Offset 的值再取大一些。
一开始,我不知道盒子是可以负向伸缩的。因为想到 CSS 有这个功能,便顺手试验了一下,不想居然真的可以。
Van de Graaf 版式设计规则
读了 Wang Yue 的那篇“写一篇关于排版理论具体实践的文档来抛砖引玉”,对其中所提到的 J.A. van de Graaf 定义的的经典版式比较感兴趣。今天,略略学习了一下,并将它应用到了 “ConTeXt 学习笔记, Using MkIV”的版式定义中。