### Calculyx

aparsloe <aparsloe <at> clear.net.nz>

2014-11-24 01:47:10 GMT

I've written a LaTeX package called "calculyx" which numerically
evaluates mathematical expressions in LyX "before one's eyes" using
instant preview. It is written in the expl3 language of LaTeX3 but is
used just like any other LaTeX package. There is a link at
http://wiki.lyx.org/Examples/Calculyx to a zipped archive currently in a
Dropbox folder, and a screenshot (.png format) of a one-page LaTeX
document and the resulting pdf with a few example calculations at
https://www.dropbox.com/s/7djkyjs44bpraol/Screenshot%202014-11-24%2013.52.07.png?dl=0.
The LaTeX may look complicated, but using LyX, all that is as ever
hidden. One simply enters expressions in the LyX math editor as usual.
Calculyx requires the three LaTeX3 bundles l3kernel, l3packages and
l3experimental. Because a main routine uses a command that was
introduced to l3kernel on 18 July 2014, the version of l3kernel must be
later than this. The calculational engine for calculyx is the floating
point module l3fp in l3kernel.
I have tried to ensure as much as possible that calculyx reads
expressions as mathematicians write them. For instance it will "digest"
\sin 3x - 3\sin x + 4\sin^{3} x (for a specified value of x, say \pi/6)
without parentheses around the arguments and with the superscript in the
"wrong" but familiar place. It will "digest" the common arithmetic
operators, plus variants like \times and \div, the familiar
trigonometric and hyperbolic functions and their inverses, the
exponential and natural logarithm, fractions (\frac, \tfrac), square
root and \surd, factorials ( using !), binomial coefficients (\binom,
\tbinom), \gcd, sums and products (\sum, \prod) including "infinite"
sums and products, limits (\lim), derivatives (1st and 2nd order),
including Cartesian 2-d and 3-d Laplacians, and definite integrals in
one variable. Results are generally presented in the form: expression =

(Continue reading)