File tree Expand file tree Collapse file tree
src/resources/filters/quarto-post Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments