我正在使用 MDT 模板撰写论文。我想将文档分成几个部分(简介、结果等...),每个部分又分为不同的章节。我想在标题中包含部分标题而不是章节标题,但是当我在 \automark 中将“章节”替换为“部分”时,它不会改变它。
代码:
\RequirePackage[markcase=used]{scrlayer-scrpage}
\providepairofpagestyles{thesisSimple}{%
\clearpairofpagestyles%
\automark[chapter]{chapter}
\ihead{\headmark}% Inner header
\ofoot[\pagemark]{\pagemark}
}
\ifoot{}% Inner footer
\ofoot{}% Outer footer
\pagestyle{thesisSimple}
\providepairofpagestyles[thesisSimple]{thesis}{%
\automark*[chapter]{}%
}
\providepairofpagestyles[thesisSimple]{review}{%
\ofoot[\shorttitle/\authorname]{\shorttitle/\authorname}
\ifoot[\today]{\today}
}
\pagestyle{thesis}
\ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
\PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
incompatible\MessageBreak with this class}{The pagesyles are defined
using package `scrlayer-scrpage', please consult the\MessageBreak
KOMA-script documentation for details.}]{fancyhdr}
因此,我想在标题中包含“1.结果”,而不是“结果第一章的标题”
\part{Results}
\addchap{Title of the first chapter of Results}
\label{Results_1}
\setcounter{chapter}{3}
\setcounter{section}{0}
\setcounter{figure}{0}
\setcounter{table}{0}
\section{Title of first section of first chapter of results}
答案1
MDT 模板是指 MastersDoctoralThesis.cls?此类基于book
不提供的标准类\partmark
。因此,您必须使用\markright
、\markboth
或手动设置标记\markdouble
。
例子:
\documentclass[english]{MastersDoctoralThesis}
\usepackage{blindtext}
\manualmark% <- switch to manual marks
\begin{document}
\tableofcontents
\part{Foo}\markdouble{\thepart.~Foo}
\blinddocument
\blinddocument
\part{Bar}\markdouble{\thepart.~Bar}
\blinddocument
\blinddocument
\end{document}
补充说明:
KOMA-Script 类提供\partmark
。如果切换到scrbook
,则可以设置\automark[part]{part}
。但它会更改生成的文档。
例子:
\providecommand\baseclass{scrbook}
\RequirePackage{scrlfile}
\AfterClass{scrbook}{\let\subject\relax}
\documentclass[sfdefaults=false,english]{MastersDoctoralThesis}
\automark[part]{part}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\part{Foo}
\blinddocument
\blinddocument
\part{Bar}
\blinddocument
\blinddocument
\end{document}