NAME
Math::Symbolic::Custom::LaTeXDumper - Math::Symbolic LaTeX output
SYNOPSIS
use Math::Symbolic qw/parse_from_string/;
use Math::Symbolic::Custom::LaTeXDumper;
$term = parse_from_string(...);
print $term->to_latex(...);
DESCRIPTION
This class provides the to_latex()
method for all Math::Symbolic trees. It is a rewrite of the to_latex()
method that was supplied by Math::Symbolic
prior to version 0.201.
For details on how the custom method delegation model works, please have a look at the Math::Symbolic::Custom
and Math::Symbolic::Custom::Base
classes.
EXPORT
Please see the docs for Math::Symbolic::Custom::Base
for details, but you should not try to use the standard Exporter semantics with this class.
SUBROUTINES
to_latex
It returns a LaTeX representation of the Math::Symbolic tree it is called on. The LaTeX is meant to be included in a LaTeX source document. It does not include an enclosing math environment.
The method uses named parameter passing style. Valid parameters are:
- implicit_multiplication
-
Used to turn on the '.' (
\cdot
) operators for all multiplications. Defaults to true, that is, the multiplication operators are not present. - no_fractions
-
Use '/' division operator instead of fractions. Defaults to false, that is, use fractions. See also:
max_fractions
parameter. - max_fractions
-
Setting this parameter to a positive integer results in a limitation of the number of nested fractions. It defaults to
2
. Setting this to0
results in arbitrarily nested fractions. To disable fractions altogether, set theno_fraction
parameter. - exclude_signature
-
By default, the method includes all variables' signatures in parenthesis if present. Set this to true to omit variable signatures.
- replace_default_greek
-
By default, all variable names are outputted as LaTeX in a way that makes them show up exactly as they did in your code. If you set this option to true, Math::Symbolic will try to replace as many greek character names with the appropriates symbols as possible.
Valid LaTeX symbols that are matched are:
Lower case letters: alpha, beta, gamma, delta, epsilon, zeta, eta, theta, iota, kappa, lambda, mu, nu, xi, pi, rho, sigma, tau, upsilon, phi, chi, psi, omega Variant forms of small letters: varepsilon, vartheta, varpi, varrho, varsigma, varphi Upper case letters: Gamma, Delta, Theta, Lambda, Xi, Pi, Sigma, Upsilon, Phi, Psi, Omega
- variable_mappings
-
Because not all variable names come out as you might want them to, you may use the 'variable_mappings' option to replace variable names in the output LaTeX stream with custom LaTeX. For example, the variable x_i should probably indicate an 'x' with a subscripted i. The argument to variable_mappings needs to be a hash reference which contains variable name / LaTeX mapping pairs.
If a variable is replaced in the above fashion, other options that modify the outcome of the conversion of variable names to LaTeX are ignored.
- subscript
-
Set this option to a true value to have all underscores in variable names interpreted as subscripts. Once an underscore is encountered, the rest of the variable name is treated as subscripted. If multiple underscores are found, this mechanism works recursively.
Defaults to
true
. Set to a false value to turn this off. This is automatically turned off for variables that are mapped to custom LaTeX by thevariable_mappings
parameter. - no_sqrt
-
By default, the dumper tries to convert exponents of 1/2 (or 0.5) or anything numeric that ends up being 1/2 to a square root. If this gives inconvenient results, set this option to a true value to turn the heuristics off.
SEE ALSO
New versions of this module can be found on http://steffen-mueller.net or CPAN. The module development takes place on Sourceforge at http://sourceforge.net/projects/math-symbolic/
Math::Symbolic::Custom Math::Symbolic::Custom::DefaultMods Math::Symbolic::Custom::DefaultDumpers Math::Symbolic::Custom::DefaultTests Math::Symbolic
AUTHOR
Steffen M�ller, smueller@cpan.org
COPYRIGHT AND LICENSE
Copyright (C) 2006, 2008, 2011, 2013 by Steffen Mueller
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.