4

I'm looking for a solution to put on empty pages generated by cleardoublepage a centered text "empty page". What I want is, that all sections open right and I there added a empty page, this page should marked with "empty page".

\documentclass[11pt,a4paper,twoside,openright,
               notitlepage,cleardoublepage=empty,
               ngerman]{article}
\usepackage[a4paper,
            bindingoffset=1cm,margin=2cm,
            includeheadfoot,
%            top=25mm, bottom=25mm,
%            headheight=15mm, headsep=7mm
            ]{geometry}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % Load the TS1-encoding e.g. through textcomp 
\usepackage{verbatim, environ}
\usepackage{lmodern}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{blindtext}


\begin{document}
\section{eins}
\blindtext
\cleardoublepage
\section{zwei}
\blindtext
\cleardoublepage
\section{drei}
\blindtext
\blindtext
\blindtext
\Blindtext
\cleardoublepage
\section{vier}
\blindtext
\blindtext
\blindtext
\Blindtext
\end{document} 


1st modified exsample

In attention to your comments here a new example. This shows how it should look like. Only the mark "empty page" is missing. The functionality of cleardoublepage and the head and foot have to be untouched.

The functionality I mean is: cleardoublepage only insert a empty page if the last section ends on an odd page (old section: odd page -> cleardoublepage: empty even page -> next section: odd page). In case of a section ends on an even page cleardoublepage hast no effects. (old section: odd page -> cleardoublepage: no page inserted -> next section: odd page)

\documentclass[11pt,a4paper,twoside,
               notitlepage,
               ngerman]{article}
\usepackage[a4paper,
            bindingoffset=1cm,margin=2cm,
            includeheadfoot,
            ]{geometry}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % Load the TS1-encoding e.g. through textcomp 
\usepackage{verbatim, environ}
\usepackage{lmodern}
\usepackage{amsmath,amsfonts,amssymb}

\makeatletter
   \def\ps@vakatseite{%
     \vspace*{\fill}
     \centering This page would be intentionally left blank if we would not wish to inform about that.
      \vspace{\fill}
   }
\makeatother

\newcommand{\newsection}[1]
   {{\cleardoublepage}
    \section{#1}
   }

\usepackage{fancyhdr}
 \pagestyle{fancy}
 \fancyhead[OL]{\scshape\leftmark}
 \fancyhead[ER]{\scshape\leftmark}
 \fancyhead[EL,OR]{\thepage}
 \fancyfoot[OL]{\scshape\leftmark}
 \fancyfoot[ER]{\scshape\leftmark}
 \fancyfoot[EL,OR]{\thepage}
 \renewcommand{\footrulewidth}{0.5pt}

\usepackage{blindtext}

\begin{document}
\newsection{eins}
\blindtext
\newsection{zwei}
\blindtext[3]
\newsection{drei}
\blindtext[8]
\newsection{vier}
\blindtext[4]
\end{document}

If I use

\clearpage{\pagestyle{vakatseite}\cleardoublepage}

I will get one or two empty pages with one marked page. I want zero or one page instead... printed example



Final Code

Thanks to Harish Kumar. This solution is fully what I want :)

\documentclass[11pt,a4paper,twoside,
               notitlepage,
               ngerman]{article}
\usepackage[a4paper,
            bindingoffset=1cm,margin=2cm,
            includeheadfoot,
            ]{geometry}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % Load the TS1-encoding e.g. through textcomp 
\usepackage{verbatim, environ}
\usepackage{lmodern}
\usepackage{amsmath,amsfonts,amssymb}

\makeatletter
\def\emptypage@emptypage{%
    \hbox{}%
     \vspace*{\fill}
     \begin{center}
     This page would be intentionally left blank\\ if we would not wish to inform about that.
     \end{center}
     \vspace{\fill}
     \newpage%    
}%
\def\cleardoublepage{%
        \clearpage%
        \if@twoside%
            \ifodd\c@page%
                % do nothing
            \else%
                \emptypage@emptypage%
            \fi%
        \fi%
    }%
\makeatother

\newcommand{\newsection}[1]
   {\cleardoublepage
    \section{#1}
   }

\usepackage{fancyhdr}
 \pagestyle{fancy}
 \fancyhead[OL]{\scshape\leftmark}
 \fancyhead[ER]{\scshape\leftmark}
 \fancyhead[EL,OR]{\thepage}
 \fancyfoot[OL]{\scshape\leftmark}
 \fancyfoot[ER]{\scshape\leftmark}
 \fancyfoot[EL,OR]{\thepage}
 \renewcommand{\footrulewidth}{0.5pt}

\usepackage{blindtext}


\begin{document}
\newsection{eins}
\blindtext
\newsection{zwei}
\blindtext[3]
\newsection{drei}
\blindtext[7]
\newsection{vier}
\blindtext[4]
\end{document}

enter image description here

  • Does tex.stackexchange.com/questions/1727/… help? – egreg Feb 20 '14 at 0:50
  • 1
    What are openright, cleardoublepage=empty and notitlepage supposed to do? I didn't think (1) applied to article. I can't find (2) in any of the base files for LaTeX, and I thought (3) was default for article. EDIT: I guess (2) is from koma-script but I don't think it will have any effect here. Indeed, latex complains that the following global options are unused: [openright,cleardoublepage=empty]. – cfr Feb 20 '14 at 0:57
  • Are you bound to use the article document class or would you be willing to use another one (scrartcl or memoir, for example)? – Gonzalo Medina Feb 20 '14 at 1:18
  • @cfr openright - comes by a further test - it's unnecessary; notitlepage - I need for the abstract; cleardoublepage=empty - set the pagestyle on clearpages -> that's the part I want to improve – Alex44 Feb 20 '14 at 8:43
  • Not with article. cleardoublepage=empty does zilch with article. notitlepage is default anyway. With article. If you are getting different results, you are either loading additional packages which make use of those global options or you are using a different class. – cfr Feb 20 '14 at 21:57
7

As per the update to the OP, I think if you add these in your preamble:

\usepackage{tikz}
\newcommand*{\blankpage}{%
\begin{tikzpicture}[remember picture,overlay]
\node[draw=orange,fill=blue!50!green,scale=4,rotate=45,anchor=center,rounded corners=2em,text=magenta] at (current page.center) {Empty Page};
\end{tikzpicture}
}

\makeatletter
\def\emptypage@emptypage{%
    \hbox{}%
    \blankpage%
    \newpage%    
}%
\def\cleardoublepage{%
        \clearpage%
        \if@twoside%
            \ifodd\c@page%
                % do nothing
            \else%
                \emptypage@emptypage%
            \fi%
        \fi%
    }%
\makeatother

you will get the desired result. You can replace \blankpage as per you wish.

Full code:

\documentclass[11pt,a4paper,twoside,
               notitlepage,
               ngerman]{article}
\usepackage[a4paper,
            bindingoffset=1cm,margin=2cm,
            includeheadfoot,headheight=15pt
            ]{geometry}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % Load the TS1-encoding e.g. through textcomp
\usepackage{verbatim, environ}
\usepackage{lmodern}
\usepackage{amsmath,amsfonts,amssymb}

\usepackage{tikz}
\newcommand*{\blankpage}{%
\begin{tikzpicture}[remember picture,overlay]
\node[draw=orange,fill=blue!50!green,scale=4,rotate=45,anchor=center,rounded corners=2em,text=magenta] at (current page.center) {Empty Page};
\end{tikzpicture}
}

\makeatletter
\def\emptypage@emptypage{%
    \hbox{}%
    \blankpage%
    \newpage%    
}%
\def\cleardoublepage{%
        \clearpage%
        \if@twoside%
            \ifodd\c@page%
                % do nothing
            \else%
                \emptypage@emptypage%
            \fi%
        \fi%
    }%
\makeatother


\newcommand{\newsection}[1]
   {{\cleardoublepage}
    \section{#1}
   }

\usepackage{fancyhdr}
 \pagestyle{fancy}
 \fancyhead[OL]{\scshape\leftmark}
 \fancyhead[ER]{\scshape\leftmark}
 \fancyhead[EL,OR]{\thepage}
 \fancyfoot[OL]{\scshape\leftmark}
 \fancyfoot[ER]{\scshape\leftmark}
 \fancyfoot[EL,OR]{\thepage}
 \renewcommand{\footrulewidth}{0.5pt}

\usepackage{blindtext}

\begin{document}
\newsection{eins}
\blindtext
\newsection{zwei}
\blindtext[3]
\newsection{drei}
\blindtext[8]
\newsection{vier}
\blindtext[4]
\end{document}

enter image description here

If you want these blank pages to have no header and footer add \thispagestyle{empty} just before \blankpage in the definition of \emptypage@emptypage:

\def\emptypage@emptypage{%
    \hbox{}%
    \thispagestyle{empty}   %% or any page style
    \blankpage%
    \newpage%    
}%
  • This is on the right way, but this removes my footline and the functionality of cleardoublepage. This create only a empty page if an section (in my case) ends on an odd page, so that a empty page filled in on the next even page and the next section starts on an odd page... – Alex44 Feb 20 '14 at 8:41
  • I add a new example in the post above. And a new try of explanation... – Alex44 Feb 20 '14 at 9:42
  • How can I insert a printed tex-example like you? – Alex44 Feb 20 '14 at 9:44
  • it is uploaded above – Alex44 Feb 20 '14 at 10:25

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.