1

I'm inserting an empty page with page number the following way:

\newpage
\thispagestyle{plain}
\mbox{} 

Now, my header and footer are also showing up in the empty page, but I defined my header and footer with use of the \fancyhead and fancyfoot within an \fancypagestyle{plain}. How, do I get rid of the header and footer while inserting an empty page?

5
  • 2
    did you try \thispagestyle{empty}? May 31, 2016 at 7:53
  • 1
    I think it's \thispagestyle{empty}. But I don't know how it works with fancy.
    – sirjofri
    May 31, 2016 at 7:54
  • Yes, the \thispagestyle{empty} works fine to get an empty page, but I need the page number as well. I don't want to do this manually.
    – Pim
    May 31, 2016 at 8:13
  • 4
    your comments don't seem to match your question. The footer normally contains the page number so if you want the page number you want to use a page style that has the number, such as the original plain page style. if you have redefined plain to be a style that has additional things that you do not need, it is hard to give any advice other than don't do that, since you have shown no code. May 31, 2016 at 8:53
  • See What makes a good MWE meta.tex.stackexchange.com/q/3343/90087
    – A Feldman
    May 31, 2016 at 12:53

1 Answer 1

0

You can always define your own pagestyles. See this MWE:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}

\usepackage{fancyhdr}


\fancypagestyle{emptyhead}{                 % Define a new pagestyle
    \fancyhf{}                              % Clear header/footer
    \fancyfoot[C]{\thepage}                 % Set pagenumber in footer
    \fancyfoot[R]{(No header on this page)}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{.4pt}
}

\fancypagestyle{plain}{                     % Redefine style "plain"
    \fancyhf{}
    \fancyhead[C]{Header for plain-style pages}
    \fancyfoot[R]{\thepage}
    \renewcommand{\headrulewidth}{.4pt}
}

\pagestyle{fancy}                           % Define fancy pagestyle for common pages
\lhead{Author's name}                       % Set left header
\chead{}                                    % Clear center header
\rhead{Document title}                      % Set right header
\lfoot{}                                    % Clear left/center footer
\cfoot{}
\rfoot{\thepage}                            % Put pagenumber in right footer
\renewcommand{\headrulewidth}{.4pt}

\begin{document}

\section{Hocus}\thispagestyle{plain}
\lipsum[1-10]
\clearpage

\section{Pocus}\thispagestyle{emptyhead}
\lipsum[11-20]
\clearpage

\section{Bogus}\thispagestyle{empty}
\lipsum[21-30]
\end{document}

The first page of section 1 uses \thispagestyle{plain}, with a special header in the center and the page number in the right footer. The first page of section 2 is set with \thispagestyle{emptyhead}, with no header and the page number in the center of the footer (which is what \pagestyle{plain} would usually look like. The first page of section 3 has neither header nor footer (\thispagestyle{empty}). All other pages use the normal \pagestyle{fancy}.

Is that what you wanted to do?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .