# [pstricks] Is it possible to pass an expression to \multido's repetitions argument?

Sky Hester (No Email) hesters at students.wwu.edu
Thu Nov 22 20:20:01 CET 2012

Hi,

I am attempting to create an animation with \animateinline using a command that involves \multido. When I compile the following, I receive the error

"! Missing number, treated as zero.
!
l.44 	}"

Which I assume means I can't put postscript expressions where I'm trying to use them.

Currently I have

\documentclass[12pt]{report}
\usepackage[margin=1in]{geometry}

\usepackage{pstricks}
\usepackage{auto-pst-pdf}
\usepackage{ifthen}
\usepackage{animate}

%Command to draw diagrams
\newcommand{\cycle}[2]{% #1: n, #2: k, number of edges plotted
\begin{pspicture}(-3,-2)(3,2)
\SpecialCoor
\pscircle[linewidth=0.01](0,0){2}
\degrees[#1]
%All edges up to k,
\multido{\ii=0+1}{#2}{%
\multido{\ij=0+1}{#1 \space 2 div floor \ii \space add}{%
\psline[linestyle=dashed,linewidth=0.01]%
(2;\ii)(2;\ij)
}%
}
\multido{\i=0+1}{#1}{%
\psdots[dotscale=1]%
(2;\i)
}
\end{pspicture}%
}

\begin{document}

\newcounter{steps}
\setcounter{steps}{0}

\begin{center}
\begin{animateinline}[step,palindrome]{1}%
\cycle{12}{\thesteps}
\whiledo{\value{steps}<13}{%
\newframe
\cycle{12}{\thesteps}%
}
\end{animateinline}%
\end{center}

\end{document}

The goal is to draw the dashed lines only for the first half of dots around the circle, hence the argument

#1 \space 2 div floor \ii \space add

which should accomplish this. Is there a way to pass that value to \multido's repititions argument without causing the missing number error? The pstricks home page says "Missing number, treated as zero This is the default error message when you are using symbolic node names without enabled \SpecialCoor after loading the pst-node package," but that doesn't appear (to me) to be what's happening here.

-Sky