NAME
Math::Symbolic::Custom::DefaultDumpers - Default Math::Symbolic output routines
SYNOPSIS
use Math::Symbolic qw/parse_from_string/;
$term = parse_from_string(...);
print $term->to_latex(...);
DESCRIPTION
This is a class of default output routines for Math::Symbolic trees. Likewise, Math::Symbolic::Custom::DefaultTests defines default tree testing routines and Math::Symbolic::Custom::DefaultMods has default tree modification methods. 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_string
The to_string method is currently implemented in the module core namespaces and will be moved to Math::Symbolic::DefaultDumpers in a future release.
Takes one optional argument indicating whether the Math::Symbolic tree should be transformed to a string using 'postfix' notation or using 'infix' notation. Default is infix which is also more likely to be reparseable by the Math::Symbolic parser.
to_code
This method is a wrapper around the compile_to_code class method in the Math::Symbolic::Compiler module. Takes key/value pairs of variables and integers as argument. The integers should starting at 0 and they determine the order of the variables/parameters to the compiled code.
Returns the compiled code and a reference to an array of possible leftover tree elements that could not be compiled.
Please refer to the Math::Symbolic::Compiler man page for details.
to_sub
This method is a wrapper around the compile_to_sub class method in the Math::Symbolic::Compiler module. Takes key/value pairs of variables and integers as argument. The integers should starting at 0 and they determine the order of the variables/parameters to the compiled code.
Returns the compiled sub and a reference to an array of possible leftover tree elements that could not be compiled.
Please refer to the Math::Symbolic::Compiler man page for details.
to_latex
This method is highly experimental. Use with care. 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.
The method uses named parameter passing style. Valid parameters are:
- implicit_multiplication
-
Used to turn off the 'x' operators for all multiplications. Defaults to false, that is, the multiplication operators are present.
- no_fractions
-
Use '%' division operator instead of fractions. Defaults to false, that is, use fractions.
- exclude_signature
-
By default, the method includes all variables' signatures in parenthesis if there is one. 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.
AUTHOR
Please send feedback, bug reports, and support requests to the Math::Symbolic support mailing list: math-symbolic-support at lists dot sourceforge dot net. Please consider letting us know how you use Math::Symbolic. Thank you.
If you're interested in helping with the development or extending the module's functionality, please contact the developers' mailing list: math-symbolic-develop at lists dot sourceforge dot net.
List of contributors:
Steffen Müller, symbolic-module at steffen-mueller dot net
Stray Toaster, mwk at users dot sourceforge dot net
Oliver Ebenhöh
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::DefaultTests Math::Symbolic
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 401:
Non-ASCII character seen before =encoding in 'Müller,'. Assuming CP1252