[texhax] Question

Karl Berry karl at freefriends.org
Sun Feb 15 14:56:42 CET 2004


    I would like to know if Tex or Latex can do simple arithmetics.

Sure.

\newcount\foo
\foo = 0
\advance\foo by 3   % \foo = 3
\multiply\foo by 3  % \foo = 9
\divide\foo by 3    % \foo = 3 again

LaTeX has its own equivalent set of commands, but the above should work
in either.

There are many limitations and tricks.  It's all discussed at length in
any of the books and I expect in online docs as well.

k


More information about the texhax mailing list