3

I'd like to add a small amount of inter-line spacing between footnotes, when there are multiple footnotes on a page (with a few additional caveats, v.i.)

i.e. instead of getting this: w/o spacing

getting something more like this: enter image description here

where there is additional horizontal space between the blue and the red text, and between the red and the blue text, but no additional spacing before the blue and no additional spacing after the black.*

So far, I have been manually inserting line breaks in the footnote entry (e.g. \footnote{ the content.\\[-4pt]} ); however, this is tedious and requires adjusting every time the content is added / removed.

Furthermore, I sometimes adjust the amount of horizontal spacing when there is math content (e.g. I'll leave it as \footnote{some content.\\} or even add to the line break, if necessary), for readability.

Is it possible to achieve this automatically? What is the proper way to go about doing so?

NB. this question addresses a similar issue, except it includes space between the horizontal line & the first footnote (which I don't want), and does not address the possibility of adjusting the spacing for certain footnotes (i.e. as I do want, after footnotes with large math equations).

*This was obtained by manually inserting line breaks \\[-4pt] after the specific footnotes:

\documentclass{article}
\usepackage{lipsum}
\usepackage[usenames,dvipsnames]{xcolor}

\begin{document}
Some text here.\footnote{{\color{blue}Lorem ipsum dolor sit amet,     consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.} \\[-4pt]}

Different text here.\footnote{{\color{red}Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.}\\[-4pt]}

Different text here.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.}

\end{document}

2

The following minimal example updates the strut inserted at the start of the footnote text to be the default as part of the first footnote, and something else (\footnotesepadd) for any subsequent footnotes. With an appropriate value added to \footnotesep, you can adjust the spacing between footnotes as needed (change the length indicated below):

enter image description here

\documentclass{article}

\usepackage{lipsum,atbegshi,etoolbox}
\usepackage[usenames,dvipsnames]{xcolor}

\makeatletter
\patchcmd{\@footnotetext}% <cmd>
  {\rule\z@\footnotesep}% <search>
  {\footnotestrut}% <replace>
  {}{}% <success><failure>

\newlength{\footnotesepsave}
\setlength{\footnotesepsave}{\footnotesep}
\newlength{\footnotesepadd}
\setlength{\footnotesepadd}{\dimexpr\footnotesepsave+20pt}% <--- change this
\AtBeginShipout{%
  \let\footnotesep\footnotesepsave
  \gdef\footnotestrut{\rule\z@\footnotesep\global\let\footnotesep\footnotesepadd%
    \gdef\footnotestrut{\rule\z@\footnotesep}}%
}
\newcommand{\footnotestrut}{%
  \rule\z@\footnotesep\global\let\footnotesep\footnotesepadd%
  \gdef\footnotestrut{\rule\z@\footnotesep}}
\makeatother

\begin{document}
Some text here.\footnote{\color{blue}Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida 
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula 
augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac 
turpis egestas. Mauris ut leo.}

Different text here.\footnote{\color{red}Lorem ipsum dolor sit amet, consectetuer adipiscing 
elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum 
gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec 
vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada 
fames ac turpis egestas. Mauris ut leo.}

Different text here.\footnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut 
purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida 
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula 
augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames 
ac turpis egestas. Mauris ut leo.}

\end{document}
| improve this answer | |
1

I would define a new myfootnote command, in order for it to accept your optional parameter for the vertical spacing, i.e.

\documentclass{article}
\usepackage{lipsum}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\myfootnote}{o m}{

    \IfNoValueTF{#1}
    {
        \tl_set:Non\l_tmpa_tl{\\[-4pt] }
    }{
        \tl_set:Non\l_tmpa_tl{#1}
    }
    \footnote{#2\tl_use:N\l_tmpa_tl}
}
\ExplSyntaxOff

\begin{document}
Some text here.\myfootnote{{\color{blue}Lorem ipsum dolor sit amet,     consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.} }

Different text here.\myfootnote[\\[1pc]]{{\color{red}Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.}}

Different text here.\myfootnote{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.}

\end{document}

Resulting in:

enter image description here

Usage:

  • without the optional parameter, a \\[-4pt] is inserted

  • the optional parameter can provide a different vertical spacing

If you want the normal usage, use footnote instead.

Note

Please mind that I used xparse and Expl3 syntax.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.