我开始使用classicthesis
与我以前使用过的 word 主题非常接近的包。
该包的配置如下:
\usepackage[linedheaders,parts,pdfspacing]{classicthesis}
我唯一想完全替换我的 word 模板的是居中标题。我如何个性化包以使所有标题居中。
答案1
使用linedheaders
包选项,classicthesis
使用以下选项格式化章节标题
\titleformat{\chapter}[display]%
{\relax}{\raggedleft{\color{halfgray}\chapterNumber\thechapter} \\ }{0pt}%
{\titlerule\vspace*{.9\baselineskip}\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]
所以你要做的就是改为\raggedright
。\centering
完整的例子:
\documentclass{scrbook}
\usepackage[linedheaders,parts,pdfspacing]{classicthesis}
\titleformat{\chapter}[display]%
{\relax}{\raggedleft{\color{halfgray}\chapterNumber\thechapter} \\ }{0pt}%
{\titlerule\vspace*{.9\baselineskip}\centering\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]
\begin{document}
\chapter{A test chapter}
\section{A test section}
\end{document}
结果:
如果希望所有部门单位标题(向下\paragraph
)居中:
\documentclass{scrbook}
\usepackage[linedheaders,parts,pdfspacing]{classicthesis}
\titleformat{\chapter}[display]%
{\relax}{\raggedleft{\color{halfgray}\chapterNumber\thechapter} \\ }{0pt}%
{\titlerule\vspace*{.9\baselineskip}\centering\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]
\titleformat{\section}
{\centering}{\textsc{\MakeTextLowercase{\thesection}}}{1em}{\spacedlowsmallcaps}
% subsections
\titleformat{\subsection}
{\centering}{\textsc{\MakeTextLowercase{\thesubsection}}}{1em}{\normalsize\itshape}
% subsubsections
\titleformat{\subsubsection}
{\centering}{\textsc{\MakeTextLowercase{\thesubsubsection}}}{1em}{\normalsize\itshape}
% paragraphs
\titleformat{\paragraph}
{\normalfont\normalsize\centering}{\theparagraph}{0pt}{\spacedlowsmallcaps}
\begin{document}
\chapter{A test chapter}
\section{A test section}
\subsection{A test section}
\subsubsection{A test section}
\paragraph{A test paragraph}
\end{document}
结果:
对于\subparagraph
不classicthesis
进行修改的,你可以使用类似
%subparagraphs
\titleformat{\subparagraph}
{\normalfont\normalsize\small\itshape\centering}{\thesubparagraph}{1em}{}