Skip to content

Commit

Permalink
minor improvement to reduce snapshot churn
Browse files Browse the repository at this point in the history
  • Loading branch information
cscheid committed Sep 27, 2024
1 parent 6165c5c commit 9c4ad10
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/resources/filters/quarto-post/latex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,10 @@ function render_latex_fixups()

local n_emitted_colors = 0
local emitted_colors = {}
local need_inject = false

local function emit_color(code)
need_inject = true
local n = emitted_colors[code]
if n == nil then
n_emitted_colors = n_emitted_colors + 1
Expand Down Expand Up @@ -570,6 +572,9 @@ function render_latex_fixups()
end
return {
Meta = function(meta)
if not need_inject then
return
end
metaInjectLatex(meta, function(inject)
for v, i in pairs(emitted_colors) do
local def = "\\definecolor{QuartoInternalColor" .. i .. "}" .. v
Expand Down

0 comments on commit 9c4ad10

Please sign in to comment.