[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: a LaTeX question



On Sat, 1 Sep 2007, Richard Lyons wrote:

Does anyone here use LaTeX.  Not a Debian question at all, but isn't it
possible to define a quantity, say a cash amount
   \def\yearly {12000}
and then have latex calculate from it to enter another figure, say
   \monthly=\yearly / 12
hoping to get the figure '1000' printed in the document by inserting
'\monthly'.
Obviously that is not correct markup, but does any wise person know how
to achieve that?

It is worth noting that the original tex and also pdftex have very limited support for numerical calculation. If you run latex with one of these engines, you have very limited numerical capabilities. By contrast, luatex <http://luatex.org> provides access to the lua interpreter, so numerical calculation capabilities are greatly expanded. Currently most of the examples are written in ConTeXt, which is probably a better environment for experimenting than LaTeX (as there is much less demand to support legacy documents). I expect experiences with ConTeXt will help in designing LaTeX interfaces.

--
George N. White III  <aa056@chebucto.ns.ca>



Reply to: