当我像往常一样插入以下代码时,我在文件中遇到了一条错误消息.aux
。
\begin{subappendices}
\section{Working Diary}
\subsection{09/01/2017}
I have an error today.
\section{Selected Readings and their Reviews}
\section{Connections to Other Topics}
\section{Documentations}
\end{subappendices}
在我的文件中,我有 26 个这样的子附录。我已编译,错误消息如下:
\@writefile{toc}{\contentsline {section}{Appendix \numberline {84.A}Working Diary}{392}{section.\protect \begingroup \immediate \write \@unused \def \MessageBreak
\let \protect \edef You've lost some text. Try typing <return> to proceed.\MessageBreak If that doesn't work, type X <return> to quit. \errhelp \let \def \MessageBreak
\def \errmessage LaTeX Error: Counter too large.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help \endgroup .84.A}}
所以当我删除使用时,hyperref
一切都很好。否则,使用不超过 26 个附录也是可以的。然而,这对我的文档没有任何帮助。
平均能量损失
\documentclass{scrbook}
\usepackage{morewrites}
\usepackage[toc,title,titletoc]{appendix} % Appendices added
\renewcommand{\appendixname}{Appendix}
\usepackage{etoc}
\setcounter{tocdepth}{3}
\let\tableofcontents\etoctableofcontents
\usepackage{hyperref}
\begin{document}
\part{Part A}
\chapter{Dummy}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{The Road to Prove Formally}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Logical Statements}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Logical Quantifiers}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Propositional Calculus}
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Natural Deduction}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Direct Proof}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Contrapositive Methods}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Naive Sets}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\chapter{Set Operations}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Relations}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\subsection{Binary Relation}
\end{subappendices}
\chapter{Functions}
\localtableofcontents
\chapter{Partial Order}
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Equivalent Relations}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Combinatorial Principles}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Enumering Order of Lists}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Integer Arithmetic}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\chapter{Algebra on the Complex Set}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Functions in the Complex Set}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\chapter{Theory of Probability}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Bayesian Inference}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\chapter{Random Variables and Their Distribution}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Some Chapters}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Quantum Mechanics is the Holistic Physics}
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Wave-particle Duality}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Properties of Schroedinger's Equation}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Acousto-optics}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Proteins}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\end{document}
基于此 MWE,如何制作一份包含超过 26 个附录的文档?
答案1
问题的原因在于,该appendix
包使用了一个@pps
计数器,该计数器用于区分各个子附录的hyperref
使用,并将超锚点定义\theH@pps
为\alph{@pps}
,当其值达到 26 时必定会失败@pps
(正常的拉丁字母表中只有 26 个字母)。
一个可能的解决方案是重新定义\theH@pps
和使用\AlphAlph
(或\alphalph
从alphalph
允许A...Z,AA,AB,....
等计数的包中)。
\documentclass{scrbook}
\usepackage{morewrites}
\usepackage{alphalph}
\usepackage[toc,title,titletoc]{appendix} % Appendices added
\renewcommand{\appendixname}{Appendix}
\usepackage{etoc}
\makeatletter
\AtBeginDocument{%
\renewcommand{\theH@pps}{\AlphAlph{\value{@pps}}}% changing the hyperanchors
}
\makeatother
\setcounter{tocdepth}{3}
\let\tableofcontents\etoctableofcontents
\usepackage{hyperref}
\begin{document}
\part{Part A}
\chapter{Dummy}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{The Road to Prove Formally}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Logical Statements}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Logical Quantifiers}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Propositional Calculus}
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Natural Deduction}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Direct Proof}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Contrapositive Methods}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Naive Sets}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\chapter{Set Operations}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Relations}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\subsection{Binary Relation}
\end{subappendices}
\chapter{Functions}
\localtableofcontents
\chapter{Partial Order}
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Equivalent Relations}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Combinatorial Principles}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Enumering Order of Lists}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Integer Arithmetic}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\chapter{Algebra on the Complex Set}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Functions in the Complex Set}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\chapter{Theory of Probability}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Bayesian Inference}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\chapter{Random Variables and Their Distribution}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Some Chapters}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Quantum Mechanics is the Holistic Physics}
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Wave-particle Duality}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Properties of Schroedinger's Equation}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Acousto-optics}
\localtableofcontents
\begin{subappendices}
\section{Working Diary}
\end{subappendices}
\chapter{Proteins}
\localtableofcontents
\begin{subappendices}
\section{Documentations}
\end{subappendices}
\end{document}