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 @@ -560,9 +560,15 @@ end, function(float)
560560 })
561561 })
562562 elseif align == " right" then
563- figure_content :insert (1 , quarto .LatexInlineCommand ({
564- name = " hfill" ,
565- }))
563+ local plain = quarto .utils .match (" [1]/{Plain}" )(figure_content )
564+ if plain then
565+ local cmd = quarto .LatexInlineCommand ({
566+ name = " hfill" ,
567+ })
568+ plain [1 ].content :insert (1 , cmd )
569+ else
570+ warn (" Could not find a Plain node in figure content of " .. float .identifier .. " to right-align." )
571+ end
566572 end -- otherwise, do nothing
567573 -- figure_content:insert(1, pandoc.RawInline("latex", latexBeginAlign(align)))
568574 -- 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