简体   繁体   English

获取LaTeX中的目录列表

[英]Getting subsection to list in table of contents in LaTeX

I made a table of contents using \\tableofcontents Each section is made using \\section yet when I do \\subsection it is not listed in the table. 我使用\\tableofcontents制作了一个目录。每个部分都是使用\\section但是当我执行\\subsection它没有列在表中。 How do I get it to list there? 我如何在那里列出它? Thanks. 谢谢。

Which document class are you using? 您使用的是哪个文档类? I just tested it for article , and it works fine. 我只是测试它的article ,它工作正常。 In any case, try using this in the preamble: 无论如何,请在序言中使用:

\setcounter{tocdepth}{2}

Increase 2 if you want to list subsubsection , etc. 如果要列出子subsubsection等,请增加2

@WhirlWind and @Steve_Tjoa got it and helped me too! @WhirlWind和@Steve_Tjoa得到了它并帮助了我! One thing though, whatever you set the tocdepth counter to, you may also want to set the secnumdepth. 但有一件事,无论你设置tocdepth计数器,你可能还想设置secnumdepth。

so i used 所以我用过

\setcounter{tocdepth}{5}

as suggested by @Whirlwind but then the subsubsection in my Table of Contents wasn't numbered. 正如@Whirlwind所建议的那样,但我的目录中的子部分没有编号。 so I added the following to get it to work (thanks to the following link where i found the answer http://www.latex-community.org/viewtopic.php?f=5&t=2351#p9197 ) 所以我添加了以下内容以使其工作(感谢以下链接,我找到答案http://www.latex-community.org/viewtopic.php?f=5&t=2351#p9197

\setcounter{secnumdepth}{5}

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

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