[英]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
。
Add: 加:
\setcounter{tocdepth}{5}
to the preamble. 到序言。
See: http://www.devdaily.com/blog/post/linux-unix/latex-setting-table-of-contents-toc-depth 请参阅: http : //www.devdaily.com/blog/post/linux-unix/latex-setting-table-of-contents-toc-depth
@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.