LaTeX中的注释目录

时间:2022-07-08 14:54:55

I'd like to use LaTeX's \tableofcontents command (or some equivalent) to automatically generate a table of contents, but I'd also like to add a sentence or two to each line in the table of contents that describes what the referenced section is about. How can I do this?

我想使用LaTeX的\ tableofcontents命令(或某些等价物)来自动生成目录,但我还想在内容列表中的每一行添加一两句话来描述引用的部分是什么关于。我怎样才能做到这一点?

5 个解决方案

#1


The tocloft package and its \cftchapterprecistoc command solved my problem.

tocloft包及其\ cftchapterprecistoc命令解决了我的问题。

#2


Try

\addcontentsline{toc}{section}{sample text}

#3


Follwoing Oliver and simon's advice:

Follwoing Oliver和simon的建议:

You could redefine the sectioning commands to take a second (possibly optional) argument, and use that to build your argument to \addtocontentsline, and then involk the cooresponding section* command.

您可以重新定义分段命令以获取第二个(可能是可选的)参数,并使用它来构建您的参数到\ addtocontentsline,然后使用cooreponding section *命令。

#4


I expect you can brute force and ignorance something using addcontentsline. eg:

我希望你能使用addcontentsline来蛮力和无知。例如:

\addcontentsline{toc}{section}{text}

however, this will conflict with automagically generated lines if you don't use the starred versions of sections it refers to.

但是,如果您不使用它所引用的星号版本,这将与自动生成的行冲突。

Anything more clean will require messing about with the relevant macros....unless I'm missing something.

任何更干净的东西都需要搞乱相关的宏......除非我遗漏了什么。

#5


I would change the {section} part to {subsection}.

我会将{section}部分更改为{subsection}。

\addcontentsline{toc}{subsection}{sample text}

#1


The tocloft package and its \cftchapterprecistoc command solved my problem.

tocloft包及其\ cftchapterprecistoc命令解决了我的问题。

#2


Try

\addcontentsline{toc}{section}{sample text}

#3


Follwoing Oliver and simon's advice:

Follwoing Oliver和simon的建议:

You could redefine the sectioning commands to take a second (possibly optional) argument, and use that to build your argument to \addtocontentsline, and then involk the cooresponding section* command.

您可以重新定义分段命令以获取第二个(可能是可选的)参数,并使用它来构建您的参数到\ addtocontentsline,然后使用cooreponding section *命令。

#4


I expect you can brute force and ignorance something using addcontentsline. eg:

我希望你能使用addcontentsline来蛮力和无知。例如:

\addcontentsline{toc}{section}{text}

however, this will conflict with automagically generated lines if you don't use the starred versions of sections it refers to.

但是,如果您不使用它所引用的星号版本,这将与自动生成的行冲突。

Anything more clean will require messing about with the relevant macros....unless I'm missing something.

任何更干净的东西都需要搞乱相关的宏......除非我遗漏了什么。

#5


I would change the {section} part to {subsection}.

我会将{section}部分更改为{subsection}。

\addcontentsline{toc}{subsection}{sample text}