我正在准备我的论文模板,但遇到了这个问题。
基本上,这是所需的输出:
Table of Contents
First
Second
List of Appendices % Note that I still want that to appear here
EXTRA
% Chapter 1
... Content ...
% Chapter 2
... Content ...
List of Appendices
First Appendix
Second Appendix
% First Appendix
... Content ...
% Second Appendix
... Content ...
% That Extra Page Which is NOT a Chapter
... Content ...
这是我的 MWE:
\documentclass[letterpaper,oneside,12pt]{memoir}
\usepackage{titletoc}
\begin{document}
\pagestyle{plain}
\startcontents[tocmain]
\printcontents[tocmain]{l}{0}{\chapter*{Table of Contents}\setcounter{tocdepth}{1}}
\chapter{First}
\section{A}
\subsection{foo}
\chapter{Second}
\section{B}
\stopcontents[tocmain]
\appendix
\startcontents[appendices]
\printcontents[appendices]{l}{0}{\chapter*{List of Appendices}\setcounter{tocdepth}{1}}
\chapter{First Appendix}
\chapter{Second Appendix}
\backmatter
\resumecontents[tocmain]
\clearpage
\addcontentsline{toc}{chapter}{EXTRA}
{\LARGE Extra page I want to add to main TOC}
\end{document}
这给了我这个输出:
Table of Contents
First
Second
% Chapter 1
... Content ...
% Chapter 2
... Content ...
List of Appendices
First Appendix
Second Appendix
% First Appendix
... Content ...
% Second Appendix
... Content ...
% That Extra Page Which is NOT a Chapter
... Content ...
感谢您的帮助。
附加问题:根据我放置\startcontents
和\stopcontents
命令的位置,我会得到奇怪的输出或错误,这些命令是否有最佳实践?
谢谢。
答案1
这是您正在寻找的输出吗?
\documentclass[letterpaper,oneside,12pt]{memoir}
\usepackage{titletoc}
\begin{document}
\pagestyle{plain}
\startcontents[tocmain]
\printcontents[tocmain]{l}{0}{\chapter*{Table of Contents}\setcounter{tocdepth}{1}}
\chapter{First}
\section{A}
\subsection{foo}
\chapter{Second}
\section{B}
\clearpage
\addcontentsline{toc}{chapter}{List of Appendices}
\stopcontents[tocmain]
\appendix
\startcontents[appendices]
\printcontents[appendices]{l}{0}{\chapter*{List of Appendices}\setcounter{tocdepth}{1}}
\chapter{First Appendix}
\chapter{Second Appendix}
\backmatter
\stopcontents[appendices]
\resumecontents[tocmain]
\clearpage
\addcontentsline{toc}{chapter}{EXTRA}
{\LARGE Extra page I want to add to main TOC}
\end{document}