我想在目录中添加一个附录,但不在连续文本上显示其标题。
最小示例:
\documentclass{scrartcl}
\begin{document}
\tableofcontents
\section{A Section}
Lorem ipsum.
\appendix
\section{Appendix with Headline}
This section has a headline.
\section{Appendix without Headline}
This section should not have a headline.
\end{document}
一个想法是使用\addcontentsline
而不是\section
但随后我失去了前面的“B”:
\addcontentsline{toc}{section}{Appendix without Headline}
答案1
这是一个有点奇怪的要求,但你可以照做。(请注意,这不考虑其他“可见”部分的编号。)
\documentclass{scrartcl}
\begin{document}
\tableofcontents
\section{A Section}
Lorem ipsum.
\appendix
\section{Appendix with Headline}
This section has a headline.
\addcontentsline{toc}{section}{\protect\numberline{B}Appendix without Headline}
\bigskip\noindent% Optional
This section should not have a headline.
\end{document}