我怎样才能在 classicthesis scrreprt 文档的奇数页页眉中将部分名称包含在章节名称前面?
classicthesis.sty 中的原始部分内容如下:
% ******************************************************************
% headlines
% ********************************************************************
\PassOptionsToPackage{automark}{scrpage2}
\RequirePackage{scrpage2} % provides headers and footers (KOMA Script)
\clearscrheadings
\setheadsepline{0pt}
\ifthenelse{\boolean{@nochapters}}%
{\relax}%
{\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\enspace\spacedlowsmallcaps{#1}}}
\lehead{\mbox{\llap{\small\thepage\kern2em}\headmark\hfil}}
\rohead{\mbox{\hfil{\headmark}\rlap{\small\kern2em\thepage}}}
\renewcommand{\headfont}{\small}
% \DeclareRobustCommand{\fixBothHeadlines}[2]{} % <--- ToDo
% hack to get the content headlines right (thanks, Lorenzo!)
\def\toc@heading{%
\ifthenelse{\boolean{@nochapters}}%
{\section*{\contentsname}}%nochapters
{\chapter*{\contentsname}}%chapters
\@mkboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}}
结果是奇数页上有实际章节名称,偶数页上有部分名称。我必须包含类似这样的内容吗\renewcommand{\partmark}
?到底在做什么\headmark
?再次强调,目的是在页眉中包含部分名称(而不是编号)。
答案1
这可能会有用:
\documentclass{scrbook}
\usepackage[parts]{classicthesis}
\usepackage{xpatch}
\usepackage{kantlipsum}
\xpatchcmd{\Part}
{\ctparttext}
{\gdef\thisparttitle{#1}\ctparttext}
{}{}
\renewcommand{\chaptermark}[1]{%
\if\relax\detokenize\expandafter{\thisparttitle}\relax
\markboth{\spacedlowsmallcaps{#1}}
{\spacedlowsmallcaps{#1}}%
\else
\markboth{\spacedlowsmallcaps{\thisparttitle\relax\ -- #1}}
{\spacedlowsmallcaps{\thisparttitle\relax\ -- #1}}%
\fi
}
\newcommand{\clearparttitle}{\gdef\thisparttitle{}}
\begin{document}
\mainmatter
\part{First}
\chapter{Title}
\section{Section}
\kant
\appendix
\clearparttitle
\chapter{Appendix}
\kant
\end{document}
当您不再需要该零件标题时,您需要将其删除。