6

In the following document C-level footnotes are typeset vertically even though they would nicely fit in a paragraph (I guess). Does anybody understand why this happens? When first looking at the code I didn't see the reason.

\documentclass{article}
\pagestyle{empty}
\setlength\textwidth{303.0pt}
\setlength\textheight{14\baselineskip}

\usepackage[ruled]{bigfoot}
\DeclareNewFootnote[para]{default}
\DeclareNewFootnote[para]{B}[alph] \MakePerPage{footnoteB}
\DeclareNewFootnote[para]{C}[Alph] \MakePerPage{footnoteC}

\begin{document}
Some text\footnote{A first.} with a footnote. Another
sentence\footnote{Second with a note.\footnoteB{A sub-note}} with a
footnote. Some text\footnote{A further sample.}  with two footnotes
here.\footnote{Another sample\footnoteB{A controverial\footnoteC{A
            commentary on the commentary} and lengthly sub-note going
         on for a number\footnoteC{Another commentary} of
        lines.\footnoteC{Final  commentary}}}
Some more text. More text to fill up the pages in the example. A last
note with notes.\footnote{Again\footnoteB{A b-level
    commentary\footnoteC{Being scrutinized!}}}
\end{document}

Result looks like this here: enter image description here

PS I know about the two parameters hidden in the code but they do not seem to affect it.

1 Answer 1

4

After a few hours debugging, I think I can answer my own question, hopefully for the benefit of others running into it.

Problem 1:

it looks as if bigfoot has trouble whenever there are more than 2 consecutive levels of footnotes asking for "para", and in fact, yes that is the case which is one reason why the C-notes are vertical.

To fix that is possible with the following patch:

\usepackage{etoolbox}

\makeatletter
\patchcmd\FN@makefnstart
  {\ifx\FN@par\par\else}
  {\ifx\FN@indent\indent\else}
  {\typeout{patched \string\FN@makefnstart}}{\Error}

however, as it turned out this only works with very short footnotes ...

Problem 2:

bigfoot uses some "magic penalty numbers" between items when setting them horizontally. As it turns out, the moment a footnote line is already something like 1/3 of a line long it gets at it a penalty of less than -500. On the other hand bigfoot sets \linepenalty (the extra penalty added to each and everyl line internally to 500+(whatever it was before, eg 10).

As a result, producing an extra line in a paragraph gives you a bonus, if you break at one of the magic penalties, as that produces negative demerits.

Therefore even with the above patch my example stayed put and what was needed in addition was a patch that raised the demerits, i.e., made extra lines more costly:

\patchcmd\@makefnstartbox
  {\advance\linepenalty500\relax}
  {\advance\linepenalty1000\relax}
  {\typeout{patched \string\@makefnstartbox}}{\Error}

\makeatother

And with this I got what I wanted from the above example:

enter image description here

You must log in to answer this question.

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