Koma scrbook 的章节编号不起作用

Koma scrbook 的章节编号不起作用

在输出中,章节没有编号,并且章节每次都从 1 重新开始。目录中的章节链接始终指向第一章,即使在后面的章节中也是如此。我还在日志中得到了以下输出:

(./chapter3.tex
chapter without number
pdfTeX warning (ext4): destination with the same identifier (name{section.0.1})
has been already used, duplicate ignored

我花了几个小时检查 tex 文件,试图找出问题所在,但仍然找不到问题所在。

这是 main.tex

\documentclass[11pt, leqno, fleqn]{scrbook}
\usepackage{geometry}        
\geometry{letterpaper}    
\usepackage[parfill]{parskip}  
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{pict2e}
\usepackage{amsmath}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, 
            citecolor=blue, urlcolor=blue]{hyperref}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{lemma}{Lemma}
\newtheorem{exercise}{Exercise}
\newtheorem{remark}{Remark}
\newtheorem{example}{Example}
\newtheorem{warning}{Warning}

\def\grad{ \mbox{grad}}
\def\curl{ \mbox{curl}}
\def\div{ \mbox{div}}
\def\U{\ensuremath {\cal U}}
\def\S{\ensuremath {\cal S}}
\def\V{\ensuremath {\cal V}}
\def\R{\ensuremath {\cal R}}
\def\tr{\ensuremath {\mbox{tr}}}

% ------------------- Title and Author -----------------------------
\title{XXXXXXXXXXXXXX}
\subtitle{xxxxxxxxx}
\author{xxxxxxxxxxxxxxxxxx}
\begin{document}

\frontmatter
\maketitle

\tableofcontents

\pagenumbering{arabic}
\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\include{chapter6}

\bibliographystyle{unsrt}
\bibliography{biblio}

\end{document}
\end

这是一个示例章节,问题出现在所有章节和目录中

% Activate the following line by filling in the right side. If for example the name of the root file is Main.tex, write
% "...root = Main.tex" if the chapter file is in the same directory, and "...root = ../Main.tex" if the chapter is in a subdirectory.
 
%!TEX root = main.tex  

\chapter{XXXXXXXXXXXX}
xxxxxxxxxx

\section{XXXXXXXX}

任何帮助我都会非常感激。谢谢!

答案1

当使用scrbook章节时,章节中没有编号\frontmatter。在您的代码中,您缺少显式\mainmatter声明,它应该代替您的\pagenumbering{arabic}\mainmatter也是这样)。

\documentclass{scrbook}

\title{My Work}
\author{Me Myself}

\begin{document}

\frontmatter
\maketitle
\tableofcontents

\mainmatter % < --- HERE !!

\chapter{chapter1}
\chapter{chapter2}
\chapter{chapter3}
\chapter{chapter4}
\chapter{chapter5}
\chapter{chapter6}

\end{document}

相关内容