LaTeX 中带注释的目录

发布于 2024-07-16 16:38:37 字数 108 浏览 7 评论 0原文

我想使用 LaTeX 的 \tableofcontents 命令(或等效命令)自动生成目录,但我还想在目录中的每一行添加一两句话描述了引用部分的内容。 我怎样才能做到这一点?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

神爱温柔 2024-07-23 16:38:37

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

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

夜司空 2024-07-23 16:38:37

尝试

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

Try

\addcontentsline{toc}{section}{sample text}
倾城月光淡如水﹏ 2024-07-23 16:38:37

遵循 Oliver 和 simon 的建议:

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

Follwoing Oliver and simon's advice:

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.

℡寂寞咖啡 2024-07-23 16:38:37

我希望您可以使用 addcontentsline 进行暴力破解并忽略某些内容。
例如:

\addcontentsline{toc}{section}{text}

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

任何更干净的东西都需要弄乱相关的宏......除非我遗漏了一些东西。

I expect you can brute force and ignorance something using 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.

小猫一只 2024-07-23 16:38:37

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

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

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

\addcontentsline{toc}{subsection}{sample text}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文