Get your work done faster!

latexcalc is a "LaTeX Calculator" that calculates values inside your LaTeX files before typesetting them. More accurately, it preprocesses files written in a superset of the LaTeX typesetting language and evaluates specified expressions in the text.


Download the latest tarball here: latexcalc-1.0.tar.gz. To install, simply run './configure', 'make', 'make test', 'make install'. Mandatory dependencies are a LaTeX distribution, gcc, flex, bison and make.

Super-Quick Tutorial:

This tutorial assumes you have pdflatex and latexcalc installed, and that you already have knowledge of LaTeX. Put the following into a file, say "test.tex":


Here are \calc{1+1} examples of LaTeXCalc!\\
\item If $x = \varcalc{x}{2+1}$ then $\solver{x^2} = \answer$. In this example, 3 is stored as the variable $x$, and then 'answer' is replaced by the value of the expression $x^2$, which in this case is 9.
\item Many functions and constants are provided. Consider $\solver{\log_{10}{(\sin{e^4}+2)}} = \answer$

Then run $latexcalc --pdflatex test.tex. LaTeXCalc then parses your file, evaluates expressions as you would expect and runs pdflatex to generate test.pdf. That easy!

Current Features


This project would be aptly-named LINCAS: LaTeXCalc is not a Computer Algebra System! Here are some things LaTeXCalc cannot do:

Future Expansion

For future releases we are planning on: