Remove specific subsection from TOC in LaTeX [duplicate]

匿名 (未验证) 提交于 2019-12-03 02:52:02

问题:

Possible Duplicate:
hide an entry from Toc in latex

Appendix  A Section 1      A.1 Subsection 1      A.2 Subsection 2  B Section 2 

Is there a way to get rid of Subsection n, but still have the subsection numbered in the document (i.e. not using \subsection*)?

I thought about limiting the TOC depth, but that does not seem to be possible for just the Appendix?

回答1:

Here's one (sort of hackish but not too bad) way to work this:

All wrapped up, you just add a new command hiddensubsection, given by

\newcommand{\hiddensubsection}[1]{     \stepcounter{subsection}     \subsection*{\arabic{chapter}.\arabic{section}.\arabic{subsection}\hspace{1em}{#1}} } 

Then you create your notoc subsection using this instead of \subsection:

\hiddensubsection{sectionname} 

The way it works is by manually incrementing the subsection counter and then creating an unnumbered subsection with the subsection counter as part of the title. You may need to tweak the spacing between number and title, but i couldn't see any difference.

Obviously you could do the same thing for sections and subsubsections if needed



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!