假设我有采用字母结构的尾注:a、b、c、d、e、...
通常,我可以在每一章中添加尾注,然后重置计数器......
\documentclass{report}
\usepackage{endnotes}
\renewcommand*{\theendnote}{\alph{endnote}}
\begin{document}
\chapter{First}
Testing.\endnote{First test.}
\theendnotes
\setcounter{endnote}{0}
\chapter{Next}
Again.\endnote{Second test.}
\theendnotes
\end{document}
我如何运行某个部分内的 1+ 个章节,然后让 \theendnotes 按章节打印尾注?
这是否需要一个更复杂的计数器...一个数组计数器\newcounter{endnotecounter}[chapter]
???
也许是这样的?
\documentclass{report}
\usepackage{endnotes}
\renewcommand*{\theendnote}{\alph{endnote}}
\begin{document}
\part{Part I}
\chapter{First}
Testing.\endnote{First test.}
\setcounter{endnote}{0} % this needs to be cached so next chapter isn't purged
\chapter{Next}
Again.\endnote{Second test.}
NOTES for Part I:
\theendnotesbychapterinpart
\end{document}
答案1
这似乎是对您的要求的一个完全功能的实现。
\documentclass{book}
\usepackage{endnotes}
\usepackage{alphalph}
\renewcommand{\theendnote}{\alphalph{\value{endnote}}}
\newcommand{\resetendnotes}{%
\setcounter{endnote}{0}%
\addtoendnotes{%
\par\protect\addvspace{\topsep}%
\noindent\textbf{Chapter \thechapter}\par\nobreak
\protect\addvspace{\topsep}%
}%
}
\renewcommand{\notesname}{Notes for part \thepart}
\begin{document}
\part{First part}
\chapter{First chapter}
\resetendnotes
\count255=0
\loop\ifnum\count255<50
\advance\count255 by 1
x\endnote{x}
\repeat
\chapter{First chapter}
\resetendnotes
\count255=0
\loop\ifnum\count255<50
\advance\count255 by 1
y\endnote{y}
\repeat
\clearpage
\theendnotes
\part{Second part}
\chapter{Third chapter}
\resetendnotes
\count255=0
\loop\ifnum\count255<50
\advance\count255 by 1
a\endnote{a}
\repeat
\chapter{Fourth chapter}
\resetendnotes
\count255=0
\loop\ifnum\count255<50
\advance\count255 by 1
b\endnote{b}
\repeat
\clearpage
\theendnotes
\end{document}
答案2
仅当您使用 时,结尾注释才会被清除\theendnotes
。注意:您可以将 包含\thechapter
为 的一部分\theendnote
,但不包含 看起来会更好。
\documentclass{report}
\usepackage{endnotes}
\renewcommand*{\theendnote}{\alph{endnote}}
\begin{document}
\part{Part I}
\chapter{First}
\addtoendnotes{\medskip\noindent\textbf{\normalsize\chaptername~\thechapter}\par\medskip}%
Testing.\endnote{First test.}
\setcounter{endnote}{0}%
\chapter{Next}
\addtoendnotes{\medskip\noindent\textbf{\normalsize\chaptername~\thechapter}\par\medskip}%
Again.\endnote{Second test.}
\clearpage
NOTES for Part I:
\theendnotes
\end{document}