latexify

latexify

Latexify.latexifyFunction.
latexify(arg)

Generate LaTeX equations from arg.

Parses expressions, ParameterizedFunctions, SymEngine.Base and arrays thereof. Returns a string formatted for LaTeX.

Examples

using expressions

expr = :(x/(y+x))
latexify(expr)

# output

"\\frac{x}{y + x}"
expr = parse("x/(y+x)")
latexify(expr)

# output

"\\frac{x}{y + x}"

using ParameterizedFunctions

using DifferentialEquations;
f = @ode_def feedback begin
         dx = y/c_1 - x
         dy = x^c_2 - y
       end c_1=>1.0 c_2=>1.0
latexify(f)

# output

2-element Array{String,1}:
 "dx/dt = \\frac{y}{c_{1}} - x"
 "dy/dt = x^{c_{2}} - y"

using SymEngine

using SymEngine
@vars x y
symExpr = x + x + x*y*y
latexify(symExpr)

# output

"2 \\cdot x + x \\cdot y^{2}"
source