我想知道如何从内容列表中隐藏某个部分,但不会丢失文档正文中的部分编号。例如,在本TEX文件我失去了数hide
,所有的序列被损坏:隐藏乳胶中的Toc条目
\documentclass{article}
\begin{document}
\tableofcontents
\section{uno}
\section{dos}
\section*{hide}
\section{tres}
\end{document}
我想知道如何从内容列表中隐藏某个部分,但不会丢失文档正文中的部分编号。例如,在本TEX文件我失去了数hide
,所有的序列被损坏:隐藏乳胶中的Toc条目
\documentclass{article}
\begin{document}
\tableofcontents
\section{uno}
\section{dos}
\section*{hide}
\section{tres}
\end{document}
我认为你正在寻找
\section*{hide}
\addtocounter{section}{1}
或使之成为一个命令:
\newcommand{\toclesssection}[1]{\section*{#1}\addtocounter{section}{1}}
编辑:
好吧,我认为我明白现在想要的是什么(而且,我给出的答案更有意义)。这是一个命令,您可以使用它来禁止向TOC添加节,子部分等。这个想法是暂时禁用\addcontentsline
。
\newcommand{\nocontentsline}[3]{}
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}
...
\tocless\section{hide}
\tocless\subsection{subhide}
只想说感谢伊万的伟大提示! (我只是使用Google为我定制(次类似的东西)附录{}命令:
\newcommand{\nocontentsline}[3]{}
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}
\newcommand{\Appendix}[1]{
\refstepcounter{section}
\section*{Appendix \thesection:\hspace*{1.5ex} #1}
\addcontentsline{toc}{section}{Appendix \thesection}
}
\newcommand{\SubAppendix}[1]{\tocless\subsection{#1}}
也许这是对别人有用,太...)
刚刚来到这里,从a similar question.上面的答案也不太工作,因为它给了一些格式化的问题,而是一个similar solution似乎这样的伎俩
这将是很好也ommit在right..i页码只需要 SectionName .... .............章节编号 SectionName2 ................ SectionNumber2 ...等等。 – mjsr 2010-05-06 23:54:36