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