如何在KOMA脚本中控制TOC条目的字体大小

问题描述 投票:0回答:1

我使用命令\setcounter{tocdepth}{\subsubsectiontocdepth}subsubsection添加到目录。但是subsubsection的字体大小大于sectionsubsection的字体大小(请参阅所附图像)。有人可以帮我在TOC中将subsubsection的字体大小设置为与sectionsubsection的字体大小相同吗?

enter image description here

latex
1个回答
0
投票

以下是MWE,其中也包括解决我的问题的方法:

\documentclass[a4paper,10pt,twoside,bibliography=totoc]{scrreprt}


\usepackage{babel}                
\usepackage[subfigure]{tocloft}
\usepackage{caption}
\usepackage{setspace}
\setstretch{1.4}               
\usepackage[headsepline]{scrlayer-scrpage}
\automark[chapter]{chapter}


\setcounter{tocdepth}{\subsubsectiontocdepth}
\renewcommand{\cftsecfont}{\sffamily}
\renewcommand{\cftsubsecfont}{\sffamily}
\renewcommand{\cftsubsubsecfont}{\sffamily}   % I added this line of code. This solved my problem
\renewcommand{\cftchapdotsep}{4.1}
\renewcommand*{\chapterheadstartvskip}{\vspace*{-1cm}}

\begin{document}

    \pagestyle{plain}
    \pagenumbering{Roman}
    \vspace*{-2cm} 
    \tableofcontents
    \pagestyle{scrheadings}
    \pagenumbering{arabic}

     \chapter{This is Chapter 1}
      \section{This is section 1}
       \subsection{This is subsection 1}
        \subsubsection{This is subsubsection 1}

\end{document}
© www.soinside.com 2019 - 2024. All rights reserved.