File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
src/resources/filters/customnodes
tests/docs/smoke-all/2024/02/14 Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -568,9 +568,15 @@ end, function(float)
568568 })
569569 })
570570 elseif align == " right" then
571- figure_content :insert (1 , quarto .LatexInlineCommand ({
572- name = " hfill" ,
573- }))
571+ local plain = quarto .utils .match (" [1]/{Plain}" )(figure_content )
572+ if plain then
573+ local cmd = quarto .LatexInlineCommand ({
574+ name = " hfill" ,
575+ })
576+ plain [1 ].content :insert (1 , cmd )
577+ else
578+ warn (" Could not find a Plain node in figure content of " .. float .identifier .. " to right-align." )
579+ end
574580 end -- otherwise, do nothing
575581 -- figure_content:insert(1, pandoc.RawInline("latex", latexBeginAlign(align)))
576582 -- figure_content:insert(pandoc.RawInline("latex", latexEndAlign(align)))
Original file line number Diff line number Diff line change 1+ ---
2+ title : " Quarto Testfile"
3+ format : latex
4+ _quarto :
5+ tests :
6+ latex :
7+ ensureFileRegexMatches :
8+ - ["\\\\hfill\\\\includegraphics"]
9+ - []
10+ ---
11+
12+ # Test alignment to the right
13+
14+ ![ dummy image] ( test_image_r.jpg ) {#fig-logor fig-align="right" width=4in}
You can’t perform that action at this time.
0 commit comments