Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm wondering if it's possible to suppress footers if the page has a footnote, but display the footer as normal otherwise. To be specific, I'm reproducing an old book which uses catchwords for pages without footnotes, so I am using the \NextWordBox macro from the fwlw package inside my footer. Thanks all and have a great Christmas.

EDIT: The solution provided by ADP works except for cases where the word with the footnote is the first word of a page, in which case the previous page style is reset instead of the page with the footnote. Here's a MWE.

\documentclass[14pt,twoside,openright]{memoir}
\usepackage[symbol,perpage]{footmisc}
\usepackage{fwlw}
\makepagestyle{fn} %defines style when footnote is present
\makeevenhead{fn}{\thepage}{THE TWO NEW SCIENCES OF GALILEO}{}
\makeoddhead{fn}{}{\leftmark}{\thepage}
\makeoddfoot{fn}{}{}{}
\makeevenfoot{fn}{}{}{}
\makepagestyle{standard} %defines headings
\makeevenhead{standard}{\thepage}{THE TWO NEW SCIENCES OF GALILEO}{}
\makeoddhead{standard}{}{\leftmark}{\thepage}
\makeoddfoot{standard}{}{}{\usebox\NextWordBox}
\makeevenfoot{standard}{}{}{\usebox\NextWordBox}
\pagestyle{standard}
\newcommand{\myfootnote}[1]{%
    \footnote{#1}%
    \thispagestyle{fn}%change pagestyle for this page only.
}
\begin{document}
This is a sentence.
\newpage
This is another sentence.\myfootnote{This is a footnote}
\newpage
This is yet another sentence.
\end{document}
share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Solution using Fancyhdr Package.

The method that comes to mind for me, is if you use the fancyhdr package, define two fancy page styles, one of pages where there are no footnotes, and one where there are.

Then by creating a new command for writing a footnote, which temporarily changes the page style, the output is achieved.

Here is a minimum working example.

\documentclass{article}

\usepackage{lipsum}
\usepackage[bottom]{footmisc}
\usepackage{fancyhdr}

%Header and Footer.
\fancypagestyle{detailed}{
    \fancyhf{} % clear all header and footers
    \fancyhead[L]{LEFT HEADER}
    \fancyhead[R]{RIGHT HEADER}
    \fancyfoot[L]{LEFT FOOTER}
    \fancyfoot[R]{RIGHT FOOTER}
    \renewcommand{\headrulewidth}{1pt}
    \renewcommand{\footrulewidth}{1pt}
}
\fancypagestyle{detailed_nofoot}{
    \fancyhf{} % clear all header and footers
    \fancyhead[L]{LEFT HEADER}
    \fancyhead[R]{RIGHT HEADER}
    \renewcommand{\headrulewidth}{1pt}
    \renewcommand{\footrulewidth}{0pt}
}

\newcommand{\myFootNote}[1]{
    \footnote{#1}
    \thispagestyle{detailed_nofoot} %change pagestyle for this page only.
}

\begin{document}
    \pagestyle{detailed}
    \section{Example With Footnotes}
    \lipsum[1-2]\myFootNote{First Footnote}\myFootNote{Second Footnote}
    \newpage
    \section{Example Without Footnotes}
    \lipsum[1-2]
\end{document}

Bottom of page with footnotes present:

Footnote

Bottom of page without footnotes present:

No Footnote

share|improve this answer
    
Sorry to bug you but I have noticed a small problem with this solution. It works perfectly except for cases where the word with the footnote is the first word of a page, in which case the previous page is set with the detailed_nofoot style instead of the page with the word. –  Neo Dec 27 '12 at 23:34
    
Could you please post code for an example that creates the above error? –  Nicholas Hamilton Dec 28 '12 at 3:58
    
I have edited my post. –  Neo Dec 28 '12 at 19:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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