amsart
and tocloft
are not compatible. You can either use another document class or, if you want to continue using amsart
, you'll need to redefine \l@section
, \l@subsection
, and \l@subsubsection
, \tocsection
, \tocsubsection
, and \tocsubsubsection
; something along these lines:
\documentclass[11pt]{amsart}
\makeatletter
\def\l@section{\@tocline{1}{0pt}{1pc}{}{}}
\def\l@subsection{\@tocline{2}{0pt}{1pc}{4.6em}{}}
\def\l@subsubsection{\@tocline{3}{0pt}{1pc}{7.6em}{}}
\renewcommand{\tocsection}[3]{%
\indentlabel{\@ifnotempty{#2}{\makebox[2.3em][l]{%
\ignorespaces#1 #2.\hfill}}}#3}
\renewcommand{\tocsubsection}[3]{%
\indentlabel{\@ifnotempty{#2}{\hspace*{2.3em}\makebox[2.3em][l]{%
\ignorespaces#1 #2.\hfill}}}#3}
\renewcommand{\tocsubsubsection}[3]{%
\indentlabel{\@ifnotempty{#2}{\hspace*{4.6em}\makebox[3em][l]{%
\ignorespaces#1 #2.\hfill}}}#3}
\makeatother
\setcounter{tocdepth}{4}
\begin{document}
\tableofcontents
\newpage
\section{Experiment 1}
\subsection{Method}
\subsubsection{Participants}
\subsubsection{Stimuli}
\subsubsection{Procedure}
\subsection{Results}
\end{document}
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
Which document class do you use? With either the
book
or thereport
document class (and thetocloft
package loaded), dot leaders are enabled by default forsection
,figure
, andtable
items; there should thus be no need to (re)define the macros\cftsecleader
,\cftfigleader
, and\cfttableader
to enable dot leaders for these items in the table of contents, the list of figures, and the list of tables. To enable dot leaders forchapter
items, it suffices to runAnyway, it appears that you're using a document class that doesn't enable dot leaders by default for any of these four item types. To enable them, you should execute the following four instructions (note that the macro
\cftdotsep
occurs in all four of them):