`Very nice and very cool indeed! Thanks a lot Andrew! This seems to be a`

`nice (also because much lighter) competitor to the Sage module for many`

`numerical computations. I will check it as soon as I can.`

Best regards, Murat

aparsloe <mailto:apars...@clear.net.nz> 24 novembre 2014 02:47I've written a LaTeX package called "calculyx" which numericallyevaluates mathematical expressions in LyX "before one's eyes" usinginstant preview. It is written in the expl3 language of LaTeX3 but isused just like any other LaTeX package. There is a link athttp://wiki.lyx.org/Examples/Calculyx to a zipped archive currently ina Dropbox folder, and a screenshot (.png format) of a one-page LaTeXdocument and the resulting pdf with a few example calculations athttps://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 everhidden. One simply enters expressions in the LyX math editor as usual.Calculyx requires the three LaTeX3 bundles l3kernel, l3packages andl3experimental. Because a main routine uses a command that wasintroduced to l3kernel on 18 July 2014, the version of l3kernel mustbe later than this. The calculational engine for calculyx is thefloating point module l3fp in l3kernel.I have tried to ensure as much as possible that calculyx readsexpressions 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 thesuperscript in the "wrong" but familiar place. It will "digest" thecommon arithmetic operators, plus variants like \times and \div, thefamiliar 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 2ndorder), including Cartesian 2-d and 3-d Laplacians, and definiteintegrals in one variable. Results are generally presented in theform: expression = result. There is also a (multi-column) tablecreating command and another which will iterate a function (for thechaos theorists).The package contains a novelty that I think could be exploited morewidely. Some calculations are computationally intensive. So as not toburden the compilation of the pdf with them, these calculations can be"parked" either in a LyX note or in an inactive branch. Instantpreview works in both places (with a caveat for LyX notes). The resultof the calculation can be saved to a LaTeX control sequence. Calculyxautomatically saves such control sequences to a file. They are thenavailable for inserting elsewhere in the document -- even at thestart, long before the place where the calculation is performed. Ifyou are prepared to set up a converter and copier, then the filecontaining the control sequences can be saved in the documentdirectory -- or copied to other directories whereby the results ofthose "parked" calculations are made available to these otherdocuments. By this means selected items in LyX notes or inactivebranches can play a part in compilation to pdf.Andrew

-- Prof. Murat Yildizoglu UniversitĂ© de Bordeaux GREThA (UMR CNRS 5113) Avenue LĂ©on Duguit 33608 Pessac cedex France Bureau : E-331 Mail: yildi-at-u-bordeaux4.fr Web: yildizoglu.info <mailto:yi...@u-bordeaux4.fr>