-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docx writer problem with images in footnotes #10228
Comments
I tried creating an image in a note in Word, and I noticed that it footnotes.xml.rels we got a reference to the image:
So I suspect that is the thing we're missing here. |
Current pandoc in footnotes.xml: <w:footnoteRef />
</w:r>
<w:r>
<w:t xml:space="preserve">
</w:t>
</w:r>
<w:r>
<w:drawing>
<wp:inline>
<wp:extent cx="5334000" cy="891742" />
<wp:effectExtent b="0" l="0" r="0" t="0" />
<wp:docPr descr="" title="" id="22" name="Picture" />
<a:graphic>
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:pic>
<pic:nvPicPr>
<pic:cNvPr descr="burton_shoulders.png" id="23" name="Picture" />
<pic:cNvPicPr>
<a:picLocks noChangeArrowheads="1" noChangeAspect="1" />
</pic:cNvPicPr>
</pic:nvPicPr>
<pic:blipFill>
<a:blip r:embed="rId21" />
<a:stretch>
<a:fillRect />
</a:stretch>
</pic:blipFill>
<pic:spPr bwMode="auto">
<a:xfrm>
<a:off x="0" y="0" />
<a:ext cx="5334000" cy="891742" />
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst />
</a:prstGeom>
<a:noFill />
<a:ln w="9525">
<a:noFill />
<a:headEnd />
<a:tailEnd />
</a:ln>
</pic:spPr>
</pic:pic>
</a:graphicData>
</a:graphic>
</wp:inline>
</w:drawing>
</w:r>
</w:p>
</w:footnote> From the working document.xml: <w:footnote w:id="1">
<w:p w14:paraId="619C6545" w14:textId="09E8AFA1" w:rsidR="008F1B46" w:rsidRDefault="008F1B46">
<w:pPr>
<w:pStyle w:val="FootnoteText"/>
</w:pPr>
<w:r>
<w:rPr>
<w:rStyle w:val="FootnoteReference"/>
</w:rPr>
<w:footnoteRef/>
</w:r>
<w:r>
<w:t xml:space="preserve"> This is a note.
</w:t>
</w:r>
<w:r>
<w:rPr>
<w:noProof/>
</w:rPr>
<w:drawing>
<wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="3EA678A6" wp14:editId="472FEAD2">
<wp:extent cx="5943600" cy="3325495"/>
<wp:effectExtent l="0" t="0" r="0" b="1905"/>
<wp:docPr id="90137236" name="Picture 1" descr="A couple of people playing basketball

Description automatically generated"/>
<wp:cNvGraphicFramePr>
<a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/>
</wp:cNvGraphicFramePr>
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:nvPicPr>
<pic:cNvPr id="90137236" name="Picture 1" descr="A couple of people playing basketball

Description automatically generated"/>
<pic:cNvPicPr/>
</pic:nvPicPr>
<pic:blipFill>
<a:blip r:embed="rId1">
<a:extLst>
<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
<a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0"/>
</a:ext>
</a:extLst>
</a:blip>
<a:stretch>
<a:fillRect/>
</a:stretch>
</pic:blipFill>
<pic:spPr>
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="5943600" cy="3325495"/>
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
</pic:spPr>
</pic:pic>
</a:graphicData>
</a:graphic>
</wp:inline>
</w:drawing>
</w:r>
</w:p>
</w:footnote>
|
I've tried adding the Relationship to footnotes.xml.rels and linking to that with |
Ah -- I had some syntax errors. This works, with <?xml version="1.0" encoding="UTF-8"?><Relationships
xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId001"
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/i\
mage" Target="media/rId21.png"/>
</Relationships> |
So, to fix this, we need to do this:
|
The current code is a bit ugly. We add References for every external link to footnotes.xml.rel, even for those not in footnotes. We can make this more targeted. |
Discussed in #9602
Originally posted by Amphiboly March 23, 2024
With the docx writer, images in footnotes are displayed as properly-sized box with "Picture...". The same markdown source processes as expected with the odt and ConTeXt writers.
This was initially reported under Pandoc 3.12.3 and persists through the current (3.14) version.
The text was updated successfully, but these errors were encountered: