如何让脚注计数器在达到 25 时自动重置为 0?
我正在尝试复制一本书的脚注样式,其中的脚注标记是字母表中的字母 - 但脚注标记在每个“z”之后重置为“a”。
我解决的解决办法包括编译,每当我收到“LaTeX 错误:计数器太大”时,我都会\setcounter{footnote}{0}
在导致错误的脚注之前插入命令:。
不幸的是,每当我添加或删除脚注时,我都必须手动调整并随后重置脚注。
以下是我正在使用的临时代码:
\documentclass{amsbook}
\renewcommand{\thefootnote}{\alph{footnote}} % footnotes a, b, c,
%\makeatletter % reset footnote counter
%\@addtoreset{footnote}{section} % at each section break
%\makeatother
\begin{document}
When\footnote{something} the\footnote{something} quick\footnote{something} brown\footnote{something} fox--which\footnote{something} had\footnote{something} a\footnote{something} short\footnote{something} bushy\footnote{something} tail\footnote{something} that\footnote{something} looked\footnote{something} like\footnote{something} something\footnote{something} you\footnote{something} might\footnote{something} have\footnote{something} gotten\footnote{something} from\footnote{something} the\footnote{something} Fuller\footnote{something} brush\footnote{something} man\footnote{something} back\footnote{something} when\footnote{something} they\footnote{something} %
\setcounter{footnote}{0}%
came\footnote{something} house\footnote{something} to\footnote{something} house\footnote{something} selling\footnote{something} their\footnote{something} goods--jumped\footnote{something} over\footnote{something} the\footnote{something} fat\footnote{something} and\footnote{something} lazy\footnote{something} calico\footnote{something} cat,\footnote{something} a\footnote{something} little\footnote{something} dog\footnote{something} which\footnote{something} had\footnote{something} been\footnote{something} yapping\footnote{something} at\footnote{something} a\footnote{something} squirrel\footnote{something} laughed\footnote{something} to\footnote{something} %
\setcounter{footnote}{0}%
see\footnote{something} such\footnote{something} a\footnote{something} sight:\footnote{something} and\footnote{something} the\footnote{something} dish\footnote{something} ran\footnote{something} away\footnote{something} with\footnote{something} the\footnote{something} spoon\footnote{something} as\footnote{something} the\footnote{something} cow\footnote{something} jumped\footnote{something} over\footnote{something} the\footnote{something} moon.\footnote{something}
\end{document}
第二个相关问题(从字母表中省略“j”和“w”)有一个解决方案结合两个问题。
答案1
您应该定义一个新的计数器表示,例如\cyclealph
:
\documentclass{amsbook}
\renewcommand{\thefootnote}{\cyclealph{footnote}}
\newcommand{\cyclealph}[1]{\ifnum\value{#1}=26 \setcounter{#1}{0}\fi\alph{#1}}
\begin{document}
When\footnote{something} the\footnote{something} quick\footnote{something} brown\footnote{something} fox--which\footnote{something}
had\footnote{something} a\footnote{something} short\footnote{something} bushy\footnote{something} tail\footnote{something}
that\footnote{something} looked\footnote{something} like\footnote{something} something\footnote{something} you\footnote{something}
might\footnote{something} have\footnote{something} gotten\footnote{something} from\footnote{something} the\footnote{something}
Fuller\footnote{something} brush\footnote{something} man\footnote{something} back\footnote{something} when\footnote{something}
they\footnote{something} %
came\footnote{something} house\footnote{something} to\footnote{something} house\footnote{something} selling\footnote{something}
their\footnote{something} goods---jumped\footnote{something} over\footnote{something} the\footnote{something} fat\footnote{something}
and\footnote{something} lazy\footnote{something} calico\footnote{something} cat,\footnote{something} a\footnote{something}
little\footnote{something} dog\footnote{something} which\footnote{something} had\footnote{something} been\footnote{something}
yapping\footnote{something} at\footnote{something} a\footnote{something} squirrel\footnote{something} laughed\footnote{something}
to\footnote{something} %
see\footnote{something} such\footnote{something} a\footnote{something} sight:\footnote{something} and\footnote{something}
the\footnote{something} dish\footnote{something} ran\footnote{something} away\footnote{something} with\footnote{something}
the\footnote{something} spoon\footnote{something} as\footnote{something} the\footnote{something} cow\footnote{something}
jumped\footnote{something} over\footnote{something} the\footnote{something} moon.\footnote{something}
\end{document}
不过,使用alphalph
:
\usepackage{alphalph}
\renewcommand{\thefootnote}{\alphalph{\value{footnote}}}
它避免了在同一页面上出现与示例中相同的脚注条目。