2

I'm using this on my document (scrartcl documentclass):

\usepackage{etoolbox}
\pretocmd{\section}{\cleardoubleevenemptypage}{}{}
\pretocmd{\part}{\cleardoubleevenemptypage}{}{}

This makes me get blank pages so that the sections and parts always start on even pages, which is nice. (I shall say I'm using fancyhdr to define the header and footer).

So my question, is there any similar command to \pretocmd that applies to the current section page instead of the previous pages? I've looked for such thing in the etoolbox documentation, but I couldn't find anything.

More precisely, what I want is to get no header and footer on the Part pages.

Edit: I know I can use \part{}\thispagestyle{empty} but I'd like to make this step automatic by defining it (similar to the \pretocmd command) within the the document preamble.

2
  • 3
    What happens if you use \part{title}\thispagestyle{empty}?
    – Sigur
    Commented May 3, 2013 at 0:16
  • @Sigur Oh, yes, it works. But is there a way to define it into the document preamble? It's not a big deal to do it manually on every part, but I'd like to make it automatic. Commented May 3, 2013 at 6:46

1 Answer 1

3

Update your preamble to use the following:

\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\pretocmd{\section}{\cleardoubleevenemptypage}{}{}
\pretocmd{\part}{\cleardoubleevenemptypage\thispagestyle{empty}}{}{}

This will, after clearing the page to start on an even page, immediately issue \thispagestyle{empty}. It is equivalent to performing

\part{<part title>}\thispagestyle{empty}

manually. Here's a mild illustration (doesn't use fancyhdr, although the principle is the same):

enter image description here

\documentclass[twoside]{scrartcl}% http://ctan.org/pkg/KOMA-script
\usepackage{etoolbox,lipsum}% http://ctan.org/pkg/{etoolbox,lipsum}
\pretocmd{\section}{\cleardoubleevenemptypage}{}{}
\pretocmd{\part}{\cleardoubleevenemptypage\thispagestyle{empty}}{}{}
\begin{document}
\part{A part}
\section{A section}
\lipsum[1-12]
\part{Another part}
\section{Another section}
\lipsum[13-25]
\part{A final part}
\section{A final section}
\lipsum[13-25]
\end{document}
0

You must log in to answer this question.

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