[pstricks] Pstricks help
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Fri Apr 28 19:58:11 CEST 2017
Am 28.04.2017 um 13:35 schrieb Adrien BOUZIGUES:
>My question is : is it possible to extract the coordinates of two points
> (in a psfigure) to create a length (for a parbox for example) ?
> I mean, there are A(x1,y1) and B(x2,y2) and I would like to create
> "\parbox{|x1-x2|}{Text}" (put a text in a psframe of a size I want :
> there is a little difference with a psframebox).
> I know how to extract coordinates, to add them with the RPN but how to
> create such a length is my problem.
>
> Can we do it ? How ?
there is no such macro. The points are handled on PostScript
level, but the value fpr the parbox on LaTeX level. You can
pass values from LaTeX->PostScript but not vice versa.
However, there is \psTextFrame. Maybe it helps:
\documentclass{article}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}[showgrid](0,-0.5)(10,10)
\psTextFrame[linecolor=lightgray,ref=l](0,0.5)(4,1.5){Hallo}
\psTextFrame[linecolor=blue](2,4)(4,7){\color{blue}Hallo}
\psTextFrame[linestyle=dashed](9,9)(10,10){\huge H}
\psTextFrame*[linecolor=red,linestyle=dashed](7,7)(9,9){\Huge H}
\psTextFrame*[linecolor=red!40,ref=lB](7,4)(9,6){\Huge H}
\psTextFrame*[linecolor=blue!40,ref=rt](7,1)(9,3){\Huge H}
\psTextFrame[linestyle=dashed](4.5,0)(6.5,10){%
\parbox{2cm}{\centering Here comes some more text over
several lines, which is also horizontally and vertically
centered and written in a parbox.}}
\psTextFrame*[linecolor=cyan!20,rot=90](.5,2)(1.5,10){%
\parbox{8cm}{\centering Here comes some more text over
several lines and rotated by 90 degrees.}}
\end{pspicture}
\end{document}
Herbert
More information about the PSTricks
mailing list