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

Only some headers properly formatting after .docx conversion #46

Closed charlieharrysmith closed 2 years ago

charlieharrysmith commented 2 years ago

Hi Ian! I've had scrivomatic set up and working for over a year now (thank you for all the time saved!) but have recently reinstalled MacOS and run into an issue that I can't seem to troubleshoot.

On compiling to .docx, a few of my headings render out as expected whilst others render out like this:

Screenshot 2022-03-28 at 15 23 43

The same seems to happen with subscript. There doesn't seem to be much rhyme or reason to which ones are properly converted. H1, H2 and H3 all face this issue intermittently and I can't particularly discrern what could be causing the problems. In the same document, some will work and some won't. The log scrivomatic creates also doesn't seem to note anything related to this issue.

I should clarify that I don't use binder headings, preferring to instead have my titles appear in text. That said, they are styled properly, I believe, and look fine in the .md output. Yet in the .docx they often don't populate as styled headings.

Any ideas what might be going on here? Thank you in advance for any guidance you can offer!

iandol commented 2 years ago

Hi @charlieharrysmith, are you sure there are paragraph breaks before the Heading? What does the intermediate markdown look like, can you see differences between the headings that do work and those that don't?

charlieharrysmith commented 2 years ago

Your suggestion to compare the .md to .docx solved it.

I was trying to be clever, using a lua filter and adding <br> before some headings to force a line break. But it was clearly interferring with the native linebreaks. After removing that HTML, headings are being converted into formatted text as expected. I can't believe I didn't notice!

Thanks so much for this—I was really scratching my head! Will mark this as closed.