[Tex/LaTex] Make footnotesep same as line spacing using custom thesis class

footnotesline-spacingspacing

I'm starting to write my thesis using a custom (and incredibly old) thesis style that has been doing the rounds in my university (UCL). It seems as if it was originally written by a professor of the Computer Science department, but since it is the only one around, it has since been adapted by various people in different departments generating what I imagine is a rather daunting variety of versions in different places.

Anyway, my problem is with the spacing of footnotes.

In brief, the problem is that the spacing of the lines within a footnote is not the same as the spacing between different footnotes, with the result that two footnotes on the same page, at least one of which has more than one line, has an irregular line spread.

Here's a MWE:

\documentclass{ucl_thesis}

\begin{document}

Some text.
\footnote{A short footnote on one line.}

Some more text.
\footnote{A longer footnote so that it spans multiple lines.
A longer footnote so that it spans multiple lines.
A longer footnote so that it spans multiple lines.}

\end{document}

enter image description here

In order to compile it you'll need two files: ucl_thesis.cls and ucl_a4.sty.

What I've done

The part in ucl_thesis.cls that modifies the line spacing is on line 106:

\renewcommand \baselinestretch{1.5}

and according to this answer by @jon, "this is usually not recommended" since "LaTeX provides \linespread, which is probably better to use". However, changing the line quoted above into

\setlength{\footnotesep}{1.5\baselineskip}%
\linespread{1.5}\selectfont%

as per his answer did not solve the problem: the spacing between footnotes was now too big.

enter image description here

Before I start manually adjusting this until the error was too small for me to see, I thought I'd ask here.

Best Answer

(This answer assumes you want more than single spacing in your footnotes, which is not usually considered to look very nice, but is often required by university 'style'-setters.)

The thing is this: your class sets (on line 106)

\renewcommand \baselinestretch{1.5}

Now, if you are using the default 10pt, that means the footnote font size is 8pt with a baselineskip of 9.5pt. We're stretching that by 1.5. 9.5 x 1.5 = 14.25pt.

Test this by adding

\the\baselineskip 

in a footnote. You should get 14.25pt.

Now setting (as I had suggested)

\setlength{\footnotesep}{\baselineskip}

makes the footnotesep the equivalent of the baselineskip for regular text (i.e., 12pt), but I think you want it to be 10pt. So you can set that directly:

\setlength{\footnotesep}{10pt}

EDIT:

One solution that mimics the settings of LaTeX2e would be to add this to your preamble (given the ratios suggested in my comment below):

\makeatletter
\ifcase \@ptsize
    \setlength{\footnotesep}{0.83125\baselineskip}
\or
    \setlength{\footnotesep}{0.85555\baselineskip}
\or
    \setlength{\footnotesep}{0.84\baselineskip}
\fi
\makeatother

Or, if you prefer a more explicit setting (not quite identical):

\makeatletter
\ifcase \@ptsize
    \setlength{\footnotesep}{10pt}
\or
    \setlength{\footnotesep}{11pt}
\or
    \setlength{\footnotesep}{12pt}
\fi
\makeatother 

This will allow for automatic recalculation based on whether you are using the standard fontsize choices of 10, 11, or 12pt.

Here is an example based on the one you gave above:

\documentclass[10pt]{ucl_thesis}

\makeatletter
\ifcase \@ptsize
    \setlength{\footnotesep}{0.83125\baselineskip}
\or
    \setlength{\footnotesep}{0.85555\baselineskip}
\or
    \setlength{\footnotesep}{0.84\baselineskip}
\fi
\makeatother

\makeatletter
\ifcase \@ptsize
    \setlength{\footnotesep}{10pt}
\or
    \setlength{\footnotesep}{11pt}
\or
    \setlength{\footnotesep}{12pt}
\fi
\makeatother

\usepackage{xcolor}
\usepackage[grid, gridunit=pt,
  gridcolor=red!20,
  subgridcolor=blue!20]{eso-pic}

\usepackage{lipsum}

\begin{document}

\the\baselineskip

Some text.
\footnote{\the\baselineskip. The baselinestretch factor is: \baselinestretch. A short footnote on one line.}

Some more text.
\footnote{%
\the\footnotesep.
A longer footnote so that it spans multiple lines.
A longer footnote so that it spans multiple lines.
A longer footnote so that it spans multiple lines.
A longer footnote so that it spans multiple lines.
A longer footnote so that it spans multiple lines.
A longer footnote so that it spans multiple lines.
A longer footnote so that it spans multiple lines.}
\footnote{A short footnote on one line.}
\footnote{A short footnote on one line.}

\lipsum

\end{document}