[XeTeX] Generating cropped PDF graphics file

R (Chandra) Chandrasekhar chandra at ee.uwa.edu.au
Wed Apr 16 17:45:59 CEST 2008


William Adams wrote:
> On Apr 16, 2008, at 4:04 AM, R (Chandra) Chandrasekhar wrote:
> 
>> Given that the "bounding box" of the logo text is not known  
>> beforehand, how
>> might I use the geometry package to the correct size initially in  
>> the preamble?
> 
> Calculate it in the preamble from the saved box, then use geometry to  
> set the page size, then use the saved box after \begin{document}.
> 
> William
> 

Thanks, I have done that now.

What I have in the file is:

\documentclass[10pt,a4paper]{article}
...
\newsavebox{\logobox}
\sbox{\logobox}{...} % as previously defined
%
\newlength{\pheight}
\newlength{\pwidth}
\settoheight{\pheight}{\logobox}
\settowidth{\pwidth}{\logobox}
%
\usepackage[paperwidth=\pwidth,paperheight=\pheight]{geometry}
\begin{document}
%
\usebox{\logobox}
%
\end{document}

This gives me four small empty pages instead of one correctly sized small page 
tightly fitted to the logo.

Can you please tell me what I am doing wrong?

Thanks.

Chandra


More information about the XeTeX mailing list