1

I need a command to create a page break, and here's my attempt:

\documentclass[12pt]{article}

\usepackage{lipsum}

\newcommand\blankpage{%
\thispagestyle{empty}
\clearpage\mbox{}\clearpage}

\begin{document}

\lipsum[1]

\blankpage

\lipsum[2]

\end{document}

However, I don't want the page number to appear in the page break. The command \thispagestyle{empty} doesn't work, how can I do it?

  • 1
    There alread is a command called \pagebreak which you don't want to use. There is also cleardoublepage. and the emptypage package. There is also report and book which introduce those pages automatically. You most likely want to go with the last thing of changng the class. – Johannes_B Aug 22 '16 at 4:31
  • You are setting the pagestyle to plain on this page, clear to the next (which you want to be empty) and clear to the next once more. If you want that page empty, why are you setting this empty instead? – Johannes_B Aug 22 '16 at 4:32
  • I am not sure I am following you. I want the blank page to be empty. – RobertP. Aug 22 '16 at 4:35
  • I understand. You want that page to be empty. But you are setting this page to be empty, which is the first. Look at your own example and output. \newcommand\blankpage{\clearpage\thispagestyle{empty}\mbox{}\clearpage} – Johannes_B Aug 22 '16 at 4:38
  • Ok, so I just need to move thispagestyle{empty} before \clearpage? Is that what you are suggesting? – RobertP. Aug 22 '16 at 4:41
2

You need the following ordering within something like \insertblankpage:

\newcommand{\insertblankpage}{%
  \clearpage% Flush pending page content
  \thispagestyle{empty}% Set page style to be 'empty' (no header/footer)
  \mbox{}% Some some (blank) content on the page
  \clearpage}% Flash page content

That is, you need to (in order)

  1. \clearpage - flush all pending page content;
  2. \thispagestyle{empty} - set the page style to be empty and therefore avoid any headers/footers from being displayed;
  3. \mbox{} - set some (invisible) content on the page; and
  4. \clearpage - flush all pending page content again.

Calls to (2) and (3) can be swapped as they both pertain to different (invisible) content on the same page.

| improve this answer | |
1

Moving \clearpage up in the definition will fix the problem. Try this:

\documentclass[12pt]{article}

\usepackage{lipsum}

\newcommand\blankpage{%
\clearpage
\thispagestyle{empty}%
\mbox{}\clearpage}

\begin{document}

\lipsum[1]

\blankpage

\lipsum[2]

\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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