///|
test "symprint renders plain text and latex" {
let x = @symcore.Expr::Symbol("x")
let expr = @symcore.add([x, @symcore.int(1)])
inspect(pretty_string(expr), content="x + 1")
inspect(latex(expr), content="x + 1")
}pub struct LatexSettings {
mode : String
full_prec : Bool
fold_frac_powers : Bool
fold_func_brackets : Bool
fold_short_frac : Bool
inv_trig_style : String
itex : Bool
ln_notation : Bool
long_frac_ratio : Int?
mul_symbol : String?
mul_symbol_latex : String
mul_symbol_latex_numbers : String
root_notation : Bool
imaginary_unit : String
imaginary_unit_latex : String
diff_operator : String
diff_operator_latex : String
parenthesize_super : Bool
symbol_names : Map[String, String]
}fn latex(expr : Expr, mode? : String, full_prec? : Bool, fold_frac_powers? : Bool, fold_func_brackets? : Bool, fold_short_frac? : Bool?, inv_trig_style? : String, itex? : Bool, ln_notation? : Bool, long_frac_ratio? : Int?, mul_symbol? : String?, root_notation? : Bool, imaginary_unit? : String, diff_operator? : String, parenthesize_super? : Bool, symbol_names? : Map[String, String]) -> Stringtest "symprint latex renders with inline mode and custom multiplication" {
let x = @symcore.Expr::Symbol("x")
let expr = @symcore.mul([@symcore.int(2), @symcore.pow(x, @symcore.int(2))])
inspect(
latex(expr, mode="inline", mul_symbol=Some("times")),
content="$2 \\times x^{2}$",
)
}fn latex_settings(mode? : String, full_prec? : Bool, fold_frac_powers? : Bool, fold_func_brackets? : Bool, fold_short_frac? : Bool?, inv_trig_style? : String, itex? : Bool, ln_notation? : Bool, long_frac_ratio? : Int?, mul_symbol? : String?, root_notation? : Bool, imaginary_unit? : String, diff_operator? : String, parenthesize_super? : Bool, symbol_names? : Map[String, String]) -> LatexSettingsA symbolic mathematics library for Moonbit.
Dependencies