Skip to content

Commit

Permalink
Merge pull request #1303 from JuliaSymbolics/latex_unicode
Browse files Browse the repository at this point in the history
Fix Unicode NAMESPACE_SEPARATOR and subscripts in latex output
  • Loading branch information
ChrisRackauckas authored Oct 11, 2024
2 parents af8a07c + 6d817ec commit 6ca9d68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/latexify_recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/rewrite-helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 6ca9d68

Please sign in to comment.