From 198e156a5dfc1672f4187efd3eb1d862a2e439dc Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Fri, 11 Oct 2024 17:31:54 -0400 Subject: [PATCH 1/2] 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) From 6d817ecb194a9c05135882477415d45ffce0b586 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Fri, 11 Oct 2024 17:56:48 -0400 Subject: [PATCH 2/2] fix typo --- src/rewrite-helpers.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rewrite-helpers.jl b/src/rewrite-helpers.jl index f3279f8bd..9cfe72ecb 100644 --- a/src/rewrite-helpers.jl +++ b/src/rewrite-helpers.jl @@ -34,7 +34,7 @@ end """ hasnode(c, x) -Returns true if any part of `x` fufills the condition given in c. c can be a function or an expression. +Returns true if any part of `x` fulfills the condition given in c. c can be a function or an expression. If it is a function, returns true if x is true for any part of x. If c is an expression, returns true if x contains c. @@ -76,7 +76,7 @@ end """ filterchildren(c, x) -Returns all parts of `x` that fufills the condition given in c. c can be a function or an expression. +Returns all parts of `x` that fulfills the condition given in c. c can be a function or an expression. If it is a function, returns everything for which the function is `true`. If c is an expression, returns all expressions that matches it.