The following code does not compile with the following error message
Missing
=
inserted for\ifnum
\documentclass[pstricks,border=4pt]{standalone}
\usepackage{multido}
\psset{linewidth=.5\pslinewidth}
\psset{xunit=2cm}
\newcommand\FixedScale[1]{%
\multips(0,0)(.1,0){\the\numexpr10*#1+1\relax}{\psline(0,0)(0,-3pt)}
\multips(0,0)(.5,0){\the\numexpr2*#1+1\relax}{\psline(0,0)(0,-6pt)}
\multips(0,0)(1,0){\the\numexpr#1+1\relax}{\psline(0,0)(0,-9pt)}
\multido{\i=0+1}{\the\numexpr#1+1\relax}{\uput[-90](\i,-5pt){$\i$}}
}
\newcommand\VernierScale[2][0.09]{%
\rput(#2,0){%
\psset{xunit=#1,linecolor=red}%
\multips(0,0)(1,0){11}{\psline(0,0)(0,3pt)}%
\multips(5,0)(5,0){1}{\psline(0,0)(0,6pt)}%
\multips(0,0)(10,0){2}{\psline(0,0)(0,9pt)}%
\ifnum#1=0.11\relax
\multido{\i=0+5}{3}{\uput[90](\i,8pt){\tiny$\the\numexpr10-\i\relax$}}
\else
\multido{\i=0+5}{3}{\uput[90](\i,8pt){\tiny$\i$}}
\fi
}
}
\begin{document}
\multido{\n=0.00+0.01}{21}{%
\begin{pspicture}(0,-.5)(2,.55)
\FixedScale{2}
\VernierScale[0.09]{\n}
\end{pspicture}}
\end{document}
What is wrong with \ifnum#1=0.09\relax
?
\VernierScale
semantically represents the length of two consecutive marks on the vernier scale. I have to adopt this convention to avoid confusion.