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

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

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

Your Answer


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