[XeTeX] Generating cropped PDF graphics file

Ross Moore ross at ics.mq.edu.au
Thu Apr 17 04:14:23 CEST 2008

Hi Chandra,

On 16/04/2008, at 5:47 PM, R (Chandra) Chandrasekhar wrote:
> Ross Moore wrote:
>> You can \shipout just a box containing the contents that you want.

>> Similar coding should work with XeTeX as it also
>> uses  \pdfpageheight  and  \pdfpagewidth .
> Thanks, Ross. I have now used \newbox, \sbox, and \usebox in  
> XeLaTeX for the
> logo text. But I have not been able to use the above commands  
> starting with
> \setbox with XeLaTeX to get the desired output. Is there a LaTeX/ 
> XeLaTeX
> equivalent for these commands?

This works just fine for me, with XeLaTeX
(XeTeX v. 0.997 )

  The quick brown fox jumps over the lazy dog.

And so does the following:


%\setmainfont{Minion Pro}  % I don't have this font
\setmainfont{Lucida Grande}%

\definecolor[named]{lettercolor}{cmyk}{0, 0.75, 0.75, 0.50}
\definecolor[named]{linecolor}{cmyk}{0.5, 0.1, 0.5, 0.25}%

      \usebox{\logobox}%<--- contents goes here
     \kern1 truein}%
   \dimen0\ht0 \advance\dimen0\dp0
\usebox{\logobox}%  see it on the page also

All the package solutions do basically this, plus often
a lot more stuff which is frequently quite redundant.
You don't need to know the size in advance; and parameters
such as margins, topskip, h-offset, v-offset, baselines
etc. are completely irrelevant.

You can add (coloured) frames, put colour in the background,
apply scaling effects or transformations from the graphics(x)
package, or whatever.

> Chandra
> 16 Apr 08

Hope this helps,


Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114

More information about the XeTeX mailing list