Tell me more ×
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.

I've just switched from pdflatex to xelatex for my lectures to take advantage of the unicode-math package so that I can change the colours of all my mathematics. When compiling the "handout" version last night, I found that it didn't work as I expected. I use the pgfpages package to produce the handout as a 4-up document (with a nice box round each frame) to save paper. But the page size in the resulting document was that of one slide, not a full a4 piece of paper. A little googling led me to a quick fix on tug:

\newlength\hackpaperwidth \hackpaperwidth210mm
\newlength\hackpaperheight \hackpaperheight297mm
\RequirePackage{everyshi}
\EveryShipout{%
 \special{papersize=\the\hackpaperwidth,\the\hackpaperheight}}

with the comment (from the author):

Probably not the cleanest way of doing things, so if someone has a better idea and/or can locate the bug exactly, comments welcome.

There were no follow-up comments, but it was dated November 2008. In June 2009, there's a similar-looking problem on the xetex mailing list with this response:

That's a reported (and probably not fixed yet) problem in pgfpages. Use this to tell pgfpages how to set page sizes in XeLaTeX:

\renewcommand\pgfsetupphysicalpagesizes{%
    \pdfpagewidth\pgfphysicalwidth\pdfpageheight\pgfphysicalheight%
}

(These are (linked from) the top two hits on google for xelatex pgfpages).

My real question is: is this going to get fixed? But that's not a good tex.SE question. So my attempt to make it into a good question is:

The second of the above seems the better of the two. Is that the best way to fix this problem?

PS The MWE from the first linked post is still a suitable one:

\documentclass{beamer}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[a4paper]
\begin{document}
\frame{\frametitle{A} foo}
\frame{\frametitle{B} bar}
\end{document}
share|improve this question
Thanks for writing this up so well. I'm having the same issue and it looks like I have to use the same workaround. – Matthew Leingang Jan 20 '11 at 19:04
@Matthew: You mean that you are using coloured letters in maths as well? Only kidding. I'm still using the workaround too. – Andrew Stacey Jan 20 '11 at 21:54
No, xetex and pgfpages...but I think you knew that.:-P – Matthew Leingang Jan 21 '11 at 17:02

1 Answer

Use option dvipdfm:

\documentclass[dvipdfm]{beamer}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[a4paper]
\begin{document}
\frame{\frametitle{A} foo}
\frame{\frametitle{B} bar}
\end{document}
share|improve this answer
In my first test, that just fixed it for the first page but all the other pages were as before (but that was a test on a complicated document so I'll try it on the MWE too). – Andrew Stacey Sep 14 '10 at 8:01

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.