【问题标题】:How to control the font size of the entries of TOC in KOMA-Script如何控制KOMA-Script中TOC条目的字体大小
【发布时间】:2020-03-25 19:13:34
【问题描述】:

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

【问题讨论】:

  • 你能发一个minimal reproducible example吗?
  • 感谢您邀请我发布 MWE。当我在 MWE 工作时,我能够弄清楚为什么会出现这种情况。感谢您的帮助。
  • 很高兴她能够解决您的问题。您能否写一个简短的答案,以确保有相同问题的其他用户能够参与您所学的内容?

标签: latex


【解决方案1】:

以下是 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}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-05
    • 1970-01-01
    • 2015-12-02
    • 2016-05-24
    • 1970-01-01
    • 2015-05-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多