采用 cleanthesis 样式的子部分

采用 cleanthesis 样式的子部分

我正在使用cleanthesis.sty,我想有编号的子小节,其样式和格式与小节类似,只是可能稍微小一点。我尝试*.sty直接编辑文件,但没有成功。有没有更简单的方法?

答案1

尝试在你的序言中添加以下代码:

\makeatletter
\setcounter{secnumdepth}{3}
\titlespacing{\subsubsection}{0em}{.5em}{0em}%[0pt]
\ifct@cthesis@hangsubsection
        \titleformat{\subsubsection}[hang]%
            {\usekomafont{subsubsection}}%
            {\color{ctcolorblack}\thesubsubsection\hspace*{10pt}}%
            {0pt}%
            {\raggedright}%
            [\phantomsection]
\else
        \titleformat{\subsubsection}[block]%
            {\usekomafont{subsubsection}}%
            {\color{ctcolorblack}\thesubsubsection\hspace*{10pt}}%
            {0pt}%
            {\raggedright}%
            [\phantomsection]
\fi
\makeatother

线路

\setcounter{secnumdepth}{3}

为您提供正确的编号,而其余代码则生成与小节标题类似的小节标题。

梅威瑟:

\documentclass{scrbook}

\usepackage{cleanthesis}

\makeatletter
\setcounter{secnumdepth}{3}
\titlespacing{\subsubsection}{0em}{.5em}{0em}%[0pt]
\ifct@cthesis@hangsubsection
        \titleformat{\subsubsection}[hang]%
            {\usekomafont{subsubsection}}%
            {\color{ctcolorblack}\thesubsubsection\hspace*{10pt}}%
            {0pt}%
            {\raggedright}%
            [\phantomsection]
\else
        \titleformat{\subsubsection}[block]%
            {\usekomafont{subsubsection}}%
            {\color{ctcolorblack}\thesubsubsection\hspace*{10pt}}%
            {0pt}%
            {\raggedright}%
            [\phantomsection]
\fi
\makeatother

\begin{document}

\chapter{Chapter}

\section{Section}

\subsection{Subsection}

\subsubsection{Subsubsection}

\end{document} 

输出:

在此处输入图片描述

答案2

我还有一个简短的问题。如果我想分别创建一个子子节或一个编号段落,我该如何更改代码?我尝试编辑 Karl 的代码,但对我来说不起作用。我非常感谢你的想法。:-)

编辑:好吧,我自己搞定了。实际上,它和我预期的一样简单:

\setkomafont{paragraph}{\thesissubsubsectionfont\normalsize\itshape}
\makeatletter
\setcounter{secnumdepth}{3} %unnumbered
\titlespacing{\paragraph}{0em}{.4em}{0em}%[0pt]
\ifct@cthesis@hangsubsection
        \titleformat{\paragraph}[hang]%
            {\usekomafont{paragraph}}%
            {\color{ctcolorblack}\theparagraph\hspace*{8pt}}%
            {0pt}%
            {\raggedright}%
            [\phantomsection]
\else
        \titleformat{\paragraph}[block]%
            {\usekomafont{paragraph}}%
            {\color{ctcolorblack}\theparagraph\hspace*{8pt}}%
            {0pt}%
            {\raggedright}%
            [\phantomsection]
\fi
\makeatother

相关内容