我正在尝试使用 Context 中的 Tikz 实现彩色脚注样式。根据使用的特定字体进行一些微调后,我得到了如下结果:
可以看出,圆圈大小不太适合两位数。我尝试设计一个既适合一位数又适合两位数的圆圈大小,但理想的情况是圆圈“扩大”,也许在 Tikz 节点内插入脚注编号。另一种选择是根据数字设置大小,使用构造\if ... \else ... \fi
(也无法弄清楚如何做到这一点)。如果 Metapost 有更简单的解决方案,我很乐意使用它。
\setupbodyfont[palatino,10pt]
\usecolors[crayola]
\usemodule[t-tikz]
%\definefontfeature[f:sups][sups=yes]
\setupnote [footnote][textcommand={\tikz[overlay]\fill[MagicMint] (.5ex,.8ex) circle (1.4ex);},
%textstyle=\addff{f:sups},
textcolor=Scarlet]
\setupnotation[footnote][way=bychapter,
numbercommand={\tikz[overlay]\fill[MagicMint] (.5ex,.8ex) circle (1.4ex);},
%headstyle=\addff{f:sups},%headstyle={\ss\bf},
headcolor=Scarlet]
\setupfootnotes[rulecolor=TropicalRainForest,rulethickness=.8pt]%
\setupfootnotedefinition[
alternative={left,bottom} % where to set the footnote, comment it to leave it inside the margin
hang=fit, % if commented, hanging is larger
indenting={yes,small},indentnext=yes, % please, indent everything
]
\starttext
\chapter{One}
\dorecurse{12}{\footnote{}}
\chapter{One}
\dorecurse{12}{\footnote{}}
\stoptext
答案1
仅供感兴趣的人参考,这是一种不使用 TikZ 的替代方案,使用不需要手动调整大小的覆盖层。优点是:不使用 TikZ,可跨 ConTeXt 发行版移植,并且不易出错。缺点是:由于 ConTeXt 似乎会“堆叠”元素,因此有时会出现小的重叠,但如果偏移量足够小,则无论如何都不会发生这种情况。
%\setuppapersize[A5]
\setupbodyfont[palatino,10pt]
\usecolors[crayola]
\startuseMPgraphic{blackbird}
numeric Offset, Size;
Size := OverlayWidth;
%Without an offset circles look too small
%Change ad libitum
Offset := 0.1EmWidth;
fill fullcircle scaled (Size + Offset) withcolor "MagicMint";
\stopuseMPgraphic
\defineoverlay[blackbird][\useMPgraphic{blackbird}]
\setupnote[footnote]
[textcommand={\framed[frame=off,background=blackbird]},
textcolor=Scarlet]
\setupnotation[footnote]
[way=bychapter,
numbercommand={\framed[frame=off,background=blackbird]},
headcolor=Scarlet]
\setupfootnotes
[rulecolor=TropicalRainForest,
rulethickness=.8pt]
\setupfootnotedefinition
[alternative={left,bottom},
hang=fit,
indenting={yes,small},
indentnext=yes]
\starttext
\startchapter[title=Uno]
\dorecurse{12}{Texto \footnote{Nota a pie de página} }
\stopchapter
\startchapter[title=Dos]
\dorecurse{12}{Más texto \footnote{Otra nota} }
\stopchapter
\stoptext
答案2
我自己找到了答案\rawcountervalue
:
\setupbodyfont[palatino,10pt]
\usecolors[crayola]
\usemodule[t-tikz]
\startsetups bola
\ifnum\rawcountervalue[footnote]>9
\tikz[overlay]\fill[MagicMint] (1.1ex,.8ex) circle (1.6ex);
\else
\tikz[overlay]\fill[MagicMint] (.5ex,.8ex) circle (1.4ex);
\fi
\stopsetups
%\definefontfeature[f:sups][sups=yes]
\setupnote [footnote][textcommand=\setups{bola},
%textstyle=\addff{f:sups},
textcolor=Scarlet]
\setupnotation[footnote][way=bychapter,
numbercommand=\setups{bola},
%headstyle=\addff{f:sups},%headstyle={\ss\bf},
headcolor=Scarlet]
\setupfootnotes[rulecolor=TropicalRainForest,rulethickness=.8pt]%
\setupfootnotedefinition[
alternative={left,bottom} % where to set the footnote, comment it to leave it inside the margin
hang=fit, % if commented, hanging is larger
indenting={yes,small},indentnext=yes, % please, indent everything
]
\starttext
\chapter{One}
\dorecurse{12}{\footnote{Footnote.}}
\chapter{One}
\dorecurse{12}{\footnote{}}
\stoptext