[pstricks] strange behaviour

Herbert Voss Herbert.Voss at FU-Berlin.DE
Thu Apr 1 20:16:52 CEST 2010


Am 01.04.2010 19:41, schrieb Ulrich Bongartz:

> I want to put the Text horizontally and vertically centered in the drawn
> boxes (Boxes of fixed dimensions - until now my solution). Strangely the
> first box in the source (the second highest in output) is correctly
> centered the others not. Changing the order, changes the centered line.
> 
> If I delete the \begin{center} this line also misplaced. So this is
> somehow related to the problem.
> 
> I know I could \put any text anywhere, but I would like to know, what is
> happening here.

use the macro \psTextFrame(lower left)(upper right){centered text}

Herbert

\documentclass[12pt,a4paper]{article}
\usepackage{pstricks-add,ragged2e}
\parindent=0pt

\begin{document}

\psset{framearc=0.25,framesep=5pt}
\begin{pspicture}(10,6)
\psTextFrame(0.5,0)(7.5,1){\parbox{5cm}{%
  \Centering everything is centered and of a width of 5cm}}
\psTextFrame(7.5,0.2)(10.5,0.8){\tiny Zentriert}
\psTextFrame(0.5,4.1)(7.5,5.1){Zentriert}
\psTextFrame[framearc=0.25,framesep=5pt](7.5,4.3)(10.5,4.9){\tiny Zentriert}
\end{pspicture}

\end{document}


More information about the PSTricks mailing list