mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 09:47:06 +00:00
Inline images now emit `text:anchor-type=as-char` on their `draw:frame`, anchoring the frame as a character so it flows with the surrounding text. Without this, consumers default to paragraph anchoring and float the frame beside (or after) the following paragraph. When both width and height are given and the width is a percentage, the width is now resolved against the reference document text area width, mirroring how the docx writer derives its print width from the reference docx section properties. The height follows the aspect ratio.
990 B
990 B
% pandoc -t opendocument+native_numbering


^D
<text:p text:style-name="FigureWithCaption"><draw:frame draw:name="img1" text:anchor-type="as-char"><draw:image xlink:href="lalune.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame></text:p>
<text:p text:style-name="FigureCaption">Figure <text:sequence text:ref-name="refIllustration0" text:name="Illustration" text:formula="ooow:Illustration+1" style:num-format="1">1</text:sequence>: First
image</text:p>
<text:p text:style-name="FigureWithCaption"><draw:frame draw:name="img2" text:anchor-type="as-char"><draw:image xlink:href="lalune.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame></text:p>
<text:p text:style-name="FigureCaption">Figure <text:sequence text:ref-name="refIllustration1" text:name="Illustration" text:formula="ooow:Illustration+1" style:num-format="1">2</text:sequence>: Second
image</text:p>