[Tex/LaTex] How does \footnotesep work anyway

footnotesgrid-typesetting

I recently developed a fascination in grid typesetting and therefore was trying to get all the elements on my page separated from each other by multiples of the \baselineskip value (don't try doing this, it will drive you mad). After much fiddling I got everything except the footnotes to fit. According to the LaTeX2e manual, \footnotesep determines the height of the struts separating the footnotes. However, having changed the fontsize of the footnotes from \footnotesize to \small and the \baselineskip to 14.5pt, I can tell you that is not case, or at at least seems to be not the case. The strut height should be 70% of baselineskip, so \footnotesep should be 10.15 to guarantee that all footnotes are separated by multiples \baselineskip. My experience tells me though that it is far closer to 10.425pt. So what gives? How does the algorithm actually work??

Here's my code (for lualatex):

\documentclass[12pt,twoside]{article}
\usepackage{fontspec}
\usepackage[textwidth=130mm,textheight=40\baselineskip, centering, a4paper]{geometry}
\usepackage{lipsum}
\setlength{\headheight}{14.5pt}
\setlength{\splittopskip}{14.5pt}
\setlength{\lineskiplimit}{-\maxdimen}
\setlength{\parskip}{0pt}
\usepackage{footmisc}
\setlength{\skip\footins}{16.05pt}
\setlength{\footnotesep}{10.425pt}
\makeatletter
\renewcommand\footnoterule{
    \kern-4.05\p@
    \hrule\@width.4\columnwidth
    \kern3.65\p@
}
\makeatother
\flushbottom
\renewcommand{\footnotesize}{}
\renewcommand{\footnotelayout}{\small\baselineskip=14.5pt}
\newcommand{\baselinegrid}{%
    \raisebox{0pt}[\height][0pt]{\makebox[0pt][l]{%
        \begin{minipage}[t]{\textwidth}%
            \begin{color}{red}%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
                \rule{\textwidth}{.05pt}\linebreak%
            \end{color}
        \end{minipage}%
}}}

\begin{document}
\baselinegrid
texttexttext\footnote{a footnote.}
\lipsum[1-2]
textextext\footnote{another footnote.}\footnote{another footnote.}\footnote{another footnote.}\footnote{another footnote.}\footnote{another footnote.}\footnote{another footnote.}\footnote{another footnote.}\footnote{another footnote.}\footnote{another footnote.}\footnote{another footnote.}
\lipsum[3-4]
\end{document}

This produces a document with fairly consistent line spacing in the footnotes (and throughout the whole document, for that matter). However, if you change \footnotesep to 10.15 you should see the separation start to happen. What is going on??

Best Answer

The problem is that you use \small with a \baselineskip of 14.5pt. \small itself uses a \baselineskip of 13.6pt. This means that the \strut of \small has a depth of 0.3*13.6pt = 4.08pt, whereas with a \baselineskip of 14.5pt that would normally be 0.3*14.5pt = 4.35pt. As setting \baselineskip does not alter the \strut you run with the \strut of \small, thus you miss 4.35-4.08=0.27pt. You have to compensate this by adding that to \footnotesep, which means that the correct value is 10.15+0.27=10.42pt, slightly smaller than your estimated value.

Related Question