TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a report and I want to make sure that each new chapter starts in an odd page. So I wrote the following script which I put before each chapter:

%-- to make sure that a new chapter starts on the right side (odd page) %
\ifodd \thepage

It works as following:

If the page before my new chapter is odd, it means that I have to add a blank page in order to start to start the new chapter in the next odd page number.

It works fine if the previous page is a normal page.

But when I have a figure in the page before it, which was moved to a new page since it did not fit in the page and there is not text in the page alongside with the float, then this script does not work.

The command \thepage returns a wrong page number (apparently it does not increment if the page only contains a float) and so it does not add a blank page in case the last page was indeed odd.

I dont know how to solve this issue. any ideas?

thanks for helping.

share|improve this question
Have you checked \cleardoublepage? – Alex Aug 28 '12 at 8:29
Use the class options 'twoside' and 'openright'. – lockstep Aug 28 '12 at 8:33
up vote 8 down vote accepted


  • \thepage can be anything, roman numerals, complex page numbers (1-2), … However, \ifodd only expects an arabic number. Better is the use of the counter value \value{page}.

  • The output routine is called asynchronous. Therefore at the time of \ifodd somewhere it is not clear, what the pages will be. Much more safe is the place at the top of a page.

  • Many document classes provide option twoside and command \cleardoublepage. For instance, KOMA-Script classes provide lots of options and commands. Also a chapter usually starts with \cleardoublepage if twoside is given.

For the standard classes, \cleardoublepage can be redefined to set empty headers and footers for empty pages:

  \clearpage % output floats if necessary
  % new page starts here
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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