对于基于 scrbook 的书籍,我想使用 enotez 包按章节拆分尾注。因此,我\printendnotes
在每章末尾重复调用。由于这些内容很多,我想使用包的拆分选项包含分段标题。问题是:如果没有拆分选项,尾注列表是\printendnotes
每次调用 split 选项后都会被清除不是。因此,对于第 1 章,我获得了第 1 章的注释,对于第 2 章,我获得了第 1 章和第 2 章的注释,以此类推。
梅威瑟:
\documentclass{scrbook}
\usepackage[list-name={Anmerkungen},list-heading={}]{enotez}
%
\DeclareInstance{enotez-list}{custom}{paragraph}
{ heading = \addsec*{#1},
notes-sep = -0.5\parskip,
format = \normalfont\footnotesize\leftskip1.8em,
number = \textsuperscript{#1}
}
\setenotez{
reset = false,
split = section,
split-heading = {#1},
split-title = {\noindent{\bfseries sec <ref>}}
}
%
\begin{document}
\chapter{chap 1}
\section{sec 1.1}
This\endnote{or that (1)} is\endnote{might be (1)} a good\endnote{or bad (1)} idea\endnote{right? (1)}
\section{sec 1.2}
This\endnote{or that (2)} is\endnote{might be (2)} a good\endnote{or bad (2)} idea\endnote{right? (2)}
\printendnotes[custom]
\chapter{chap 2}
\section{sec 2.1}
This\endnote{or that (3)} is\endnote{might be (3)} a good\endnote{or bad (3)} idea\endnote{right? (3)}
\section{sec 2.2}
This\endnote{or that (4)} is\endnote{might be (4)} a good\endnote{or bad (4)} idea\endnote{right? (4)}
\printendnotes[custom]
\end{document}
我没有找到清除尾注列表的方法 - 甚至 enotez 包文档也没有帮助我。如果我忽略了什么,请见谅。
更新:enotez 包文档指出(第 7 页):
“首先,enotez 依赖于你\printendnotes
只使用一次的事实!如果你多次调用它,没人知道会发生什么……”
所以这似乎不受支持......:(
我想是时候联系 enotez 的作者寻求帮助了......
答案1
没有真正的解决方案,但有一个解决方法:
定义一个宏来手动将部分标题注入列表并使用多个\printendnotes
调用没有拆分选项(因为我无法读懂 expl3 来了解如何清除列表)。
梅威瑟:
\documentclass{scrbook}
\usepackage{enotez}
%
\DeclareInstance{enotez-list}{custom}{paragraph}
{ heading = \addsec*{#1}\addcontentsline{toc}{section}{\protect\numberline{}#1},
notes-sep = -0.5\parskip,
format = \normalfont\footnotesize\leftskip1.8em,
number = \textsuperscript{#1}
}
\setenotez{
reset = false
}
%
%%%%%% code added
\makeatletter\ExplSyntaxOn
% list opener
\def\eno@libeg{\enotez_list_postamble: \noindent\group_begin: \tl_use:N \l__enotez_list_format_tl}
% list terminater
\def\eno@liend{\group_end: \enotez_list_postamble: \hspace*{-1.4em}\rule[-1.5ex]{0pt}{4.5ex}}
% call to add inlist heading
\def\addenotezsectionheading#1{
\int_gincr:N \g__enotez_endnote_id_int
% inject entry, see pg 5 enotez_en.pdf
\immediate\write\@auxout{\enotez@note{\int_use:N \g__enotez_endnote_id_int}
{}
{\int_use:N \g__enotez_list_printed_int}
{\arabic{chapter}.\arabic{section}}
{\arabic{section}}
{m}
{\noexpand\eno@liend{\noexpand\bfseries #1}\noexpand\eno@libeg}}
}
\ExplSyntaxOff\makeatother
%%%%%% end code added
%
\begin{document}
\chapter{chap 1}
\section{sec 1.1}\addenotezsectionheading{sec 1.1 (added)}
This\endnote{or that (1)} is\endnote{might be (1)} a good\endnote{or bad (1)} idea\endnote{right? (1)}
\section{sec 1.2}\addenotezsectionheading{sec 1.2 (added)}
This\endnote{or that (2)} is\endnote{might be (2)} a good\endnote{or bad (2)} idea\endnote{right? (2)}
\printendnotes[custom]
\chapter{chap 2}
\section{sec 2.1}\addenotezsectionheading{sec 2.1 (added)}
This\endnote{or that (3)} is\endnote{might be (3)} a good\endnote{or bad (3)} idea\endnote{right? (3)}
\section{sec 2.2}\addenotezsectionheading{sec 2.2 (added)}
This\endnote{or that (4)} is\endnote{might be (4)} a good\endnote{or bad (4)} idea\endnote{right? (4)}
\printendnotes[custom]
\end{document}
我知道标题设计是硬编码的(不酷)但它有效......