[texhax] Is the package textpos broken?

Chris Bergstresser chris at subtlety.com
Thu Aug 24 01:49:47 CEST 2006


Hi all --

    So I've found the graphics package, which lets me place an image
of a form page behind my text, and the textpos package, which lets me
arbitrarily place boxes over it.  This works pretty well, but it
doesn't handle descenders well.  Or at all, actually.
   You can see the problem in the following code (labelled A and B) --
no matter whether I align boxes from the top left or bottom left
corner, the spacing is from the outer box dimensions.  Thus, the
positioning does not take into account the characteristics of the font
itself.
   I could work around this -- taking into account the descenders when
I place the item on the page myself -- except that although the
documentation claims to work with the calc package it doesn't actually
seem to.  That's in the part labelled C and D.  It doesn't accept
either the lengths or the calculations.
   Am I doing something wrong?

-- Chris

----

\documentclass{article}
\usepackage{calc}
\usepackage[absolute]{textpos}

\setlength\TPHorizModule{1pt}
\setlength\TPVertModule{1pt}

\newlength{\declength}

\begin{document}
\begin{textblock}{100}[0,1](100,100)A: XX\end{textblock}
\begin{textblock}{100}[0,1](135,100)yy\end{textblock}

\begin{textblock}{100}[0,0](200,92)B: XX\end{textblock}
\begin{textblock}{100}[0,0](235,92)yy\end{textblock}

\setlength{\declength}{130pt}
\begin{textblock}{100}[0,1](100pt,1\declength)C: XX\end{textblock}
\begin{textblock}{100}[0,1](135pt,1\declength)yy\end{textblock}

\begin{textblock}{100}[0,0](200pt,1\declength - 8pt)D: XX\end{textblock}
\begin{textblock}{100}[0,0](235pt,1\declength - 8pt)yy\end{textblock}
\end{document}


More information about the texhax mailing list