在乳胶中隐藏 Toc 的条目 [英] hide an entry from Toc in latex

查看:12
本文介绍了在乳胶中隐藏 Toc 的条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在目录中隐藏一个部分,但又不会丢失文档正文中的部分编号.例如,在这个 tex 文件中,我丢失了 hide 的编号,所有序列都损坏了:

I would like to know how I can hide a section from the table of contents but without loosing the section number in the body of the document. For example, in this tex file I loose the number for hide, and all the sequences are damaged:

documentclass{article}

egin{document}
	ableofcontents
section{uno}
section{dos}
section*{hide}
section{tres}
end{document}

推荐答案

我想你在找

section*{hide}
addtocounter{section}{1}

或者把它变成一个命令:

or make it into a command:


ewcommand{	oclesssection}[1]{section*{#1}addtocounter{section}{1}}

好的,我想我明白现在想要什么(这比我给出的答案更有意义).这是一个命令,您可以使用它来禁止向 TOC 添加节、小节等.这个想法是暂时禁用 addcontentsline.

Okay, I think I understand what is wanted now (and it makes more sense then the answer I gave). Here is a command that you can use to suppress adding a section, subsection, etc. to the TOC. The idea is to temporarily disable addcontentsline.


ewcommand{
ocontentsline}[3]{}

ewcommand{	ocless}[2]{groupletaddcontentsline=
ocontentsline#1{#2}egroup}
...
	oclesssection{hide}
	oclesssubsection{subhide}

这篇关于在乳胶中隐藏 Toc 的条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆