Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/latexify_function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ L"\begin{equation}
"""
function latexify(args...; kwargs...)
kwargs = merge(default_kwargs, kwargs)
args = process_multiline(args...)
result = process_latexify(args...; kwargs...)

should_render = get(kwargs, :render, false)
Expand All @@ -37,6 +38,8 @@ function latexify(args...; kwargs...)
return result
end

process_multiline(args...) = map(x -> x isa Expr && x.head == :block ? filter(y -> !(y isa LineNumberNode), x.args) : x, args)

function process_latexify(args...; kwargs...)
## Let potential recipes transform the arguments.
args, kwargs = apply_recipe(args...; kwargs...)
Expand Down
Loading