[pstricks] psPrintValueNew, rightadjust numbers

Poul Riis poul.riis at skolekom.dk
Tue Aug 22 09:07:26 CEST 2017


How can I rightadjust numbers with psPrintValueNew in the project below
(table of some pythagorean triples)?


Poul Riis

Minimal version:

\documentclass{article}
\usepackage[danish]{babel}
\usepackage[dvips,x11names]{xcolor}
\usepackage{pstricks-add}
\usepackage{multido}
\usepackage[dvips,left=2.5cm,top=1.5cm,right=1.5cm,bottom=2cm]{geometry}

\thispagestyle{empty}

\begin{document}

\begin{pspicture}(0,-10)(16,0.5)
\pstVerb{/aa 40 def /bb 9 def /cc 41 def}
\uput{0pt}[0]{0}(0,0){$(\psPrintValueNew[PSfont=Palatino-Roman,round,fontscale=9,linecolor=Gold4]{aa}$\hspace{1.3em},\hspace{0.2em}$\psPrintValueNew[PSfont=Palatino-Roman,round,fontscale=9,linecolor=Gold4]{bb}$\hspace{1.3em},\hspace{0.2em}$\psPrintVa
lueNew[PSfont=Palatino-Roman,round,fontscale=9,linecolor=Gold4]{cc}$\hspace{1.3em})}%
\end{pspicture}
\end{document}



More elaborated version just to show what I intend to do:

\documentclass{article}
\usepackage[danish]{babel}
\usepackage[dvips,x11names]{xcolor}
\usepackage{pstricks-add}
\usepackage{multido}
\usepackage[dvips,left=2.5cm,top=1.5cm,right=1.5cm,bottom=2cm]{geometry}

\thispagestyle{empty}

\begin{document}
\newcounter{nnp}
\begin{pspicture}(0,-10)(16,0.5)
\uput{0pt}[0]{0}(0.5,0){\color{Red1}$q$}
\uput{0pt}[0]{0}(0,-0.5){\color{Blue1}$p$}
\multido{\nm=1+1}{8}{\uput{0pt}[0]{0}(!\nm\space 1 sub 2.1 mul 1.8 add
0.05 neg
){\psPrintValueNew[PSfont=Palatino-Roman,round,fontscale=10,linecolor=Red1]{\nm\space}}}%
\multido{\np=2+1}{8}{%
	\uput{0pt}[0]{0}(!0 \np\space 2 sub neg 0.5 mul 1.1 sub){%
	\psPrintValueNew[PSfont=Palatino-Roman,round,fontscale=10,linecolor=Blue1]{\np\space}}%
	\setcounter{nnp}{\np}%
	\addtocounter{nnp}{-1}%
	\multido{\nq=1+1}{\value{nnp}}{%
		\pstVerb{/aa \np\space \nq\space mul 2 mul def /bb \np\space dup mul
\nq\space dup mul sub def /cc \np\space dup mul \nq\space dup mul add def 
}%
		\uput{0pt}[0]{0}(!\nq\space 1 sub 2.1 mul 1 add \np\space 2 sub neg 0.5
mul 1
sub){			$(\psPrintValueNew[PSfont=Palatino-Roman,round,fontscale=9,linecolor=Gold4]{aa}$\hspace{1.3em},\hspace{0.2em}$\psPrintValueNew[PSfont=Palatino-Roman,round,fontscale=9,linecolor=Gold4]{bb}$\hspace{1.3em},\hspace{0.2em}$\psPrintValueNew[PSfont=
Palatino-Roman,round,fontscale=9,linecolor=Gold4]{cc}$\hspace{1.3em})}%
	}%
}%
\end{pspicture}
\end{document}

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


More information about the PSTricks mailing list