From 198e156a5dfc1672f4187efd3eb1d862a2e439dc Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Fri, 11 Oct 2024 17:31:54 -0400 Subject: [PATCH] Fix Unicode NAMESPACE_SEPARATOR and subscripts in latex output Fixes https://github.com/JuliaSymbolics/Symbolics.jl/issues/1288 --- src/latexify_recipes.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/latexify_recipes.jl b/src/latexify_recipes.jl index 7f801b6c9..65b881411 100644 --- a/src/latexify_recipes.jl +++ b/src/latexify_recipes.jl @@ -52,6 +52,8 @@ recipe(n) = latexify_derivatives(cleanup_exprs(_toexpr(n))) cdot --> false fmt --> FancyNumberFormatter(5) index --> :subscript + snakecase --> true + safescripts --> true return recipe(n) end @@ -189,7 +191,10 @@ function _toexpr(O) return frac_expr end end - issym(O) && return nameof(O) + if issym(O) + sym = string(nameof(O)) + return Symbol(replace(sym, NAMESPACE_SEPARATOR => ".")) + end !iscall(O) && return O op = operation(O)