I need the value (without trailing unit) of \pslinewidth in \psunit.
I have done as follows but I am disappointed with the accuracy.
\documentclass{article}
\parindent=0pt
\usepackage{pstricks}
\pstFPdiv\Temp
{\the\pslinewidth}
{\the\psunit}
\begin{document}
\the\pslinewidth% prints 0.8pt
\Temp% prints 0.028116799998875328
\psset{linewidth=\Temp}
\the\pslinewidth% prints 0.80014pt
\end{document}
Is there a built-in macro to get the value (without trailing unit) of \pslinewidth in any \psunit? The value is very useful to adjust plotting domain such that the cropped curve strokes near the domain edges can be avoided.
The real scenario is as follows. Note: \Temp is the half of \pslinewidth that is not the same as the example above.
\documentclass{article}
\usepackage{pst-func}
\def\Left{-1}
\def\Bottom{-1}
\def\Right{1}
\def\Top{1}
\psset{unit=2cm,linewidth=20pt}
%half of linewidth tickness
\pstFPdiv\Temp{\the\pslinewidth}{\the\dimexpr2\psunit\relax}
\pstFPsub\LEFT\Left\Temp
\pstFPsub\BOTTOM\Bottom\Temp
\pstFPadd\RIGHT\Right\Temp
\pstFPsub\TOP\Top\Temp
\begin{document}
\section*{Without extending the plotting domain}
\begin{pspicture*}[showgrid](\Left,\Bottom)(\Right,\Top)
\psPolynomial[coeff=-1 0 2,linecolor=red]{\Left}{\Right}
\end{pspicture*}
\section*{With extending the plotting domain}
\begin{pspicture*}[showgrid](\LEFT,\BOTTOM)(\RIGHT,\TOP)
\psPolynomial[coeff=-1 0 2,linecolor=red]{\Left}{\Right}
\end{pspicture*}
\end{document}
I accepted Herbert's answer that implies that there is no such a built-in macro.
I also want to emphasize that
- Herbert's method is less accurate than mine.
- The length in Herbert's method cannot be passed to functions that only accept values without unit. But the value in mine can be passed to such functions.
