0

I have a peculiar requirement. In a float page containing one big figure, I would like to remove all header information. However, in a float page containing a big table, I'd like to retain the header.

Is this feasible (perhaps if not with pdftex, at least with luatex maybe)?

Here is a starter MWE, that gets rid of headers in all float pages (irrespective of it containing a table or figure or any combination)

   \documentclass[a4paper]{book}
\newcommand{\mpfootnotes}[1][1]{
  \renewcommand{\thempfootnote}{\thefootnote}
  \addtocounter{footnote}{-#1}
  \renewcommand{\footnote}{\stepcounter{footnote}\footnotetext[\value{footnote}]}}
  \usepackage[demo]{graphicx}
\usepackage{lipsum}% debug only
\usepackage[paper=a4paper, hmarginratio=1:1, vmarginratio=1:1, scale=0.75]{geometry}
\usepackage{fancyhdr}
\usepackage{booktabs}
\newcommand{\setFancyHdr}{
    \pagestyle{fancy}
    \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\thechapter. ##1 }}{}}
    \renewcommand{\sectionmark}[1]{\markright{\thesection\ ##1}}
    \fancyhf{}
    \fancyhead[R]{{\bfseries\rightmark}}
    \fancyfoot[C]{\thepage}
    \fancypagestyle{plain}{
        \fancyhead{}
        \renewcommand{\headrulewidth}{0pt}
    }
}
\setlength{\headheight}{14.5pt}
\setFancyHdr
\renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
\begin{document}

\chapter{First}
\section{First section}
\lipsum[1-2]
\begin{figure}[p]      % the figure needs to occupy the entire page. Hence permitting only the 'p' modifier. 
    \begin{minipage}[t]{\textwidth}
        \centering
        \includegraphics[angle=90,width=\textwidth]{demo} % 'fig_master_flow_diagramPDF.pdf' is a huge figure and needs to stretch/shrink suitably to occupy the entire type-area available.
        \caption
        [%
        Interesting caption
        ]%
        {%
             Interesting caption\footnotemark.
        }%
        \label{fig:fig_strategy_schematic}
        \mpfootnotes[1]
        \footnote{Some important footnote}
    \end{minipage}
\end{figure}
\lipsum[1-4]

\begin{table}[p]
\caption{A table on a float page}
\centering
\begin{tabular}{ll}
\toprule
a & 1  \\
b & 2  \\
c & 3  \\
d & 4  \\
e & 5  \\
f & 6  \\
g & 7  \\
h & 8  \\
i & 9  \\
j & 10 \\
k & 11 \\
l & 12 \\
m & 13 \\
n & 14 \\
o & 15\\
\bottomrule
\end{tabular}
\end{table}
\lipsum[1-6]
\end{document}
  • Maybe you could test \@captype for figure or table… – TeXnician Sep 06 '18 at 14:53
  • IIRC, you can't change the pagestyle inside a float. The code actually executes on the page it is created on and is stored in a savebox. See https://tex.stackexchange.com/questions/427572/remove-header-footer-on-page-with-large-figure – John Kormylo Sep 06 '18 at 19:18
  • Have a look at titleps and \nextfloathead. Caveat: I'm the author of titleps. – Javier Bezos Sep 09 '18 at 16:45

0 Answers0