TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

In the book class, how do I make sure a particular text I type goes on the odd page? Is there a command to "flush" the current page only if it happens to currently be an even page?

share|improve this question
up vote 6 down vote accepted

You can define your own command:

\documentclass{book}
\usepackage{ifoddpage}

\newcommand\alwaysodd[1]{%
\checkoddpage
\ifoddpage
#1%
\else
\mbox{}\clearpage#1%
\fi
}

\begin{document}
text \alwaysodd{test}
\newpage
text \alwaysodd{test}
\end{document}

A variant without arguments:

\documentclass{book}
\usepackage{ifoddpage}

\newcommand\alwaysodd{%
\checkoddpage
\ifoddpage\else
\mbox{}\clearpage%
\fi
}

\begin{document}
text \alwaysodd test
\newpage
text \alwaysodd test
\end{document}
share|improve this answer
    
Thanks! Can't this be simplified into a command with no arguments? So just typing \alwaysodd would do the trick. Then I don't have to make the command surround anything particular. – MayGodBlessKnuth Sep 23 '12 at 3:26
    
@MayGodBlessKnuth of course (I thought you required the argument); see my updated answer. – Gonzalo Medina Sep 23 '12 at 3:29
    
@GonzaloMedina: Of course you're right -- I've deleted my non-answer – Brent.Longborough Sep 23 '12 at 18:40

Your Answer

 
discard

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.