From b88d572b9e883031f30440c487ed00d52c5df1a4 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Thu, 12 Feb 2026 11:56:51 +0100 Subject: [PATCH 1/2] 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. --- src/resources/filters/common/latex.lua | 2 +- .../docs/smoke-all/2026/02/11/issue-14017.qmd | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/docs/smoke-all/2026/02/11/issue-14017.qmd diff --git a/src/resources/filters/common/latex.lua b/src/resources/filters/common/latex.lua index ab8b17ee966..6224edb8bba 100644 --- a/src/resources/filters/common/latex.lua +++ b/src/resources/filters/common/latex.lua @@ -6,7 +6,7 @@ function tColorOptions(options) local optionStr = "" local prepend = false - for k, v in pairs(options) do + for k, v in spairs(options) do if (prepend) then optionStr = optionStr .. ', ' end diff --git a/tests/docs/smoke-all/2026/02/11/issue-14017.qmd b/tests/docs/smoke-all/2026/02/11/issue-14017.qmd new file mode 100644 index 00000000000..6f0e0eb0e9a --- /dev/null +++ b/tests/docs/smoke-all/2026/02/11/issue-14017.qmd @@ -0,0 +1,18 @@ +--- +title: "Issue 14017" +code-block-bg: true +format: + pdf: + keep-tex: true +_quarto: + tests: + pdf: + noErrors: default + ensureLatexFileRegexMatches: + - ['boxrule=0pt, breakable, enhanced, frame hidden, interior hidden, sharp corners'] + - [] +--- + +```r +1 + 1 +``` From 1d821878a644dc60b89205f97b6ad3297b4e600e Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Thu, 12 Feb 2026 13:52:15 +0100 Subject: [PATCH 2/2] Add to changelog --- news/changelog-1.9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index c195f23f048..d6f0dd09f85 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -82,6 +82,7 @@ All changes included in 1.9: - New `shorthands` variable for Babel language shortcuts control. - New `pdf-trailer-id` support for reproducible PDF builds. - New `cancel` package support for `\cancel` command in math. +- ([#14017](https://github.com/quarto-dev/quarto-cli/issues/14017)]): `tColorOptions()` in .tex file will now always have options in alphabetical order. Previously, they were in random order leading to a different .tex intermediates for identical .qmd. ### `revealjs`