2

The following MWE:

\documentclass{book}
\usepackage{standalone}
\usepackage{changepage}
\usepackage{tikzpagenodes}
\usepackage{lipsum}
%
\newcommand\oddpageheadrule {%
  \tikz[remember picture,overlay] {%
    \draw [red]
    (current page header area.south east)
    --
    (current page header area.south west -| current page.north west)
    ;
  }%
}
\newcommand\evenpageheadrule {%
  \tikz[remember picture,overlay] {%
    \draw [blue]
    (current page header area.south west)
    --
    (current page header area.south east -| current page.north east)
    ;
  }%
}
%
\begin{document}
\oddpageheadrule
\lipsum[1-3]
\newpage
\evenpageheadrule
\lipsum[1-3]
\newpage
\oddpageheadrule
\lipsum[1-3]
\end{document}

leads to an odd page rule wider than expected, as shown by the following image.

enter image description here

As a workaround, it is enough to exchange the standalone and changepage order. But, as standalone package is advised to be loaded very early in the main document, I wonder if there is a safer workaround.

  • 1
    Don't load changepage at all. Standlone loads ifoddpage, which uses some of the same names as changepage. – John Kormylo Mar 2 '15 at 1:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.