我想知道如何從內容列表中隱藏某個部分,但不會丟失文檔正文中的部分編號。例如,在本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