Skip to content
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

footnotes numbered by chapter in docx writer #2773

Closed
crystalfp opened this issue Mar 10, 2016 · 3 comments
Closed

footnotes numbered by chapter in docx writer #2773

crystalfp opened this issue Mar 10, 2016 · 3 comments

Comments

@crystalfp
Copy link

I'm writing a long book in markdown and converting it to DOCX and EPUB3. In EPUB3 the footnotes numbering is restarted at each top level chapter. I think this is the correct behavior. Instead in the DOCX output the notes are numbered sequentially in the whole book.
Is it possible to have the footnotes numbered by chapter also in DOCX? Seems there is no way to reconcile the behavior between the two formats (at least my google investigation comes out empty).
Thanks for clarifying!
mario

Using pandoc 1.16.0.2 on Windows 7 64bits

@crystalfp
Copy link
Author

The same problem happens with latex output only if you don't pass to pandoc the command line --chapter Obvious, because footnote numbering restarts each chapter and not every section.
The solution seems to insert in the DOCX file a "Section Break (continuous)" before each Level 1 header and set "number footnotes per section". This second setting could be obviated with a template document, but the first one no because the break is not part of the heading. Is it possible to add an option to pandoc to add (in the DOCX writer) the section break before each level 1 header? One possible way is to overload the --chapter option to work in DOCX writer adding the break. Thanks! mario

@michalovadek
Copy link

michalovadek commented Dec 22, 2024

I know this is an old issue but I was wondering if this has been solved in the meanwhile. I have tried changing the setting to "number footnotes per section" in the docx template document I'm using but it does not solve the problem. I have also tried applying a filter creating section bibliographies (https://github.com/pandoc-ext/section-bibliographies). That does what it says but does not restart footnote numbering as hoped for.

@jgm
Copy link
Owner

jgm commented Dec 22, 2024

Is it possible to add an option to pandoc to add (in the DOCX writer) the section break before each level 1 header?

You could probably use a Lua filter to do this. (Adding RawBlock element with format openxml; but you need to get the XML exactly right.)

Is it possible to add an option to pandoc to add (in the DOCX writer) the section break before each level 1 header? One possible way is to overload the --chapter option to work in DOCX writer adding the break.

This is not a bad idea.

jgm added a commit that referenced this issue Dec 22, 2024
When `--top-level-division=chapter` is used, a paragraph with
section properties is inserted before each level-1 heading.
By default, this causes the new heading to start on a new page
(though this default can be adjusted in Word).

This change should also make it possible to number footnotes
by chapter (#2773), though that change isn't yet made.
@jgm jgm closed this as completed in b6aff21 Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants