TransWikia.com

Reduce space between List of Figures and List of Tables entries in Table of Contents

TeX - LaTeX Asked by User2010S on July 26, 2021

I have quite a long Table of Contents in which I first add the entries for List of Figures, List of Tables, and Abbreviations. However, the entire toc goes over one page. Thus, I would like to reduce the space between the first three entries (lof, lot, abb) to 1 (instead of the 1.5 that I use for the rest of the document/toc. Any idea how to solve this for only these three entries?
This is my MWE:

documentclass[12pt, a4paper]{article}
usepackage[paper=a4paper,left=3cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}
usepackage[american]{babel}
addtocaptionsamerican{
  renewcommand{contentsname}%
    {Table of Contents}%
}

usepackage{acro}
DeclareAcronym{x}{
  short = X ,
  long  = {X} ,
  class = abbrev
}

usepackage{fancyhdr}
setlengthheadheight{14.49998pt}
pagestyle{fancy}
rhead{thepage}
lfoot{}
cfoot{}
rfoot{}

linespread{1.5}

begin{document}

setcounter{tocdepth}{5}
tableofcontents
addtocontents{toc}{~hfilltextbf{Page}par}
pagebreak

pagenumbering{roman}
addcontentsline{toc}{section}{listfigurename}
listoffigures
addtocontents{lof}{~hfilltextbf{Page}par}
pagebreak
addcontentsline{toc}{section}{listtablename}
listoftables
addtocontents{lot}{~hfilltextbf{Page}par}
pagebreak
addcontentsline{toc}{section}{Abbreviations}
printacronyms[include-classes=abbrev,name=Abbreviations]
pagebreak

pagenumbering{arabic}
section{Section 1}
TEXTTEXT ac{x}

section{Section 2}
TEXTTEXT

section{Section 3}
TEXTTEXT

end{document}

One Answer

You can use the addtocontents{file}{text} macro to put text into the file file. So, at appropriate places use:

addtocontents{toc}{linespread{1.0}} % reduce the line spacing
...
addtocontents{toc}{linespread{1.5}} % revert to your original line spacing

I don't know if the linespread macro is fragile or not. If it is fragile then put protect in front of it (e.g., protectlinespread{...}

Answered by Peter Wilson on July 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP