TransWikia.com

footnote in footer

TeX - LaTeX Asked by Cunik16 on May 22, 2021

I have a problem with placing a footnote.
In the text I use footnote{blabla} and it works well and displays the “blabla” at the bottom of the page. But I use a header and footer in the document and I would like to place the footnote in the footer below the line, that separates the footer from text. I have managed to remove the line above the footnote so now I do not have two lines (one to separate footnote and another to separate footer), but the footnote is still part of the text and not part of the footer. I have also tried using “bottom” in the use package:

usepackage[bottom,norule]{footmisc}

but that did not help.

Do you know how can I force the footnote to be part of the footer?

4 Answers

You would have to modify the fancyhdr package to include a test to see if there were any footnotes in the insert which holds them, and then output them in the footer. The problem would be that the footnoting mechanism is not coupled to the running-footer mechanism, and the footnoting mechanism operates first, so you would also need to maintain a flag that says you don't want footnotes in the normal place, and then modify the footnoting mechanism to detect that and act accordingly. Technically possible, but a lot of work, and it might raise conflicts with other packages.

From what you say, you seem to want a variable-height footer (sometimes normal height, other times as high as needed to accommodate the footnotes). IMHO this is A Bad Idea, typographically.

Why not fake it up by making the footnote rule full-width, and removing the rule above the footer? If you wanted a rule above the footer on pages with no footnotes, though, you'd still need to rewrite parts of fancyhdr.

Answered by Peter Flynn on May 22, 2021

I faced the same problem, and I managed to get the footnote text into the page footer using a simple hack. To display the footnotemark, I temporarily change the fancyhdr layout using thispagestyle:

% footnote in footer
newcommand{fancyfootnotetext}[2]{%
  fancypagestyle{dingens}{%
    fancyfoot[LO,RE]{parbox{12cm}{footnotemark[#1]footnotesize #2}}%
  }%
  thispagestyle{dingens}%
}

It can be used like a normal pair of footnotemark[x] and footnotetext[x] (manual numbering is mandatory, as it is not figured out automatically):

text that needs a footnotefootnotemark[1]

fancyfootnotetext{1}{this is the footnote which will appear in the page footer}

For changing the footnote appearance, please refer to the fancyhdr's documentation: http://www.ctan.org/tex-archive/macros/latex/contrib/fancyhdr

footnote in fancyhdr's footer

Answered by Frank Engelhardt on May 22, 2021

I was facing the same problem, after seeing the Frank Engelhardt approach I tried to improve it with the package etoolbox, even moves the page number to the right when a footnote exist and can handle multiple footnotes. (Frank's versions it's simpler, but can't handle more than one and you have to manually label them.)

documentclass{article}
usepackage{fancyhdr}%
usepackage{etoolbox}%

newcommand{makefootnotelist}[1]{%
    parbox{0.8textwidth} {%
        footnotesize{%
            renewcommand*{do}[1]{##1}%
            dolistcsloop{#1}}}}%
newcommand{fancyfootnote}[1]{%
    footnotemark{}%
    deflistname{footlistthepage}%
    defn{$^{thenumexprvalue{footnote}}$}
    ifcsdef{listname}%
        {listcseadd{listname}{n #1}}%
        {csedef{listname}{}%
        listcseadd{listname}{n #1}}%
    fancypagestyle{fancyfootnote}{%
        fancyfoot[L]{makefootnotelist{listname}}%
        fancyfoot[R]{thepage}%
        fancyfoot[C]{}%
    }thispagestyle{fancyfootnote}}%

fancypagestyle{plain}{%
  fancyfoot[C]{thepage}
}
begin{document}
Lorem ipsum dolor sit amet, first footnotefancyfootnote{One},consectetur adipiscing elit. Phasellus aliquam fringilla semper. Nulla nec congue elit, ut malesuada enim. Donec rutrum, libero in venenatis facilisis, neque leo venenatis dui, vel sollicitudin massa massa sit amet velit. Fusce sed euismod quam. Duis velit lorem, aliquam at consequat ac, sollicitudin eget enim. Sed ornare sit amet felis ut condimentum. Donec vulputate id diam nec ultricies. Aenean in velit metus. Secondfancyfootnote{Two}
end{document}

You can even redefine footnote so you don't have to use a different one:

% Use instead of fancyfootnote
renewcommand{footnote}[1]{% ... }%

Answered by Ulilop on May 22, 2021

I realize this is a 9 ear old question, but the above approaches messed up my usual footer layout and were extremely complicated for quite a simple fix. All I needed to do was including the footmisc package with the bottom option and adding the following lines:

letorigfootrulefootrule
renewcommand{footrule}{iffootnote{}{origfootrule}}
renewcommandfootnoterule{origfootrule}

As a minimal working example:

documentclass{article}

usepackage{fancyhdr}
usepackage[bottom]{footmisc} % always place footer at bottom of page 

%----------------------------------------------------------------------------------------
%   HEADER AND FOOTER CONFIGURATION
%----------------------------------------------------------------------------------------

pagestyle{fancy}
fancyhf{}
cfoot{small{MakeUppercase{leftmark}}}
rfoot{small{thepage}}
renewcommand{footrulewidth}{0.5pt}

%----------------------------------------------------------------------------------------
%   FOOTER FOOTNOTE PATCH
%----------------------------------------------------------------------------------------

letorigfootrulefootrule
renewcommand{footrule}{iffootnote{}{origfootrule}}
renewcommandfootnoterule{origfootrule}

begin{document}
    section{No Footnote}
        A normal page without footnotes, footer appears as normal.

    newpagesection{With Footnote}
        First footnotefootnote{One}.
        Second footnotefootnote{Two}.
end{document}

footer without footnotes footer with footnotes

If you don't use a footrule, all you need is usepackage[bottom]{footmisc} and the footnotes will always be right above ("in") the footer.

Answered by Aram Becker on May 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP