7

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?

N.N.
  • 36,163
Cunik16
  • 121

4 Answers4

8

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 footnote\footnotemark[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

  • 1
    Welcome to LaTeX! As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again until you get more rep points. – percusse Oct 02 '12 at 12:23
  • I added a \vspace{0.75cm} to the \parbox to use this with a footer that had a centred page number, and it worked great. Thanks. – Jon May 21 '14 at 02:27
  • I tried the solution suggested by Frank Engelhardt, but the footnote ends up in the page before the page with the text that needs a footnote, i.e., on the previous page. Any ideas of what I'm doing wrong? – KrisKravS Dec 11 '18 at 14:11
2

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.8\textwidth} {%
        \footnotesize{%
            \renewcommand*{\do}[1]{##1\\}%
            \dolistcsloop{#1}}}}%
\newcommand{\fancyfootnote}[1]{%
    \footnotemark{}%
    \def\listname{footlist\thepage}%
    \def\n{$^{\the\numexpr\value{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 footnote\fancyfootnote{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. Second\fancyfootnote{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]{% ... }%
Ulilop
  • 66
2

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:

\let\origfootrule\footrule
\renewcommand{\footrule}{\iffootnote{}{\origfootrule}}
\renewcommand\footnoterule{\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 %----------------------------------------------------------------------------------------

\let\origfootrule\footrule \renewcommand{\footrule}{\iffootnote{}{\origfootrule}} \renewcommand\footnoterule{\origfootrule}

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

\newpage\section{With Footnote}
    First footnote\footnote{One}.
    Second footnote\footnote{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.

  • It doesn't work for me. I keep getting 2 rules... I used your minimal working example but in a preexisting template. However, it was already using fancyhdr to set up headers and footers; integrating your suggestion is not enough, evidently. It seems like your insertion creates a new footrule above the existing one. – Andrea Marino Dec 15 '23 at 22:36
  • That's what the line \renewcommand{\footrule}{\iffootnote{}{\origfootrule}} is for, it should only render the footrule if there is not footnote on the current page. /iffootnote is part of the fancyhdr package. If you have additional rules in your footer, they may still apply – Aram Becker Dec 27 '23 at 10:55
1

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.

Peter Flynn
  • 2,870
  • I was affraid there is no simple way. I guess I will eithe remove the line above footer and do what you propose or I will make peace with having the footnote as part of the text. Thanks for help! – Cunik16 Jul 19 '11 at 15:33