1

New to pstricks (more exactly, I'm using the pst-labo package), I'm having trouble aligning different elements.

First, when I want to draw an arrow line using \psline{<-}(6.5,0)(4.5,0), the arrow is not in the right place at all

I found, while looking, that the rput command could help me especially to add text: I therefore entered \rput(6.5,0){\psline{<-}(2,0)chauffe-ballon} but instead of being centered on 0 as I would like, we see that it is centered a little below (and I would like the arrow to be to the left of the text)

Can anyone help me?

\usepackage{pst-labo}

\begin{document}

\psset{ unit =0.5cm}
\psgrid[subgriddiv=1,griddots=10,  gridlabels=5pt, gridwidth=0.5pt](0,0)(20,20)
\pstBallon[ refrigerantBoulles ,glassType=ballon]

\rput[0](6.5,0){\psline{<-}(2,0)chauffe-ballon}
\end{document}

1 Answer 1

1

You need to place the pstricks code in a pspicture environment. For instance

\documentclass{article}

\usepackage{pstricks}

\usepackage{pst-labo}

\begin{document}

\psset{ unit =0.5cm}
\begin{pspicture}(20,20)
\psgrid[subgriddiv=1,griddots=10,  gridlabels=5pt, gridwidth=0.5pt](0,0)(20,20)
\pstBallon[ refrigerantBoulles ,glassType=ballon]

\rput[0](6.5,0){\psline{<-}(2,0)chauffe-ballon}
\end{pspicture}
\end{document}

To reveal the ballon you must add -dALLOWPSTRANSPARENCY to the ps2pdf command. For instance if your file is named mwe-pstricks.tex, the sequence of commands will produce the picture

latex mwe-pstricks
dvips mwe-pstricks.dvi
ps2pdf -dALLOWPSTRANSPARENCY mwe-pstricks.ps

pst-labo

2
  • The current PSTricks still uses the old transparency operator .setopacityalpha. See tex.stackexchange.com/a/453786 for a fix.
    – AlexG
    Commented Mar 24, 2021 at 17:49
  • I do not understand the answer part on transparency ... your solution, which I tested, does not suit my request: I think I did not explain my problem well. I would like the arrow to be centered on 0 (vertical) just like the text next to it.
    – Nicolas
    Commented Mar 24, 2021 at 18:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .