5

How can I make the horizontal strechability between the footnotes infinite, so that they become evenly aligned at the right margin?

\documentclass{scrbook}
\textheight=.4\textheight

\usepackage{bigfoot}
\DeclareNewFootnote[para]{default}

\begin{document}
All of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
\end{document}

enter image description here

1
  • The easy solution is to end every footnote with \hfill\null. Aug 6, 2017 at 15:49

2 Answers 2

1

The solution I found, after a lot of time spent looking at the bigfoot documentation (or rather implementation), is to redefine the \@preparefnhtext macro:

\documentclass{scrbook}
\textheight=.4\textheight

\usepackage{bigfoot}
\DeclareNewFootnote[para]{default}
\makeatletter  % To use the @ character in macro names
\let\@old@preparefnhtext=\@preparefnhtext
\FootnoteSpecific{default}\def\@preparefnhtext{\hfill\@old@preparefnhtext}
\makeatother

\begin{document}
All of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
\end{document}

output

(The \FootnoteSpecific{default} is optional, but just good practice in case you have more than one footnote apparatus.)


This precisely answers your question (“How can I make the horizontal strechability between the footnotes infinite, so that they become evenly aligned at the right margin?”), but after looking at the output I wonder whether it's the best question to ask. I don't know a great solution for avoiding the awkward stretches on the last line, but I imagine that in practice you will be able to rewrite your footnotes if necessary to improve the appearance. Really, I'm not even sure I understand what I've done — the documentation of \@preparefnhtext says:

This creates appropriate skips to be put before the horizontal material to make the indentation correct with a breakpoint before the footnote as well as when in run-in text. This is run once at the start of each horizontal mode footnote when it is first being typeset, in horizontal mode.

which is not really clear to me. Probably the better solution would be to typeset the “paragraph” containing all the footnotes to be right-justified, if that's possible.

1

This performs the \hfill\null operation automatically.

Without the \null the \hfill is absorbed by the \vbox which stores the footnote. Alas, with the \null the right edges are not aligned.

\documentclass{scrbook}
\textheight=.4\textheight

\usepackage{bigfoot}
\DeclareNewFootnote[para]{default}

\let\oldfootnote=\footnote
\renewcommand{\footnote}[1]{\oldfootnote{#1\hfill\null}}

\begin{document}
All of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
\end{document}

demo


If you really want them to form nice columns, you should use \makebox.

\documentclass{scrbook}
\textheight=.4\textheight

\usepackage{bigfoot}
\DeclareNewFootnote[para]{default}

\let\oldfootnote=\footnote
\renewcommand{\footnote}[1]{\oldfootnote{\sbox0{\footnotemark}%
  \makebox[\dimexpr 0.24\textwidth-\wd0][l]{#1}}}

\begin{document}
All of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
all of the master recipes and most of the sub-recipes,\footnote{and sub-sub-recipes.}
\end{document}

demo2

8
  • 1
    Thanks! but the right margin isn't quite even.
    – Toothrot
    Aug 6, 2017 at 16:03
  • Could you please explain why the \null is necessary?
    – Toothrot
    Aug 6, 2017 at 16:08
  • Each footnote is stored in a \vbox. Bigfoot uses \unvbox and \nointerlineskip to merge them together, then formats them as a single paragraph. Aug 6, 2017 at 16:11
  • Do you know why the right margin is uneven? I think it has something to do with the width of the footnote number (10, 11, 12 are wider than single digits are). Nov 4, 2017 at 23:34
  • Each \hfill expands to the same size, therefore the more text the smaller each gap. Since there is an \hfill at the end of the line, that gap also changes size. Nov 5, 2017 at 0:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .