我开始使用 pstricks,但我的图像大小有问题。因为我想导出生成的图像,所以我使用了独立类。问题:导出时,只显示图像的一部分。
我的代码:
\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}
并出口:
感谢您的帮助
答案1
我认为问题在于您没有明确地将选项传递给用作剪切框的环境。尝试进行以下修改standalone
:pspicture
\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}
在我的发行版(TeX Live 2021)中,使用dvips/ps2pdf
和进行编译时不会出现重大问题lualatex
。
注意:我将环境的语法纯 TeX 更改为 LaTeXpspicture
并删除\usepackage[utf8]{inputenc}
(不再需要)。