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 working on a book with fancyhdr with some overfull float pages, and want to remove the footer on only those pages, but keep the header.

Can I either automatically remove footer if the caption writes over it or include something in the caption which does that?

\documentclass[a4paper,12pt]{book}
\usepackage{fancyhdr}

\pagestyle{fancyplain}
\fancyhf{}
\addtolength{\headheight}{2.5pt}
\fancyhead[LE]{\textsl{\rightmark}}
\fancyhead[RO]{\textsl{\leftmark}}
\cfoot{\thepage}

\begin{document}
\mainmatter

\chapter{Introduction}
\section{First}
text

\begin{figure}[p]
\rule{1cm}{1cm}
\caption{small figure page, print page number}
\end{figure}

\begin{figure}[p]
\rule{10cm}{20.8cm}
\caption{large figure page, don't print page number}
\end{figure}

\end{document}

PS: Can I deactivate the "float too large" warning if it fits on the page once the footer is removed?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

I can't offer a solution for fancyhdr, but the recently released titleps package features (among other things) the commands \nextfloathead and \nextfloatfoot which force a header/footer for the float immediately following these commands.

Note that titleps uses a pagestyle definition syntax rather different from those of fancyhdr and the scrpage2 package -- see section 2 of the titleps manual for details, particularly about the \sethead and \setfoot commands.

\documentclass[a4paper,12pt]{book}

\usepackage[psfloats]{titleps}

\renewpagestyle{headings}{%
  \headrule
  \sethead[\textsl{\thechapter~\chaptertitle}][][]
      {}{}{\textsl{\thesection~\sectiontitle}}%
  \setfoot{}{\thepage}{}%
}
\renewpagestyle{plain}{%
  \setfoot{}{\thepage}{}%
}
\pagestyle{headings}

\begin{document}

\chapter{Introduction}

\section{First}

text

\begin{figure}[p]
\rule{1cm}{1cm}
\caption{small figure page, print page number}
\end{figure}

\nextfloatfoot{}{}{}{}

\begin{figure}[p]
\rule{10cm}{20.8cm}
\caption{large figure page, don't print page number}
\end{figure}

\end{document}
share|improve this answer
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.