我想在子部分中添加前缀,效果很好。查看此帖子后:
在 scrbook 的目录中添加章节/附录前缀,并添加正确的附录页眉
几乎没问题。我修改了代码,结果很好,但编译时出现错误。这是我的 MWE:
\documentclass{exam}
\renewcommand{\thesubsection}{Huistaak~\arabic{subsection}:}
\renewcommand{\contentsname}{Overzicht huistaken}
\usepackage{tocstyle}
\renewcommand*{\addsubsectiontocentry}[2]{%
\addtocentrydefault{subsection}{\subsectapp\nobreakspace #1}{#2}%
}
\begin{document}
\tableofcontents
\section{The weather is beautifull}
\subsection{I'm happy}
\subsection{You are happy}
\subsection{We are all happy}
\end{document}
我收到的错误是:\addsubsectiontocentry undefined
所以我认为我做得不对。(事实上我不太理解这句话:
\renewcommand*{\addsubsectiontocentry}[2]{%
\addtocentrydefault{subsection}{\subsectapp\nobreakspace #1}{#2}%
}