In my drawing using pst-optexp
, I found weird whitespace occured when using \drawbeam
, \pstVerb
and tx@addDict
together. Here are the minimum reproduction codes for my claim:
\documentclass{standalone}
\usepackage{pst-optexp}
\begin{document}
\begin{pspicture}(1.8,-0.1)(5,2.3)
\pnodes(2,1){A}(3,1){B}
\lens[n=2, lensradius=4 4, lensheight=2](A)(B){}
\definecolor[ps]{bl}{rgb}{%
tx@addDict begin Red Green Blue end}%
\addtopsstyle{Beam}{linecolor=bl, beaminside=false}
\multido{\r=-0.8+0.005}{321}
{
\pstVerb{\r\space 550 400 sub mul 550 add tx@addDict begin wavelengthToRGB end}
\drawbeam[beampos=\r](A){}(B)
}
\end{pspicture}
\end{document}
The generated PDF looks like this, please note the unwanted whitespace on the right:
However, if I don't use \pstVerb
and tx@addDict
with \drawbeam
, the whitespace doesn't appear. Here is another code, it is slightly changed against the previous one:
\documentclass{standalone}
\usepackage{pst-optexp}
\begin{document}
\begin{pspicture}(1.8,-0.1)(5,2.3)
\pnodes(2,1){A}(3,1){B}
\lens[n=2, lensradius=4 4, lensheight=2](A)(B){}
\addtopsstyle{Beam}{linecolor=green, beaminside=false}
\multido{\r=-0.8+0.005}{321}
{
\drawbeam[beampos=\r](A){}(B)
}
\end{pspicture}
\end{document}
It turned out to be like this, which is quite reasonable:
So I draw the conclusion that the usage of varying color for drawing rays lead to the extra unwanted whitespace.
My questions are: How does it happen? And can I use varying colors to draw different rays and without suffering from the unwanted whitespace?
I appreciate your attention and thanks in advance.