Skip to content

Commit 4e3f233

Browse files
committed
Preserve latex variable metadata for callable variables
1 parent 3351502 commit 4e3f233

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/latexify_recipes.jl

+4
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ function _toexpr(O)
244244
end
245245
return Expr(:call, :_integral, _toexpr(lower), _toexpr(upper), vars, _toexpr(integrand))
246246
elseif symtype(op) <: FnType
247+
# Preserve latex metadata field when `x(t)` becomes `x`
248+
if hasmetadata(O, VariableLatex)
249+
op = setmetadata(op, VariableLatex, getmetadata(O, VariableLatex))
250+
end
247251
isempty(args) && return nameof(op)
248252
return Expr(:call, _toexpr(op), _toexpr(args)...)
249253
elseif op === getindex && symtype(args[1]) <: AbstractArray

0 commit comments

Comments
 (0)