1

I am writing a thesis using scrreprt from KOMA-script.

I used the method proposed in that post to adjust the spacing before the chapter headings:

Space before chapters and contents

That is, I use the commands:

% Format chapter headings
\addtokomafont{disposition}{\mytitlefont}
\renewcommand*{\chapterheadstartvskip}{\vskip-40pt}

However, for some reason this does not modify the spacing before the Table of Contents headings. It only modifies the chapters.

Here is my full style file:

% Style file for packages
\ProvidesPackage{style}

% Packages
% Package to set page dimensions and margins
\usepackage[letterpaper, lmargin=1in, rmargin=1in]{geometry}
% Graphics package
\usepackage{graphicx}
% Maths typesetting packages
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{bm}
% Package to format table of contents, list of figures, and list of table
\usepackage{tocloft}
% Package to format captions
\usepackage{caption}
% Package to format footnotes
\usepackage{scrextend}
% Package to align table columns on decimal point
\usepackage{dcolumn}
% Package to format custom dates
\usepackage{datetime}
% Package for line spacing
\usepackage{setspace}
\onehalfspacing
% Package for citation formatting
\usepackage{cite} 

% Custom fonts
\newcommand{\mytitlefont}{\normalcolor \sffamily \bfseries}
\renewcommand{\familydefault}{\rmdefault}

% Format dates
\newdateformat{monthyeardate}{\monthname[\THEMONTH], \THEYEAR}
\newdateformat{yeardate}{\THEYEAR}

% Format chapter headings
\addtokomafont{disposition}{\mytitlefont}
\renewcommand*{\chapterheadstartvskip}{\vskip-40pt}

% Format table of contents, list of figures, and list of tables
\renewcommand{\listfigurename}{Figures} 
\renewcommand{\listtablename}{Tables}
\renewcommand{\cftfignumwidth}{6em}
\renewcommand{\cftfigpresnum}{\mytitlefont Figure }
\renewcommand{\cfttabnumwidth}{6em}
\renewcommand{\cfttabpresnum}{\mytitlefont Table }

% Format captions
\captionsetup{format=plain}
\addtokomafont{caption}{\small}
\addtokomafont{captionlabel}{\small\mytitlefont}

% Package to format footnotes
\deffootnote[1.5em]{1.5em}{1em}{\thefootnotemark.\space}

Now everyone who asks this question seems to be redirected back to the link mentioned above. But for me it does not affect the ToC at all. Only the Chapters. Anyone can see a reason?

Here is the start of the main tex file for good measure:

% Write the thesis in report format
\documentclass[12pt,letterpaper]{scrreprt}

% Insert packages
\usepackage{style}
\usepackage[hidelinks]{hyperref}

% Insert preamble
\input{./tex/preamble}

% Begin the thesis
\begin{document}

% Insert title
\input{./tex/title}

% Insert epigraph
\pagenumbering{gobble}
\input{./tex/epigraph}

% Insert abstract in english
\pagenumbering{gobble}
\input{./tex/abstract_en}

% Insert abstract in french
\pagenumbering{gobble}
\input{./tex/abstract_fr}

% Change the page numbering to roman
\pagenumbering{roman}

% Insert the preface
\clearpage
\addcontentsline{toc}{chapter}{Preface}
\input{./tex/preface}

% Insert the acknowledgments
\clearpage
\addcontentsline{toc}{chapter}{Acknowledgments}
\input{./tex/acknowledgments}

% Insert table of contents, figures, and tables
\tableofcontents
\listoffigures

Ben

  • 2
    You have posted a code snippet only instead of a minimal working example. So I cannot test it. But I'm almost sure, that the problem is using tocloft. It is recommended to not use this package with KOMA-Script classes but use the KOMA-Script way to change table of contents etc. – Schweinebacke Apr 2 '17 at 8:33
  • 3
    People say LaTeX is easy to use. It really is ... after you sit down and read the basics and more. We have the standard classes for which packages like tocloft or tocbibind or titesec do a good job. But not for KOMA-script, which is another branch. Or memoir which is yet another branch. Not to mention all those journal or thesis templates/classes that do even more crazy stuff to get things done. – Johannes_B Apr 2 '17 at 8:39
  • Thanks for the input guys. I'm very busy with research and writing the thesis so I gather snippets from the internet here and there. I have to use Tex because it's the standard in my field, but I'm not as versed in the structure of Tex as you are, unfortunately. – Ben Apr 2 '17 at 13:48
2

Package tocloft breaks some features of KOMA-Script. So do not use this package with a KOMA-Script class.

The following suggestion needs KOMA-Script version 3.20 or newer (current is 3.22):

\documentclass[
  12pt,
  letterpaper,
  listof=entryprefix
]{scrreprt}[2016/05/10]

\usepackage[lmargin=1in, rmargin=1in]{geometry}
\usepackage{setspace}
\onehalfspacing
\renewcommand*{\chapterheadstartvskip}{\vspace*{-40pt}}

% Format lists without an additional package
\renewcommand{\listfigurename}{Figures} 
\renewcommand{\listtablename}{Tables}
\newcommand\listentrynumber[1]{{\usekomafont{disposition}{#1}}}
\DeclareTOCStyleEntry[entrynumberformat=\listentrynumber]{tocline}{table}% needs version 3.20
\DeclareTOCStyleEntry[entrynumberformat=\listentrynumber]{tocline}{figure}% needs version 3.20

% Format captions without an additional package
\setcapindent{0pt}
\addtokomafont{caption}{\small}
\addtokomafont{captionlabel}{\usekomafont{disposition}}

\deffootnote[1.5em]{1.5em}{1em}{\thefootnotemark.\space}

\usepackage[hidelinks]{hyperref}
\usepackage{blindtext}% for dummy text
\begin{document}
\tableofcontents
\listoftables
\chapter{A chapter}
\captionof{table}{A table}
\captionof{table}{\blindtext}
\end{document}

enter image description here

Additional remarks:

Package scrextend gives the possibility to use some KOMA-Script features with other classes. So do not load this package with a KOMA-Script.

There is no need to load package caption to change the format of the captions like in your code.

Note that

\renewcommand*{\chapterheadstartvskip}{\vspace*{-40pt}}

shifts the chapter title out of the text area. Maybe you want to use

\RedeclareSectionCommand[beforeskip=-1sp]{chapter}

instead. You can use option showframe of package geometry to visualize the page layout.


If you really want/have to use package tocloft then load this package with option titles:

\usepackage[titles]{tocloft}
  • 1
    It took me a while to understand everything in there but this is an amazing answer. All of it, it works perfectly. If you implement esdd's solution, pay close attention to the extra attribute listof=entryprefix in the class declaration. It took me a while to notice it. – Ben Apr 2 '17 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.