无法更改 scrreprt 类的 {tocdepth} 和 {secnumdepth}

无法更改 scrreprt 类的 {tocdepth} 和 {secnumdepth}

目前正在撰写论文,非常感谢任何帮助。出于某种原因,我无法使用撰稿人即使使用后也上课\设置计数器改变深度值目录深度值为 3(我需要编号的子小节出现在目录中)。

我读了无数关于此的文章,但不知道我哪里做错了。提前感谢你的帮助!

\RequirePackage{fix-cm}
\documentclass{scrreprt}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\usepackage{etex}
\reserveinserts{10}

\input{preamble/general}
\usepackage[final]{pdfpages}
\usepackage{siunitx}
\usepackage{enumitem}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{subfloat}
\usepackage{gensymb}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=black,      
    urlcolor=blue,
}
\urlstyle{same}
     
\begin{document}

\def\dir{chapters/introduction}
\include{\dir/main}

\cleardoublepage%
\def\dir{chapters/chapter-2}
\include{\dir/main}

\cleardoublepage%
\def\dir{chapters/chapter-3}
\include{\dir/main}

\cleardoublepage%
\def\dir{chapters/chapter-4}
\include{\dir/main}

\cleardoublepage%
\def\dir{chapters/chapter-5}
\include{\dir/main} 

\cleardoublepage%
\def\dir{chapters/conclusion}
\include{\dir/main}

\cleardoublepage%
\include{frontbackmatter/bibliography}

\appendix
\cleardoublepage%
\def\dir{chapters/appendix}
\include{\dir/main}

\bookmarksetup{startatroot}

\end{document}

编辑

这是 general.tex 文件的内容。

\usepackage[utf8]{inputenc}
\usepackage[main=english,ngerman]{babel}

\PassOptionsToPackage{%
  %drafting,%
  %dottedtoc,%
  eulerchapternumbers,
  %listings,%
  %parts,%
  floatperchapter, pdfspacing,%
  beramono,%
  %minionprospacing,
  %subfig,%
  %eulermath,%
  a5paper,%
}{classicthesis}

\input{preamble/meta}
\input{preamble/hyphenation}
\newcounter{dummy}
\newlength{\abcd}
\newcommand{\ie}{i.\,e.\xspace}
\newcommand{\Ie}{I.\,e.\xspace}
\newcommand{\eg}{e.\,g.\xspace}
\newcommand{\Eg}{E.\,g.\xspace}
\usepackage{csquotes}  % smart quotes
\usepackage[T1]{fontenc}
\usepackage{xspace}
\usepackage{textcomp}
\usepackage{mparhack}
\usepackage{relsize}
\input{preamble/biblatex}

% Redefine cite command to include space before
% <http://tex.stackexchange.com/questions/11602/>
\let\origcite\cite%
\def\cite#1{\unskip~\origcite{#1}}


\usepackage{amsmath}
%\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{isomath}

\usepackage{tabularx}
\usepackage{ltablex}
\setlength{\extrarowheight}{3pt}
\newcommand{\tableheadline}[1]{\multicolumn{1}{c}{\spacedlowsmallcaps{#1}}}
\newcommand{\myfloatalign}{\centering}
\usepackage{floatrow}
\usepackage{caption}
\captionsetup{format=hang,font=small,labelfont={sc},margin=5pt}
\usepackage{subcaption}
\captionsetup[sub]{margin=0pt,font=small,labelfont={rm}}

\usepackage{blindtext}

\usepackage[dvipsnames]{xcolor}
\usepackage[%
  hyperfootnotes=false,%
  pdfpagelabels,%
  % pdfa,%
]{hyperref}
\usepackage{hyperxmp}
%\pdfcompresslevel=9
%\pdfadjustspacing=1
\hypersetup{%
  %pdfstartpage=3, pdfstartview=FitV,%
  % following line: colored links (web version)
  colorlinks=true, linktocpage=true,%
  % following line: all links in black (for printing)
  %colorlinks=false, linktocpage=false, pdfborder={0 0 0},%
  breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,%
  plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%
  hypertexnames=true, pdfhighlight=/O,%nesting=true,%frenchlinks,%
  pdftitle={\myPlainTitle},%
  pdfauthor={\myName},%
  pdfcopyright={Copyright (C) \myTime, \myName},%
  pdfsubject={},%
  pdfkeywords={},%
  pdflang={en},%
}

\usepackage{graphicx}
\usepackage{rotating}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{shapes.geometric}

\newcommand*\circled[1]{
  \tikz[baseline=(char.base)]{
    \node[shape=circle,draw,inner sep=1pt,font=\footnotesize,%
          minimum size=0.8\baselineskip] (char) {\figureversion{lining}#1};
  }
}

% \tikzexternalize
% \tikzsetexternalprefix{externalized/}

\renewcommand*{\figureautorefname}{Figure}
\renewcommand*{\tableautorefname}{Table}
\renewcommand*{\partautorefname}{Part}
\renewcommand*{\chapterautorefname}{Chapter}
\renewcommand*{\sectionautorefname}{Section}
\renewcommand*{\subsectionautorefname}{Section}
\renewcommand*{\subsubsectionautorefname}{Section}
\providecommand{\subfigureautorefname}{\figureautorefname}%
\usepackage{cleveref}

\PassOptionsToPackage{printonlyused}{acronym}
\usepackage{acronym}

\usepackage{enumitem}

\usepackage{scrhack}
\usepackage{classicthesis}

\KOMAoptions{headinclude=true,footinclude=false}
%\setlength{\textwidth}{10.5cm} % 9 pt font
\setlength{\textwidth}{11.6cm} % 10 pt font
% text height set by golden ratio
\areaset[current]{\textwidth}{1.618034\textwidth}

% Page numbers in plain style (chapter titles)
\clearscrplain
\ofoot[\pagemark]{}
% Adjust distance to footer (default is too large)
\setlength{\footskip}{19pt}

%
% Font setup
%

% Micro-typographic extensions
%\usepackage[protrusion=true,expansion=true]{microtype}

% Use Minion Pro
%\usepackage[
%  mathlf, % lining figures
%]{MinionPro}
%\linespread{1.06}

%
% Customize colors
%
\definecolor{chapter-color}{cmyk}{1, 0.50, 0, 0.25}
\definecolor{link-color}{cmyk}{1, 0.50, 0, 0.25}
\definecolor{cite-color}{cmyk}{0, 0.7, 0.9, 0.2}

% Hyperref
\usepackage{bookmark}
\hypersetup{
  %urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webgreen, %pagecolor=RoyalBlue,%
  %urlcolor=webbrown, linkcolor=Maroon, citecolor=webgreen,%
  %urlcolor=link-color, linkcolor=link-color, citecolor=cite-color,%
  urlcolor=Black, linkcolor=Black, citecolor=Black, %pagecolor=Black,%
}

% Chapter font
\let\chapterNumber\undefined%
\newfont{\chapterNumber}{eurb10 scaled 5500}
%\newfont{\chapterNumber}{MinionPro-Regular-lf-t1 scaled 5500}

% SI units
\usepackage{siunitx}
\sisetup{
  separate-uncertainty,
  repeatunits=false,
  detect-family,
  unit-mode=text,
}
\DeclareSIUnit\au{a.u.}
\let\u=\SI%

% Product type codes
\newcommand{\productcode}[1]{\figureversion{lining}#1}

% TOC
\renewcommand{\cftpartfont}{\color{chapter-color}\normalfont}%
\renewcommand{\cftpartpagefont}{\normalfont}%

% Chapter number on inside
\titleformat{\chapter}[display]%
  {\relax}{\vspace*{-3\baselineskip}\makebox[\linewidth][r]{\color{halfgray}\chapterNumber\thechapter}}{10pt}%
  {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%

% Chapter abstract
\def\chapterabstract#1{%
  \begingroup
  \baselineskip1.3em
  \leftskip1em
  \rightskip\leftskip\itshape#1
  \par
  \endgroup
}

% Chapter quotes
% Adapted from: <http://tex.stackexchange.com/questions/53377/inspirational-quote-at-start-of-chapter>
\setkomafont{dictumtext}{\itshape\small}%
\setkomafont{dictumauthor}{\normalfont}
\renewcommand*{\dictumwidth}{0.6\textwidth}
\renewcommand*{\dictumrule}{}
\renewcommand*\dictumauthorformat[1]{--- #1}

% Subfigure labels (manual)
%\newcommand{\subfig}[1]{#1)}
\newcommand{\subfig}[1]{(#1)}

% CV
\newcommand{\cvleft}[1]{\begin{minipage}[t]{2.5cm}\begin{flushright}#1\end{flushright}\end{minipage}\hspace{5mm}}
\newcommand{\cvright}[1]{\begin{minipage}[t]{8cm}{#1}\end{minipage}}

% Footnote without number
\newcommand\blfootnote[1]{%
  \begingroup
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \endgroup
}

% Put pages on A4 w/ crop marks
%\usepackage[a4,center,cam]{crop}

% Widow and club penalties
\clubpenalty = 10000
\widowpenalty = 10000
%\displaywidowpenalty = 10000

答案1

评论太长:

删除未知文件\input{preamble/general}和未知命令\reserveinserts{10}(即使我etex使用 TL2020、TL2021 或 MiKTeX 加载也是未知的),我无法重现该问题

在此处输入图片描述

代码:

\RequirePackage{fix-cm}
\documentclass{scrreprt}
\usepackage{blindtext}% only for dummy text
\setcounter{secnumdepth}{3}% or \setcounter{secnumdepth}{\subsubsectionnumdepth}
\setcounter{tocdepth}{3}% or \setcounter{tocdepth}{\subsubsectiontocdepth}

%\usepackage{etex}% <- not needed with TeX distributions from 2015 onwards
%\reserveinserts{10}% <- unknown command

%\input{preamble/general}% <- unknown file
\usepackage[final]{pdfpages}
\usepackage{siunitx}
\usepackage{enumitem}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{subfloat}
\usepackage{gensymb}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=black,
    urlcolor=blue,
}
\urlstyle{same}

\begin{document}
\tableofcontents
\Blinddocument
\end{document}

因此文件中一定有某些内容preamble/general改变了默认行为。

相关内容