我想使用 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
上面顯示的程式碼版本給出(我認為數字和規則看起來太局促):