LaTeX:编号次级部分并在目录中显示

阅读:159

Mukesh Chapagain 2016-06-06 00:00:00    Mukesh Chapagain笔记


默认情况下,“ \subsubsection”标题没有编号,它也不会显示在“目录”中。为了编号并在目录中显示子分类,我们需要使用“ ” 在LaTeX文档的前导中定义“ tocdepth”和“ secnumdepth” 的计数器值\setcounter

这里是LaTeX示例文档代码:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

\documentclass{report}

 

\setcounter{tocdepth}{3}

\setcounter{secnumdepth}{3}

 

% For dummy lipsum text

 

\usepackage{lipsum}

 

\begin{document}

 

\tableofcontents

\clearpage

 

\chapter{Introduction}

\lipsum[1]

 

\section{Overview}

\lipsum[2]

 

\section{My Section}

 

\subsection{My Sub Section}

 

\subsubsection{My Sub Sub Section}

 

\end{document}



希望这可以帮助。
谢谢。

分享这个:


LaTeX: Numbering subsubsection and showing it in Table of Contents

阅读:159

Mukesh Chapagain 2016-06-06 00:00:00


By default, the “\subsubsection” heading has no numbering and it is also not shown in “Table of Contents”. To put numbering and to show the subsubsection in table of contents, we need to define the counter value of “tocdepth” and “secnumdepth” in the preamble of your LaTeX document using “\setcounter“.

Here is the sample LaTeX document code:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

\documentclass{report}

 

\setcounter{tocdepth}{3}

\setcounter{secnumdepth}{3}

 

% For dummy lipsum text

 

\usepackage{lipsum}

 

\begin{document}

 

\tableofcontents

\clearpage

 

\chapter{Introduction}

\lipsum[1]

 

\section{Overview}

\lipsum[2]

 

\section{My Section}

 

\subsection{My Sub Section}

 

\subsubsection{My Sub Sub Section}

 

\end{document}



Hope this helps.
Thanks.

Share this:


相关标签:
latex