Styled Footnotes for Standard DOCX Compile Output

Based on a couple of recent threads Compile Footnotes and also Spacing between footnotes and footer when compiled to Word — while I personally don’t use native DOCX, I did notice that the native DOCX output uses inline styling for footnotes. It would be better if the footnotes were given styling. Word natively uses Footnote Reference to style the markers and Footnote Text to style the footnote text. Pandoc can generate DOCX with these styles from Scrivener, but for users who do not want to compile with MMD this would be a small improvement.

In this comment I tested RTF / DOCX / Pandoc / ODT outputs and the resultant outputs: Compile Footnotes - #37 by nontroppo — RTF loaded to word does have a Footnote style but no styling of markers, DOCX has no styling, and ODT also uses Footnote for the text with automatic marker styling.

Technical Details

The XML for a footnote reference in the text (document.xml in the Word zip bundle) with a style looks like:

<w:r>
<w:rPr><w:rStyle w:val="FootnoteReference"/></w:rPr>
<w:footnoteReference w:id="1"/>
</w:r>

The footnote itself lives in footnotes.xml and the style looks like:

<w:footnote w:id="1"><w:p w14:paraId="41C8DB86" w14:textId="4BBD092F" w:rsidR="00073711" w:rsidRPr="00073711" w:rsidRDefault="00073711">
<w:pPr><w:pStyle w:val="FootnoteText"/><w:rPr>
<w:lang w:val="en-US"/></w:rPr></w:pPr><w:r>
<w:rPr><w:rStyle w:val="FootnoteReference"/></w:rPr>
<w:footnoteRef/></w:r><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:rPr><w:lang w:val="en-US"/></w:rPr><w:t>A footnote</w:t></w:r></w:p></w:footnote>

Note the <w:pStyle w:val="FootnoteText"/> and <w:rStyle w:val="FootnoteReference"/>

EDIT: for completeness — in ODT the native styles are Footnote Anchor for intext anchor, Footnote Characters for the marker in the footnote area, and Footnote for the footnote text. For some reason LibreOffice doesn’t indicate the anchor styles when they are selected but editing the styles does change them…

3 Likes

I second this wish!

It is somewhat maddening to have to walk through and apply the Footnote Reference and Footnote Text styles to my DOCX output.