[pstricks] psPrintValue and psPrintValueNew

Poul Riis poul.riis at skolekom.dk
Thu Dec 7 21:43:55 CET 2017


In the project below I just tested some features of pst-tools.
I wonder why psPrintValue prints 1 decimal even if I have the option
decimals=0, whereas psPrintValueNew prints the binomial coefficient as an
integer (as intended).
On the other hand, the option postString seems to work with psPrintValue
but not with psPrintValueNew.
Where can I find documentation on psPrintValueNew? Is it new or obsolete?

Would it be possible to furthermore improve psPrintValue as to minimize
the need for manual horizontal adjustments when combining text and
postscript variables printed with psPrintValue? Or can I do it more
elegantly with the existing psPrintValue command?


Poul Riis




\documentclass[a4paper,12pt]{article}
\usepackage{pst-tools}
\usepackage{pstricks-add}
\usepackage[fleqn]{amsmath}
\usepackage[left=1.5cm,top=1.5cm,right=1.5cm,bottom=1.5cm]{geometry}
\pagestyle{empty}
\begin{document}
\begin{pspicture}(0,0)(16,8)
	\pstVerb{/PP [3 4] def /QQ [7 5] def /PplusQ PP QQ cxadd def /PmulQ PP QQ
cxmul def}

%Binomial coefficient, K(6,3):	
	\uput{3pt}[0]{0}(1,0){$\begin{pmatrix}6\\3\end{pmatrix}=$\psPrintValue[decimals=0]{6
3 MoverN}}
	\uput{3pt}[0]{0}(10,0){$\begin{pmatrix}6\\3\end{pmatrix}=$\psPrintValueNew[decimals=0]{6
3 MoverN}}

%Complex multiplication:
	\uput{3pt}[0]{0}(1,2){$($\psPrintValue[postString=+]{PP 0
get}\psPrintValue[xShift=10,postString=i]{PP 1
get}$\hspace{1.5em})\cdot($\psPrintValue[postString=+]{QQ 0
get}\psPrintValue[xShift=10,postString=i]{QQ 1
get}$\hspace{1.5em})=$\psPrintValue[postString=+]{PmulQ 0
get}\psPrintValue[xShift=10,postString=i]{PmulQ 1 get}}
	\uput{3pt}[0]{0}(10,2){$($\psPrintValueNew[postString=+]{PP 0
get}\psPrintValueNew[xShift=10,postString=i]{PP 1
get}$\hspace{1.5em})\cdot($\psPrintValueNew[postString=+]{QQ 0
get}\psPrintValueNew[xShift=10,postString=i]{QQ 1
get}$\hspace{1.5em})=$\psPrintValueNew[postString=+]{PmulQ 0
get}\psPrintValueNew[xShift=10,postString=i]{PmulQ 1 get}}
	
	\uput{3pt}[0]{0}(1,4){psPrintValue}
	\uput{3pt}[0]{0}(10,4){psPrintValueNew}
\end{pspicture}
\end{document}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20171207/0a9fe3cf/attachment.html>


More information about the PSTricks mailing list