Sign up ×
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.

Why does \ifoddpage seem to always return false in the following example? This is related to question 6143 on this same forum. I'm using XeLaTeX to produce a pdf file (i.e., xelatex test.tex)

% for Blurb, set this to the actual desired size as indicated by the
% size calculator on their web site
% See the memoir class documentation for an explanation of all the page
% layout parameters.
\setlrmarginsandblock{81pt}{54pt}{*} % calculates \textwidth
\setulmarginsandblock{72pt}{36pt}{*} % calculates \textheight
\raggedright     % comment to force even justification
\setlength{\parindent}{0in}   % paragraph indentations
\setlength{\parskip}{1em}   % space between paragraph
\checkandfixthelayout    % Set all the layout values
share|improve this question
Welcome to TeX.SX! For future reference, you can format code by prepending each line with four spaces; this can be automatically done by selecting it all and clicking the 101010 button, or just hitting control-k. – Antal Spector-Zabusky Dec 19 '10 at 1:17
I added a link to question 6143. To do this, highlight the text and click the little picture of the chain links, and the put the relevant URL in the popup box. – Seamus Dec 19 '10 at 12:24

1 Answer 1

You have to call \checkoddpage before, which sets \ifoddpage to true or to false. Better do a strict check. This works fine in your code, toggling Odd and Even on page breaks:

share|improve this answer
Thanks Stefan ! – Tim Jacobs Dec 19 '10 at 2:29

Your Answer


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