[pstricks] Width of text/boxes

Herbert Voss Herbert.Voss at FU-Berlin.DE
Fri May 21 16:11:12 CEST 2010


Am 21.05.2010 15:53, schrieb Christian Mayer:

> is there a way in PSTRICKS to get the width and height of an object/text?
> 
> For instance of the following:
> 
> \psframebox*{\tt{XYZ XYZ XYZ XYZ XYZ XYZ}}
> 
> I¹d like to draw a scaled graph below this object such that it aligns with
> single characters.

In PSTricks the box dimensions are local and not known
outside the macro. Use LaTeX for this:

\documentclass{article}
\usepackage{pstricks}
\newsavebox\TBox

\begin{document}

\sbox\TBox{\psframebox*{\tt{XYZ XYZ XYZ XYZ XYZ XYZ}}}
\usebox\TBox
\the\wd\TBox:
\the\dp\TBox:
\the\ht\TBox

\end{document}

Herbert


More information about the PSTricks mailing list