Multido--"illegal unit of measure" in pstricks

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Multido--"illegal unit of measure" in pstricks

Nitecki, Zbigniew H.
In the attached I have created a wiggly (more-or-less vertical) line and am trying to create several copies of it, displaced at regular horizontal intervals.
I use a real counter \rT added to fixed coordinates.  The error message says “illegal unit of measure—pt added”.  I don’t understand: coordinates are entered into pscurve as real numbers.  What am I missing?


Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/





----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

MultiDoTest.tex (864 bytes) Download Attachment
attachment1 (104 bytes) Download Attachment
MultiDoTest.log Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Multido--"illegal unit of measure" in pstricks

Michael Sharpe


> On Sep 12, 2018, at 12:13 PM, Nitecki, Zbigniew H. <[hidden email]> wrote:
>
> In the attached I have created a wiggly (more-or-less vertical) line and am trying to create several copies of it, displaced at regular horizontal intervals.
> I use a real counter \rT added to fixed coordinates.  The error message says “illegal unit of measure—pt added”.  I don’t understand: coordinates are entered into pscurve as real numbers.  What am I missing?
>
>

You can't do arithmetic with \rT. Instead, make three similar counters where the arithmetic is handled, as illustrated below.

                \begin{pspicture}(-4,-4)(4,4) % note {-4 replaced by (-4
                       
                \rput(0,0){$\bullet$}
                \pscurve(0,-2) (-0.1,-1.5)(0,-1)(0.1,-0.5)(0,-0.2)(0,0)(0,0.2) (0.1,0.5)(0,1)(-0.1,1.5)(0,2)
                \multido{\rT=-1.6+0.2,\rTp=-1.5+0.2,\rTm=-1.7+0.2}{33}{ % \rTp(lus), \rTm(inus)
                \pscurve(\rT,-2) (\rTm,-1.5)(\rT,-1)(\rTp,-0.5)(\rT,-0.2)(\rT,0)(\rT,0.2) (\rTp,0.5)(\rT,1)(\rTm,1.5)(\rT,2)
                }
                \end{pspicture}

Michael
----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Reply | Threaded
Open this post in threaded view
|

Re: Multido--"illegal unit of measure" in pstricks

Nitecki, Zbigniew H.
OK, I see the idea.  Will try it out.  Thanks

Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/




On Sep 12, 2018, at 15:43, Michael Sharpe <[hidden email]> wrote:



On Sep 12, 2018, at 12:13 PM, Nitecki, Zbigniew H. <[hidden email]> wrote:

In the attached I have created a wiggly (more-or-less vertical) line and am trying to create several copies of it, displaced at regular horizontal intervals.
I use a real counter \rT added to fixed coordinates.  The error message says “illegal unit of measure—pt added”.  I don’t understand: coordinates are entered into pscurve as real numbers.  What am I missing?



You can't do arithmetic with \rT. Instead, make three similar counters where the arithmetic is handled, as illustrated below.

\begin{pspicture}(-4,-4)(4,4) % note {-4 replaced by (-4

\rput(0,0){$\bullet$}
\pscurve(0,-2) (-0.1,-1.5)(0,-1)(0.1,-0.5)(0,-0.2)(0,0)(0,0.2) (0.1,0.5)(0,1)(-0.1,1.5)(0,2)
\multido{\rT=-1.6+0.2,\rTp=-1.5+0.2,\rTm=-1.7+0.2}{33}{ % \rTp(lus), \rTm(inus)
\pscurve(\rT,-2) (\rTm,-1.5)(\rT,-1)(\rTp,-0.5)(\rT,-0.2)(\rT,0)(\rT,0.2) (\rTp,0.5)(\rT,1)(\rTm,1.5)(\rT,2)
}
\end{pspicture}

Michael
----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
               https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex