0

In my dissertation, I am running into the following problems with my table of contents, which is best illustrated with a figure or two, depicting ends of lines of the table of contents in my dissertation:

Sometimes the text overhangs the number, or pushes a number out of the way.

These are issues with the way that toc (plus href?) is choosing to wrap lines of text. I did not write the .cls file which makes this table of contents, but the relevant lines that I can find are the following:

  \def\l@chapter#1#2{
  \pagebreak[2]\par\vskip\baselineskip
  \@dottedtocline{0}{0in}{0.5in}{#1}{#2}
  \nopagebreak\par 
  \gdef\@sechack{\vskip\baselineskip\gdef\@sechack{\relax}} 

with dottedtocline defined as follows:

\def\@dottedtocline#1#2#3#4#5{
   \ifnum #1>\c@tocdepth
\else
    \vskip \z@ \@plus.2\p@
     {\leftskip=#2\relax \rightskip=\@tocrmarg
\parfillskip=-\rightskip
      \parindent=#2\relax \hangindent=1.5em
\singlespace\@afterindenttrue
      \interlinepenalty\@M
      \leavevmode
      \@tempdima=#3\relax
      \advance\leftskip by\@tempdima \null\nobreak
\hskip -\leftskip
      {#4}\nobreak
     \leaders\hbox{$\m@th
         \mkern \@dotsep mu\hbox{.}\mkern
\@dotsep
         mu$}\hfill
      \nobreak
      \hb@xt@\@pnumwidth{\hfil\normalfont
\normalcolor #5}
      \par}
\fi} 

and sechack defined as:

\def\@sechack{\relax}

The closest related topic that I can find is the following: List of figures/tables lines too long with classicthesis

However, I am not using the classicthesis style, as the given format (used to?) conform to my university's style guidelines.

Vincent
  • 20,157
Opal E
  • 101

1 Answers1

0

I fixed this, not by modifying the .cls file, but by using the following in my chapter and figure captions:

\chapter[Text here with \phantom{.....} dots to force a newline]{Original chapter title}

\caption[Text here with \phantom{.....} dots to force a newline]{Original figure caption}

This does not fix the underlying code, but adding phantom dots made whatever the code was doing to make another line in the table of contents,

Things that did not work in place of the dots:

\protect\newline 

(This messed with indenting)

\\ 

(Did nothing)

~~~~~ 

(These are nonbreaking spaces so I did not expect it to work).

\,\,\, 

(Also nonbreaking spaces)

\hspace{1cm} 

(Also nonbreaking??)

Ultimately \chapter[alt chapter title]{original chapter title} was built in, but something strips out typical ways of making new lines occur. \phantom makes space without adding characters. Adding white dots would have worked as well, but made things weird to copy-paste.

Opal E
  • 101