[texhax] calcualtions witihn newcommand

Paul Isambert zappathustra at free.fr
Sun Dec 13 00:04:07 CET 2009


You can do this:

\newcount\tempnumber
\newcommand\mycommand[1]{%
  \tempnumber=#1%
  \multiply\tempnumber by10
% Then somewhere in your code, for instance:
  \put(\tempnumber,5){...}%
  }

Paul

Selon sheltraw at berkeley.edu:

> Good day LaTex users
>
> I am writing a new command that takes as an argument a number. I would like
> to perform a simple multiplication of that number by 10 and then use its
> numeric result as an argument to the \put command (used in the picture
> environment). How can I do this?
>
> Thanks for your help!
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
>




More information about the texhax mailing list