13

That seems quite elementary, but I didn't find the answer. How can I have the \cleardoublepage command work in a oneside environment? That seems kind of odd to ask for that, but I have to send an application file with a bunch of documents added to a .tex file via pdfpages. And I don't know whether it will be seen only on screen, printed on a one-sided printer or printed on a two-sided printer.

So I want the layout to be one-sided for the file not to look too odd on a computer screen or if printed onesidedly. But I also want new parts of the document to start on an odd page, so that my id card is not printed on the back of my research statement in case of two-sided printing.

Here is an example :

\documentclass[oneside,openright]{scrreprt}
\begin{document}
Foo1.
\newpage
Foo2.
\cleardoublepage
Foo3.
\cleardoublepage
Foo4
\end{document}

I would like "Foo4" to be on page 5, as it is in twoside mode.

1

1 Answer 1

13

You can define your own command:

\documentclass[oneside,openright]{scrreprt}

\newcommand\cleartooddpage{\clearpage
  \ifodd\value{page}\else\null\clearpage\fi}

\begin{document}
Foo1.
\newpage
Foo2.
\cleartooddpage
Foo3.
\cleartooddpage
Foo4
\end{document}

Add \thispagestyle{empty} after \null if you don't want headers and footers on the empty page.

3
  • 2
    BTW: KOMA-Script provides \ifthispageodd{<true>}{<false>} (which however needs two compilation runs)
    – cgnieder
    Mar 14, 2013 at 18:27
  • @cgnieder Testing \ifodd\value{page} after a \clearpage is safe.
    – egreg
    Mar 14, 2013 at 19:08
  • I know and I'm sure you wouldn't have suggested it if it wasn't. That's why I only made a “by the way” :)
    – cgnieder
    Mar 14, 2013 at 19:11

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.