Skip to content

Commit b88d572

Browse files
committed
Fix non-deterministic tcolorbox option ordering in LaTeX output
`tColorOptions()` used `pairs()` which iterates Lua table keys in non-deterministic order, causing `.tex` output to differ between renders of the same document. Switch to `spairs()` for sorted iteration so tcolorbox options are always emitted alphabetically.
1 parent 1b9b5e4 commit b88d572

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/resources/filters/common/latex.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function tColorOptions(options)
66

77
local optionStr = ""
88
local prepend = false
9-
for k, v in pairs(options) do
9+
for k, v in spairs(options) do
1010
if (prepend) then
1111
optionStr = optionStr .. ', '
1212
end
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: "Issue 14017"
3+
code-block-bg: true
4+
format:
5+
pdf:
6+
keep-tex: true
7+
_quarto:
8+
tests:
9+
pdf:
10+
noErrors: default
11+
ensureLatexFileRegexMatches:
12+
- ['boxrule=0pt, breakable, enhanced, frame hidden, interior hidden, sharp corners']
13+
- []
14+
---
15+
16+
```r
17+
1 + 1
18+
```

0 commit comments

Comments
 (0)