codegen - Maple Programming Help

Home : Support : Online Help : Programming : codegen Package : codegen/eqn

codegen

 eqn
 produce output suitable for troff/eqn printing

 Calling Sequence eqn(expr, filename)

Parameters

 expr - any expression filename - (optional) output to a file

Description

 • The eqn function produces output which is suitable for printing the input expression expr with a troff/eqn processor. It knows how to format integrals, limits, sums, products and matrices.
 • The mathematical format is taken, in general, from the CRC handbook or the Handbook of Mathematical functions.
 • The functions sum, product, int, diff, limit, and log are aliased by Sum, Product, Int, Diff, Limit, and Log, so that these can be used to prevent evaluation by Maple.
 • User-defined function printing can be interfaced by including a procedure eqn/function-name.
 • Note eqn will not produce .EQ or .EN lines in the output file.
 • The function eqn produces output as a side-effect, and returns NULL as the function value. Therefore the ditto commands, % and %%, will not recall the output of an eqn command.

Examples

 > $\mathrm{with}\left(\mathrm{codegen}\right):$
 > $\mathrm{eqn}\left({x}^{2}+{y}^{2}={z}^{2}\right)$
 {{{  "x"  sup 2 }^+^{  "y"  sup 2 }}~~=~~{  "z"  sup 2 }}

Put this output in the file EqnFile

 > $\mathrm{eqn}\left({x}^{2}+{y}^{2}={z}^{2},\mathrm{EqnFile}\right)$
 > $\mathrm{eqn}\left({∫}\frac{1}{{x}^{2}+1}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x=∫\frac{1}{{x}^{2}+1}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx\right)$
 {{int  { {( {{  "x"  sup 2 }^+^1 } )} sup -1 }~d  "x" }~~=~~{arctan (  "x" )}}