简体   繁体   English

LaTeX中的注释目录

[英]Annotated Table of Contents in LaTeX

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

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

尝试

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

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 *命令。

I expect you can brute force and ignorance something using addcontentsline. 我希望你可以使用addcontentsline来蛮力和无知。 eg: 例如:

\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. 任何更干净的东西都需要弄乱相关的宏......除非我遗漏了什么。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM