[texhax] Placing unknown images arbitrarily by lower left corner

Peter Davis pfd at pfdstudio.com
Thu Mar 31 15:25:16 CEST 2011


On Thu, Mar 31, 2011 at 8:40 AM, Ulrike Fischer <news3 at nililand.de> wrote:

> Am Thu, 31 Mar 2011 08:18:47 -0400 schrieb Peter Davis:
>
> >>> \settoboxtotalheight{\imgheight}{\egg}
> >>> \raisebox{\imgheight}{\usebox{\egg}}
>
> >> It is actually not necessary to mesure the graphic before the
> >> \raisebox command. You can simply use
>
> >> \raisebox{\height}{\includegraphics{....}}
>
> >  Are you saying I should do this when I store the savebox, or when I use
> it?
>
> You can use it like I wrote it. \raisebox knows the dimensions of
> its argument and stores them in \height, \depth, \width.
>
>
>
Hmmm.  I tried this with XeLaTeX, but the images are still coming out at the
bottom of the page, rather than on the 396bp line.

Thank you.

Here's the current test document:

\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{textpos}
\usepackage{settobox}

\setlength{\TPHorizModule}{1bp}
\setlength{\TPVertModule}{\TPHorizModule}

\title{Image Placement Text}
\author{Peter Davis}

\newlength{\imgheight}

\begin{document}

\newsavebox{\egg}
\sbox{\egg}{\raisebox{\height}{\includegraphics[scale=2.0]{egg.png}}}

\newsavebox{\sheep}
\sbox{\sheep}{\raisebox{\height}{\includegraphics[scale=3.0]{sheep.png}}}

\begin{textblock}{144}(72,396)
\usebox{\egg}
\end{textblock}

\begin{textblock}{144}(288,396)
\usebox{\sheep}
\end{textblock}

\end{document}



-- 
----
The Tech Curmudgeon
http://www.techcurmudgeon.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20110331/72df6c69/attachment.html>


More information about the texhax mailing list