[texhax] a 1 inch .pdf == 4.30554pts?
Ulrike Fischer
news3 at nililand.de
Fri Dec 11 10:03:22 CET 2009
Am Thu, 10 Dec 2009 14:53:08 -0500 schrieb William Adams:
> I'm measuring boxes again, and getting some odd dimensions.
>
> First, create a .pdf using the following logo.tex file:
>
> \documentclass{article}
> \usepackage{calc}
> \usepackage{geometry}
> \geometry{
> paperwidth=1in,
> paperheight=1in,
> margin=0mm}
> \begin{document}
> \noindent\begin{picture}(0,0)\put(0,0){\rule[\baselineskip-1in]{1in}
> {1in}}\end{picture}
> \end{document}
>
> Then pull it into a second .tex file, and the measured size varies
> according to whether or no it's been pulled into a \savebox?:
>
> \documentclass{article}
> \usepackage{calc,graphicx}
> \usepackage{geometry}
> \geometry{
> paperwidth=3in,
> paperheight=3in,
> margin=0mm}
> \begin{document}
> \newsavebox{\scaledLogo}
> \newlength{\LogoVSize}
> \sbox{\scaledLogo}{\includegraphics{logo.pdf}}%
> \settoheight{\LogoVSize}{\scaledLogo}%
> \usebox{\scaledLogo}
>
> \the\LogoVSize
>
> \settoheight{\LogoVSize}{\includegraphics{logo.pdf}}
>
> \the\LogoVSize
>
> \includegraphics{logo.pdf}
>
> \end{document}
>
> For some reason \LogoVSize == 4.30554pt when measuring the \savebox,
> but 72.2698pt when measuring the graphic directly --- why is that?
Because you are not measuring the height of the box
(\usebox{\scaledLogo}) but of the command \scaledLogo:
\documentclass{article}
\begin{document}
\newsavebox{\scaledLogo}
\newlength{\LogoVSize}
\sbox{\scaledLogo}{\rule{1in}{1in}}%
\scaledLogo,
\settoheight{\LogoVSize}{\scaledLogo}%
\the\LogoVSize
\bigskip
\usebox{\scaledLogo}
\settoheight{\LogoVSize}{\usebox{\scaledLogo}}%
\the\LogoVSize
\end{document}
--
Ulrike Fischer
More information about the texhax
mailing list