The LaTeX Equation Compiler is a preprocessor for LaTeX files that enables numeric and symbolic calculations. It reads equations specified by special keywords in the LaTeX file and uses them to calculate the numeric value of variables. Symbolic calculation capabilities are also implemented, for example, adding two equations or substituting a variable with a numerical or symbolic value into an equation. EQC makes use of the GiNaC library ( GiNaC library homepage).
The development of EQC was prompted by a problem which I often encountered doing calculations in my profession as a mechanical engineer. I would first begin writing out the problem on paper, putting together the necessary equations, and then turn to a spreadsheet to do the actual calculations. EQC is meant to integrate this process in a single Latex source file.
Programming language: C++, bison, flex, using kdevelop. Implemented on Linux-i386. Cross-compiled to Windows, but not extensively tested there.
EQC makes use of the GiNaC library for numeric and symbolic calculations, and of course needs a Latex installation to be useful. If you wish to use physical units, the SIunits.sty package is required as well.
All code changes are documented in the source files by three asterixes (***) and the change number.
. or , according to the language specified\preferredunits no longer adds the units to previously registered ones. The old units
are now deleted and only the new ones used.\val macros now take an optional parameter to set the units for expressing a quantity.thickspace, thickqspace for SIunits.sty in eqc.sty.
The user should define his preferred spacing in SIunits.cfg.',' as decimal marker by putting it in parentheses.ex class and make it possible to preserve
the user's formatting of equations using the commands \raw and \eqc.\verb and respects verbatim environments.\input
could not be opened.+, -, *, / no sets
the Latex representation (for \raw printing to an empty string since the former
result was undesirable.\function and
\deffunc. These functions can be defined at runtime.{x;y}. This resulted in a change of equation
list syntax because of the ambiguity of the ; in something like
\eqsubst{"prev"}{x = 3; y = 4}. Equations in lists now have to be enclosed in
brackets: \eqsubst{"prev"}{{x = 3}; {y = 4}}\eqpow.\lhs and \rhs inside expressions.\printeq, \deleq and \eqsimpf.\eqdiff.\function to allow for nicer printing etc.messageusing namespace std everywherealigneq, autoalign, noautoalign and
dumpeqtfrac and dfrac are now recognized (but
not printed in eqc output)\eqsubst{z = x^2}{\eqadd{x-y = 4}{y}}, which
would result in z = (4+y)^2)+, -, *, / and
^ for equations (e.g. \eqrev{"prev" + 3y}).collect_common.\denom and \numer.\eqsolve.\eqsimpf.\preferred_units to \preferredunits for LaTeX conformity.eqc.sty to enable the raw tex file to be
passed through LaTeX without generating too many errors. This allows the use of
preview-latex in emacs, for example.\eqfunc to apply a function to both sides of the equation.unsafe.\printoptions, this now replaces \autoalign.
\raw and \eqc are now printing options eqraw and eqnoraw.\cos(\pi) becomes 0).equation a subclass of GiNaC::relational and
expression of GiNaC::ex, which allows a great deal of
simplifications in the grammar.\val[\degree]{...} from working correctly.func::eval() routine so that it takes advantage of the simplification rules
defined for GiNaC's hard-coded functions, e.g. \tan\arctan{x} = x.begin:end:step.wild().\diff to create derivatives. They can be evaluated (that
is, the derivative can be explicitly calculated) by \eqsimpf{...}{diff}.!.\sum.\eqevalp to evaluate functions given in parameter form.\eqwrite to save equations to a file and reuse them in another
document.\tseries.AM_PATH_GINAC macro to configure.in\ceil and \floor.i is now recognized as the imaginary unit (square root of -1).\eqsolve now handles problems with denominators not equal to one.eqc --help) (but not for the Windows version)\eqcoptions {'key' = 'val'}eqautoalign) is now always on. It can be
overriden by specifying a certain alignment type, e.g. \eq[eqalign=none]{...}.\valwith, quantitywith, numvalwith and unitswith.gather-sqrt to combine single square roots into one root symbol.eqsplit and eqsplittext to split a long equation at a given operator.vecautosize to automatically size a vector (if the step count is given as 0).