在 classicthesis 中自定义章节标题格式

在 classicthesis 中自定义章节标题格式

我正在使用classicthesis,我想稍微改变一下章节标题的格式(fe 大小和颜色)。我想我在 classicthesis-style 中找到了相应的部分

% ********************************************************************
% layout of the chapter-, section-, subsection-, subsubsection-,
% paragraph and description-headings
% ********************************************************************             
\RequirePackage{titlesec}
% chapters
\ifthenelse{\boolean{@linedheaders}}%
{% lines above and below, number right
\titleformat{\chapter}[display]%             
    {\relax}{\raggedleft{\color{halfgray}\chapterNumber\thechapter} \\ }{0pt}% change color to red
    {\titlerule\vspace*{.9\baselineskip}\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]% change size to \huge
}{% something like Bringhurst  
\titleformat{\chapter}[display]%
    {\relax}{\mbox{}\oldmarginpar{\vspace*{-3\baselineskip}\color{halfgray}\chapterNumber\thechapter}}{0pt}%
    {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]% 
}

但是当我尝试改变文本的颜色和大小时,什么也没有发生。

 \documentclass[twoside,openright,titlepage,numbers=noenddot,headinclude, footinclude=true,cleardoublepage=empty,abstractoff, BCOR=5mm,paper=a4,fontsize=11pt,ngerman,american]{scrreprt} 

\input{classicthesis-config}
\usepackage{lipsum}

\begin{document}

\pagestyle{scrheadings}
\part{Introduction}
\chapter{First chapter}
\section{First section}
\lipsum[1-18]
\end{document}

答案1

以下示例代码显示了在何处插入所需的修改(相关代码行标有% change color and size here)。我使用了绿色和\huge,但当然您可以使用最适合您需求的属性:

 \documentclass[
   twoside,
   openright,
   titlepage,
   numbers=noenddot,
   headinclude, 
   footinclude=true,
   cleardoublepage=empty,
   abstractoff, 
   BCOR=5mm,
   paper=a4,
   fontsize=11pt,
   ngerman,
   american
   ]{scrreprt} 
\input{classicthesis-config}
\usepackage{lipsum}

\makeatletter
\ifthenelse{\boolean{@linedheaders}}%
    {% lines above and below, number right
    \titleformat{\chapter}[display]%             
        {\relax}
        {\raggedleft{\color{halfgray}\chapterNumber\thechapter} \\ }
        {0pt}%
        {\color{green!70!black}\huge\titlerule\vspace*{.9\baselineskip}\raggedright\spacedallcaps}% change color and size here 
        [\normalcolor\normalsize\vspace*{.8\baselineskip}\titlerule]%
    }
    {% something like Bringhurst  
    \titleformat{\chapter}[display]%
        {\relax}
        {\mbox{}\oldmarginpar{\vspace*{-3\baselineskip}\color{halfgray}\chapterNumber\thechapter}}
        {0pt}%
        {\color{green!70!black}\huge\raggedright\spacedallcaps}% change color and size here
        [\normalcolor\normalsize\vspace*{.8\baselineskip}\titlerule]% 
    }
\makeatother    
\begin{document}

\pagestyle{scrheadings}
\part{Introduction}
\chapter{First chapter}
\section{First section}
\lipsum[1-18]

\end{document}

结果:

在此处输入图片描述

不是在原始文件中进行更改.sty(从不推荐这样做);在用 , ,.tex包围的文件中执行这些更改\makeatletter\makeatother就像我的示例代码一样。

相关内容