Take the 2-minute tour ×
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.

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

1 Answer 1

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.