LaTeXCalc

Get your work done faster!

LaTeXCalc Documentation

Install & Quick Start

Please see the download page for installation instructions and the main page for a super-quick start guide

Basic Usage

LaTeXCalc adds seven new commands to the LaTeX language. Any of them may be used in either text mode or math mode; LaTeXCalc will put math in math mode for you. The commands are as follows:

CommandArgumentsDescription
\calc{ expression }Evaluates the expression and puts the answer in-line with the LaTeX surrounding it.
\solver{ expression }Evaluates the expression and stores the answer for future reference. The expression itself is printed as inputted and displayed in math mode.
\hidden{ expression }Same as \solver except that the expression is not printed. This is useful for doing computations that you don't want to be typeset.
\varcalc{ variable } { expression }Evaluates the expression and puts the answer in-line with the LaTeX surrounding it. The answer is also stored in the variable.
\varsolver{ variable } { expression }Evaluates the expression and stores the answer in the variable. The expression itself is printed as inputted and displayed in math mode.
\varhidden{ variable } { expression }Same as \varsolver except that the expression is not printed.

Expressions

Expressions are combinations of mathematical operators and functions that produce a well-defined output. LaTeX is an expansive language that was designed for typesetting, not mathematical evaluation. As a result, LaTeXCalc cannot accept all possible LaTeX code in expressions. Instead a limmited subset of commonly-used expressions is available. Here are a list of functions and operators that LaTeXCalc recognizes:

Using Functions

Ambiguity can occur when calling functions. For example, if you want to compute \sin \pi/2 it's not clear if you mean \sin{\pi}/2 or \sin{\pi/2}. An experienced LaTeX user might expect the former behavior since LaTeX usually will only accept one token as an argument to a function without braces, while anyone looking at the output may expect the latter. Therefore, LaTeXCalc requires that functions such as \sin or \cos be used with either parenthesis or curly braces around the argument.

Whitespace Rules

LaTeXCalc does its best to ignore whitespace. This usually works well, but since there are so many ways of creating whitespace in LaTeX it is sometimes a challange.

Caveats

Currently we cannot specify how accurate our answers are. Please use this software with caution; if you must have a high degree of accuracy you're better off using something else.

While much care has been taken to make sure that LaTeXCalc has been written properly, it's impossible for the designers of LaTeXCalc to anticipate everything. Try your best to write your inputs in plain mathematical terms without extra formatting. This will maximize the probability that LaTeXCalc understands what you want and provides correct answers. If you ever encounter a bug where you expect LaTeXCalc to do something differently, please report it to the bugs list: latexcalc-bugs@lists.sourceforge.net.

Variables

Variables are used to store the output of computations and use them later. All variables are either one letter of the english alphabet or one greek letter. However, they may be modified with the following LaTeX commands in any combination you wish:

Notes

Uppercase and lowercase letters are distinct in both alphabets. Using the modifiers above in any order transform it into a different variable. For example, each of the following are unique variables: \alpha, \hat{\Alpha}, \dot{\alpha}, a, \Alpha, \dot{\hat{\alpha}}, \hat{\dot{\alpha}}.

Some variables, namely e, \pi and \phi are reserved for the corresponding constants. You are free to override them with commands but LaTeXCalc will produce a warning.

Command Line Argument

The command line arguments to LaTeXCalc are described in the man page. This section may be expanded as the developers have time to document.