I'm assembling my master's thesis in latex and I'm currently having trouble with spacing in my List of Figures. Currently, if there is an entry that extends more than one line, it is double spaced and the page number is on the bottom line. My university requires subsequent lines in a single entry to be single spaced, individual entries double spaced, and page numbers to be on the first line of each entry.
[Tex/LaTex] Single spacing long entries in List of Figures and moving page number
line-spacingtable of contents
Related Solutions
Use a short ToC entry, eg \subsection[Discussion and Analysis]{Discussion of the survey results and analysis of the questions}
This may or may not work for you in terms of convenience, because it is not automated. But I try to address both the actual question (about TOC, LOF, & LOT) as well as your comment follow-up about chapter & section titles. In both cases, I use stacks to try to resolve the issue.
First, I don't invoke \doublespacing
until after the TOC, LOF, & LOT are printed.
Then, for the TOC, LOF, and LOT, I use the optional argument of \chapter
, \section
, and \caption
to insert a \stackunder{}{}
at the end of the optional text, which effectively provides a double spacing to the item below it. That process could be automated if you were willing to redefine those sectioning/captioning commands (which I don't do here).
Note: My answer at multiple spacing in TOC is related to this problem. And there, I show how to automate the process by redefining (in that example) \section
.
To deal with the double spacing of headings in the report itself, I set an appropriate long-stacking gap when I go into double spaced mode, and then use left-aligned \Longunderstack
s to build single-spaced headings. Note though that for sections and lower-level headings, the stack will be fully indented with respect to the section number, rather than wrapped to the left margin (as seen in section 1.1).
\documentclass[a4paper,12pt]{report}
\usepackage{setspace}
\usepackage{mwe} % just for dummy images
\usepackage[usestackEOL]{stackengine}
\setstackgap{L}{\baselineskip}
\def\stacktype{L}
\begin{document}
\addcontentsline{toc}{chapter}{Contents}
\tableofcontents
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\doublespacing
\setstackgap{L}{.6\baselineskip}
\chapter
[Test Chapter with a very very very very long name which \\splits over multiple lines\stackunder{}{}]
{\Longunderstack[l]{Test Chapter with a very very\\ very very long name which \\splits over multiple lines}}
Lorem ipsum dolor sit amet, consectetuer Lorem ipsum dolor sit amet, consectetuer Lorem ipsum dolor sit amet, consectetuer Lorem ipsum dolor sit amet, consectetuer
\section
[This is a long section title which splits across multiple lines. Dummy Text Dummy Text Dummy Text Dummy Text\stackunder{}{}]
{\Longunderstack[l]{This is a long section title which splits\\ across multiple lines. Dummy Text\\ Dummy Text Dummy Text Dummy\\ Text}}
Lorem ipsum dolor sit amet, consectetuer Lorem ipsum dolor sit amet, consectetuer Lorem ipsum dolor sit amet, consectetuer Lorem ipsum dolor sit amet, consectetuer
\subsection{Another section title}
\begin{figure}[!htb]
\centering
\includegraphics[width=3cm]{example-image}
\caption
[This is a long figure caption which splits across multiple lines. Dummy Text Dummy Text Dummy Text Dummy Text\stackunder{}{}]
{This is a long figure caption which splits across multiple lines. Dummy Text Dummy Text Dummy Text Dummy Text}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=3cm]{example-image}
\caption{This is a short caption}
\end{figure}
\begin{table}[!htb]
\caption
[This is a long table caption which splits across multiple lines. Dummy Text Dummy Text Dummy Text Dummy Text\stackunder{}{}]
{This is a long table caption which splits across multiple lines. Dummy Text Dummy Text Dummy Text Dummy Text}
\centering
\begin{tabular}{ l | r }
\hline
1 & 2 \\
7 & 8 \\
\hline
\end{tabular}
\end{table}
\begin{table}[!htb]
\caption{This is a short caption.}
\centering
\begin{tabular}{ l | r }
\hline
1 & 2 \\
7 & 8 \\
\hline
\end{tabular}
\end{table}
\end{document}
Best Answer
For single spacing long entries, one of the solutions previously offered in this forum works: Single Spacing Long Subsection Header in Table of Contents The solution
\caption[\protect\vspace{-0.5ex}{long caption text}]{long caption text}
works, it may be a roundabout since you have to do it for each figure that has a long caption text, but atleast fixes it.