![在目录中显示章节但不在文本中打印其标题](https://linux22.com/image/264021/%E5%9C%A8%E7%9B%AE%E5%BD%95%E4%B8%AD%E6%98%BE%E7%A4%BA%E7%AB%A0%E8%8A%82%E4%BD%86%E4%B8%8D%E5%9C%A8%E6%96%87%E6%9C%AC%E4%B8%AD%E6%89%93%E5%8D%B0%E5%85%B6%E6%A0%87%E9%A2%98.png)
我想将报告中的某些页面列在某一章下。此章应打印在正文中,不带页眉,但应在目录中列出条目。
它看起来应该是这样的:
TOC:
1. chapter1
2. chapter2
3. chapter3
chapter1:
LOREM IPSUM
chapter2:
LOREM IPSUM
% from here on I would like to list the text under chapter 3 in the ToC
% but don't what to print "Chapter 3:" at all
LOREM IPSUM
这会有点像\addcontentsline{file}{sec_unit}{entry}
但不会在文本中打印章节标题。
答案1
+1 你明白了,\addcontentsline
它确实存在!
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{My Dummy Chapter Title}
\cleardoublepage
仅当您希望非章节内容从新页面开始时才需要发布。\phantomsection
仅当您加载hyperref
包时才需要发布。