我想使用一些命令(如 LaTeX)来控制 ConTeXt 中章节编号的大小\anyfontsize
。我正在检查这个答案https://tex.stackexchange.com/a/668592/14423我可以修改章节号和垂直线之间的间隙(\blackrule
),但无法控制章节号的大小。另一个相关问题是,的大小\blackrule
会受到章节号大小的影响吗?
\definehspace[oneem][-.125 em]
\starttexdefinition MyNumberChapterCommand #1
{\tfe #1}
%\enspace
\hspace[oneem]
\blackrule[
height=\lineheight,
depth=\strutdepth,
width=2pt,
color=darkred,
]
\stoptexdefinition
\definebodyfont[14pt][rm][tfe=Regular at 36pt]
\setuphead[chapter][
numbercommand=\MyNumberChapterCommand,
page=no,%Just to have them on the same page here
%numberstyle=\tfe
]
\starttext
\startchapter[title={With a rule}]
Bla bla bla
\stopchapter
\stoptext
答案1
我不太清楚你希望它看起来怎么样,但你可以尝试一下(参见代码中的一些注释):
\definehspace[oneem][-.125 em]
\starttexdefinition MyNumberChapterCommand #1
\tfe #1
% {\tfe #1}% Test this instead of the one above
% #1% Test this if the numberstyle is enabled
\hspace[oneem]
\blackrule[
height=\strutheight,% I changed \lineheight to \strutheight
depth=\strutdepth,
width=2pt,
color=darkred,
]
\stoptexdefinition
% \definebodyfont[12pt][rm][tfe=Serif at 36pt]
\definefontsize[e]
\definebodyfontenvironment[default][e=3]% 3*12=36
\setuphead[chapter][
numbercommand=\MyNumberChapterCommand,
page=no,%Just to have them on the same page here
% numberstyle={\definedfont[Serif*default at 36pt]},
]
\starttext
\startchapter[title={With a rule}]
Bla bla bla
\stopchapter
\stoptext
上面显示的代码版本给出(我认为数字和规则看起来太局促):