iandol / scrivomatic

A writing workflow using Scrivener's style system + Pandoc for output…
https://iandol.github.io/scrivomatic/
GNU General Public License v3.0
297 stars 30 forks source link

Endnotes instead of footnotes (docx) #43

Open bokamm opened 3 years ago

bokamm commented 3 years ago

I fear this is an absolute newb question but how do I compile in a way that linked footnotes are turned into endnotes automatically using docx? I found nothing in the Scrivener Format or in how to set up the pandocomatic yaml or template docx-files.

The Scrivener user manual speaks of the possibility of using inline and linked footnotes as separate streams, turning one into footnotes, the other into endnotes (page 536). How/where do I enable that "[^cf1]:" linked footnotes will be turned into endnotes when compiled for docx?

Thank you!

iandol commented 3 years ago

To be honest, I've never used endnotes and don't really know where Word identifies this? If this is somehow a style or setting that gets preserved in the DOCX template, then perhaps editing the custom.docx file would be sufficient? Try making two otherwise blank DOCX files only changing the placement, then use them as templates to compile a simple test document.

bokamm commented 3 years ago

Thank you for getting back on this! I tried what you suggested (edited my docx template) but on compile the Scrivener footnotes still turn into footnotes, not endnotes in the result.

I usually do not use endnotes either but the publisher asks for them. I can switch from footnotes to endnotes within Word (via Draft view) but would have to do it again and again should I need to re-compile. Thus, I was wondering if there is a way to do this somehow via the Scrivener format or your scrivomatic script (as I have no idea how to target the "streams" mentioned in the Scrivener manual).

If that cannot be done, I will manage manually. Thank you for your time! (and a fantastic script!)

iandol commented 3 years ago

If the custom.docx template doesn't transfer this information, then I think there is no easy way to automate this. An involved solution is to make a script that would edit the XML in the DOCX file (DOCX file is basically a ZIP file containing lots of XML files) to manually trigger this, but that still requires us understanding how and where this information is stored...

The "streams" in Scrivener cannot yet be targeted for selective output as Pandoc itself doesn't support more than one note stream. For LaTeX or HTML, I think it would be possible to make a switch that would change the template variables to change the formatting and use Pandoc filters that can tag the "streams", but that doesn't solve the DOCX problem...

Formal support for endnotes vs. footnotes are on the Pandoc roadmap:

https://github.com/jgm/pandoc/wiki/Roadmap

…but implementation details are not yet settled upon: https://github.com/jgm/pandoc/issues/1425

bokamm commented 3 years ago

Thank you for the follow-up and explanation!

If it's on the Pandoc roadmap and no easy way to implement it right now, I will stick to the current manual solution of converting the notes in Word after compile. Maybe the implementation details get settled until I have to finally submit, so I will keep an eye on that discussion!