[texhax] Placing unknown images arbitrarily by lower left corner

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

On Thu, Mar 31, 2011 at 9:44 AM, William Adams <will.adams at frycomm.com>wrote:

> On Mar 31, 2011, at 9:25 AM, Peter Davis wrote:
>
> > 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.
>
> I believe you need to move the \raisebox call to where the box is used.

That's what I tried at first.  See example below.  The images still come out
at the bottom of the page.

Might there be something about \raisebox that would override the position
set with textpos's \begin{textblock}?

> If you want to store additional spacing information around the box you
> could do this by placing invisible rules in the box.
>

I'm not sure what this relates to.  I don't think I need any additional
spacing ... just the image contents of the box.

Here's the code I tried, using \raisebox at the point where the image is
placed:

\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}{\includegraphics[scale=2.0]{egg.png}}

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

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

\begin{textblock}{144}(288,396)
\raisebox{\height}{\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/1a09e93e/attachment.html>