Generating Maxima Input
SnuggleTeX can also attempt to convert input LaTeX to Maxima input syntax. This is implemented by first converting to Content MathML. However, not all inputs that can be successfully converted to Content MathML can be further converted into Maxima input form. Additional restrictions on supported inputs are detailed below.
Supported Pre-defined Functions
All functions supported by the Content MathML up-conversion are supported here, with the exception of \log as Maxima only supports natural logarithms.
Supported Operators
All of the operators supported by the Content MathML process are supported, with the exception of the following relations:
- \equiv
- \not\equiv
- \approx
- \not\approx
- |
- \not|
- \in
- \not\in
Maxima does not support “unapplied” operators symbols, so a LaTeX input of the form + generates a result of the form operator("+") as a rather ad hoc representation of this idea. Similarly, \not< results in operator("not<") for want of anything better. The name of the resulting “function” can be specified with \setUpConversionOption{maximaOperatorFunction}{name}.
+
\not=
\not<
\setUpConversionOption{maximaOperatorFunction}{silly} $+$
Supported Identifiers
MathML generally allows arbitrary Unicode characters to be used as identifier names whereas Maxima only safely supports ASCII characters. In terms of LaTeX input, this means that identifiers input as “\something” are only supported if we have discovered a means to convert these into an appropriate Maxima input form.
The identifiers supported so far are:
LaTeX input | Maxima form | Live Example |
\alpha | %alpha | \alpha |
\beta | %beta | \beta |
\gamma | %gamma | \gamma |
\delta | %delta | \delta |
\epsilon | %epsilon | \epsilon |
\zeta | %zeta | \zeta |
\eta | %eta | \eta |
\theta | %theta | \theta |
\iota | %iota | \iota |
\kappa | %kappa | \kappa |
\lambda | %lambda | \lambda |
\mu | %mu | \mu |
\nu | %nu | \nu |
\xi | %xi | \xi |
\pi | %pi | \pi |
\rho | %rho | \rho |
\sigma | %sigma | \sigma |
\tau | %tau | \tau |
\upsilon | %upsilon | \upsilon |
\phi | %phi | \phi |
\chi | %chi | \chi |
\psi | %psi | \psi |
\omega | %omega | \omega |
\Gamma | %Gamma | \Gamma |
\Delta | %Delta | \Delta |
\Theta | %Theta | \Theta |
\Lambda | %Lambda | \Lambda |
\Xi | %Xi | \Xi |
\Pi | %Pi | \Pi |
\Sigma | %Sigma | \Sigma |
\Upsilon | %Upsilon | \Upsilon |
\Phi | %Phi | \Phi |
\Psi | %Psi | \Psi |
\Omega | %Omega | \Omega |
Configurable Symbols
If you have used \assumeSymbol to assign meanings to certain inputs symbols, then they will be mapped into corresponding Maxima forms:
LaTeX input | Maxima form | Live example |
\assumeSymbol{e}{exponentialNumber} $e$ | %e | \assumeSymbol{e}{exponentialNumber} $e$ |
\assumeSymbol{i}{imaginaryNumber} $i$ | %i | \assumeSymbol{i}{imaginaryNumber} $i$ |
\assumeSymbol{\pi}{constantPi} $\pi$ | %pi | \assumeSymbol{\pi}{constantPi} $\pi$ |
\assumeSymbol{\gamma}{eulerGamma} $\gammai$ | %gamma | \assumeSymbol{\gamma}{eulerGamma} $\pi$ |
\assumeSymbol{f}{function} $f(x)$ | f(x) | \assumeSymbol{f}{function} $f(x)$ |
\assumeSymbol{f}{function} $f^2(x)$ | f(x)^2 | \assumeSymbol{f}{function} $f^2(x)$ |
\assumeSymbol{f}{function} $f^{-1}(x)$ | inverse[f](x) | \assumeSymbol{f}{function} $f^{-1}(x)$ |
Note that Maxima does not actually have a notation for inverse functions, hence the fictitional inverse[f] construct above. You can change the name of this “function” using \setUpConversionOption{maximaInverseFunction}{name}.
Other Supported Constructs
- Units entered using the special SnuggleTeX \units macro, such as \units{kg} generate a Maxima form like units("kg"), which is similar to how we handle unapplied operators. The name of the resulting function can be specified with \setUpConversionOption{maximaUnitsFunction}{name}.
- Subscripted identifiers are converted to a suitable Maxima form if
deemed possible.
A_{i,j}x_j
x_{i,j_{n,m_2}}