![在 Linux 中编译时不显示章节和小节编号](https://linux22.com/image/479161/%E5%9C%A8%20Linux%20%E4%B8%AD%E7%BC%96%E8%AF%91%E6%97%B6%E4%B8%8D%E6%98%BE%E7%A4%BA%E7%AB%A0%E8%8A%82%E5%92%8C%E5%B0%8F%E8%8A%82%E7%BC%96%E5%8F%B7%20.png)
我正在 LaTex 上编写文档,当我在 Windows 计算机上编译时(使用 Miktex),我可以正确地看到章节、小节和子小节的编号,如下图所示:
但是,当我在 Ubuntu 计算机上(使用 TeX Live)编译完全相同的文件时,并没有出现章节编号:
这是有问题的文档的一个例子:
\documentclass{dissertation}
\begin{document}
\section{Example 1}
\subsection{Example 1.1}
\subsubsection{Example 1.1.1}
\subsubsection{Example 1.1.2}
\subsection{Example 1.2}
\subsubsection{Example 1.2.1}
\subsubsection{Example 1.2.2}
\end{document}
这是我的dissertation.cls
文件:
\LoadClass[10pt]{book}
\RequirePackage[english]{babel}
\RequirePackage{titlesec}
最后,这是我的日志文件:
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex 2019.11.19) 17 DEC 2019 12:00
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**stackoverflow.tex
(./stackoverflow.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 31 language(s) loaded.
(./dissertation.cls (/usr/share/texlive/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo
File: bk10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
Package: babel 2016/02/24 3.9q The Babel package
(/usr/share/texlive/texmf-dist/tex/generic/babel-english/english.ldf
Language: english 2012/08/20 v3.3p English support from the babel system
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def
File: babel.def 2016/02/24 3.9q Babel common definitions
\babel@savecnt=\count88
\U@D=\dimen103
)
\l@canadian = a dialect from \language\l@american
\l@australian = a dialect from \language\l@british
\l@newzealand = a dialect from \language\l@british
)))
(/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty
Package: titlesec 2016/03/15 v2.10.1 Sectioning titles
\ttl@box=\box26
\beforetitleunit=\skip43
\aftertitleunit=\skip44
\ttl@plus=\dimen104
\ttl@minus=\dimen105
\ttl@toksa=\toks14
\titlewidth=\dimen106
\titlewidthlast=\dimen107
\titlewidthfirst=\dimen108
)
(./stackoverflow.aux)
\openout1 = `stackoverflow.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}
]
(./stackoverflow.aux) )
Here is how much of TeX's memory you used:
924 strings out of 494333
11362 string characters out of 6163938
68727 words of memory out of 5000000
4315 multiletter control sequences out of 15000+600000
5511 words of font info for 20 fonts, out of 8000000 for 9000
372 hyphenation exceptions out of 8191
30i,4n,29p,207b,155s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfon
ts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/
cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.
pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsl10.pfb>
Output written on stackoverflow.pdf (1 page, 37244 bytes).
PDF statistics:
24 PDF objects out of 1000 (max. 8388607)
16 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)