Skip to content

Commit d0ddca0

Browse files
committed
handle flextable case correctly following changes
1 parent 93fb027 commit d0ddca0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/resources/filters/quarto-post/latex.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,11 +573,13 @@ function render_latex_fixups()
573573
return {{
574574
RawBlock = function(raw)
575575
if _quarto.format.isRawLatex(raw) then
576-
local longtable_match, longtable_pattern = _quarto.modules.patterns.match_in_list_of_patterns(raw.text, _quarto.patterns.latexLongtableEnvPatterns)
576+
local longtable_match, _ = _quarto.modules.patterns.match_in_list_of_patterns(raw.text, _quarto.patterns.latexLongtableEnvPatterns)
577577
if longtable_match then
578578
local caption_match = _quarto.modules.patterns.match_in_list_of_patterns(raw.text, _quarto.patterns.latexCaptionPatterns)
579579
if not caption_match then
580-
-- FIXME: this star addition to the longtable env does not support keeping any possible option or alignement (i.e `\begin{longtable}[c*]{ll}`)
580+
-- We need to use the most generic pattern (last of the list) as we want to replace the environment and keep any options
581+
-- (e.g. `\begin{longtable}[c]{ll}` -> \begin{longtable*}[c]{ll} in flextable)
582+
local longtable_pattern = _quarto.patterns.latexLongtableEnvPatterns[#_quarto.patterns.latexLongtableEnvPatterns]
581583
raw.text = raw.text:gsub(_quarto.modules.patterns.combine_patterns(longtable_pattern), "\\begin{longtable*}%2\\end{longtable*}", 1)
582584
return raw
583585
end

0 commit comments

Comments
 (0)