4

I'm starting to use pstricks but I'm having problems with the size of my images. As I want to export the resulting image, I used the class standalone. Problem: When exporting, only part of the image is displayed.

My code :

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pst-labo}

\colorlet{myfill}{brown!60}
\newcommand{\potence}{
    \psframe[fillstyle=solid, fillcolor=myfill](0,-0.1)(0.25,13)  
    \psframe[fillstyle=solid, fillcolor=myfill](-0.25,-0.25)(5,0) 
}

\newcommand{\pince}{
    \psframe[fillstyle=solid, fillcolor=myfill](-0.75,-0.1)(2,0.1)
    \psframe[fillstyle=solid, fillcolor=myfill](-0.75,-0.35)(-.5,0.35)
    \pscircle[fillstyle=solid, fillcolor=myfill](0,0){.2}
    \psframe[fillstyle=solid, fillcolor=myfill](1,-0.25)(2.4,0.25)
}

\newcommand{\supportElevateur}{
    \pspolygon[fillstyle=solid, fillcolor=myfill, linearc=.05](.25,2.25)(3.25,1.25)(.25,0.25)(1.25,0.25)(4.25,1.25)(1.25,2.25)
    \pspolygon[fillstyle=solid, fillcolor=myfill, linearc=.05](4.25,2.25)(1.25,1.25)(4.25,0.25)(3.25,0.25)(.25,1.25)(3.25,2.25)
    \psline(.25,1.25)(4.5,1.25)
    \psframe[fillstyle=solid, fillcolor=myfill](4.5,1.5)(4.75,1)
    \psframe[fillstyle=solid, fillcolor=myfill](0,2.5)(4.5,2.25)
    \psframe[fillstyle=solid, fillcolor=myfill](0,0.25)(4.5,0)
    }
\begin{document}
\psset{unit=0.5cm}
\pspicture
\psgrid[subgriddiv=1, griddots=10, gridlabels=5pt, gridwidth=0.5pt](-1,-1)(15,15)


 \pstDosage[ niveauReactifBurette =25, glassType=erlen]
 \rput{0}(-4,0){\potence}
 \rput{0}(-3.9,10){\pince}

\psline[linewidth=1.5pt]{->}(1,12)(-1.5,12)
\rput(3.5,12){Burette graduée}

\psline[linewidth=1.5pt]{->}(0.5,4)(-1.5,4)
\rput(2.5,4){erlenmeyer}

\psline[linewidth=1.5pt]{->}(0.5,1.75)(-1.5,1.75)
\rput{0}(3.0,1.75){barreau aimanté}

\psline[linewidth=1.5pt]{->}(1.5,0.5)(-0.5,0.5)
\rput{0}(5,0.5){agitateur magnétique}

\psline[linewidth=1.5pt]{->}(-7,10)(-5,10)
\rput{0}(-8,10){pince}

\psline[linewidth=1.5pt]{->}(-6,7)(-4,7)
\rput{0}(-7.2,7){potence}

\endpspicture
        
\end{document}

And the export :

enter image description here

Thanks for your help

1 Answer 1

2

I think the problem is that you have not explicitly passed the options to standalone and the pspicture environment which is used as a clipping box. Try this modification:

\documentclass[border=2pt,pstricks]{standalone}
\usepackage[T1]{fontenc}
\usepackage{pst-labo}

\colorlet{myfill}{brown!60}
\newcommand{\potence}{
    \psframe[fillstyle=solid, fillcolor=myfill](0,-0.1)(0.25,13)  
    \psframe[fillstyle=solid, fillcolor=myfill](-0.25,-0.25)(5,0) 
}

\newcommand{\pince}{
    \psframe[fillstyle=solid, fillcolor=myfill](-0.75,-0.1)(2,0.1)
    \psframe[fillstyle=solid, fillcolor=myfill](-0.75,-0.35)(-.5,0.35)
    \pscircle[fillstyle=solid, fillcolor=myfill](0,0){.2}
    \psframe[fillstyle=solid, fillcolor=myfill](1,-0.25)(2.4,0.25)
}

\newcommand{\supportElevateur}{
    \pspolygon[fillstyle=solid, fillcolor=myfill, linearc=.05](.25,2.25)(3.25,1.25)(.25,0.25)(1.25,0.25)(4.25,1.25)(1.25,2.25)
    \pspolygon[fillstyle=solid, fillcolor=myfill, linearc=.05](4.25,2.25)(1.25,1.25)(4.25,0.25)(3.25,0.25)(.25,1.25)(3.25,2.25)
    \psline(.25,1.25)(4.5,1.25)
    \psframe[fillstyle=solid, fillcolor=myfill](4.5,1.5)(4.75,1)
    \psframe[fillstyle=solid, fillcolor=myfill](0,2.5)(4.5,2.25)
    \psframe[fillstyle=solid, fillcolor=myfill](0,0.25)(4.5,0)
    }
\begin{document}
\psset{unit=0.5cm}
\begin{pspicture}(-4.5,-1.5)(11,16)% here
\psgrid[subgriddiv=1, griddots=10, gridlabels=5pt, gridwidth=0.5pt](-1,-1)(15,15)

\pstDosage[ niveauReactifBurette =25, glassType=erlen]
\rput{0}(-4,0){\potence}
\rput{0}(-3.9,10){\pince}

\psline[linewidth=1.5pt]{->}(1,12)(-1.5,12)
\rput(3.5,12){Burette graduée}

\psline[linewidth=1.5pt]{->}(0.5,4)(-1.5,4)
\rput(2.5,4){erlenmeyer}

\psline[linewidth=1.5pt]{->}(0.5,1.75)(-1.5,1.75)
\rput{0}(3.0,1.75){barreau aimanté}

\psline[linewidth=1.5pt]{->}(1.5,0.5)(-0.5,0.5)
\rput{0}(5,0.5){agitateur magnétique}

\psline[linewidth=1.5pt]{->}(-7,10)(-5,10)
\rput{0}(-8,10){pince}

\psline[linewidth=1.5pt]{->}(-6,7)(-4,7)
\rput{0}(-7.2,7){potence}

\end{pspicture}
        
\end{document}

In my distribution (TeX Live 2021) it compiles without major problem using dvips/ps2pdf and lualatex.

Output-lualatex

Note: I changed the syntax plain TeX to LaTeX for the pspicture environment and remove \usepackage[utf8]{inputenc} (no longer required).

1
  • thanks for your help
    – Nicolas
    Sep 30, 2021 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.