Skip to content

Commit

Permalink
Preserve latex variable metadata for callable variables
Browse files Browse the repository at this point in the history
  • Loading branch information
hersle committed Dec 13, 2024
1 parent f935c4a commit 01371f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/latexify_recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ function _toexpr(O)
end
return Expr(:call, :_integral, _toexpr(lower), _toexpr(upper), vars, _toexpr(integrand))
elseif symtype(op) <: FnType
# Preserve latex metadata field when `x(t)` becomes `x`
if hasmetadata(O, VariableLatex)
op = setmetadata(op, VariableLatex, getmetadata(O, VariableLatex))
end
isempty(args) && return nameof(op)
return Expr(:call, _toexpr(op), _toexpr(args)...)
elseif op === getindex && symtype(args[1]) <: AbstractArray
Expand Down

0 comments on commit 01371f9

Please sign in to comment.