Issues with cover page and table of contents when converting HTML to DOCX #11012
Mystery-cyf
started this conversation in
General
Replies: 2 comments 4 replies
-
The generated table of contents contains fields that will update automatically to the right pages, but it may require saving the document. (Also, are you using Word or something else to view the docx?) Cover page is possible but tricky. It requires some fooling around with raw OpenXML and a custom template. Don't have time now to elaborate. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Regarding creating the cover page, you may find this article useful. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Pandoc team,
I'm using pandoc 3.7.0.2 to convert an HTML file to DOCX, and I ran into two issues during the process.
Problem 1: Adding a cover page (with image) before the table of contents
I would like the generated DOCX file to have:
A cover page with an image,
Followed by a table of contents on the second page, and then
The rest of the content.
Currently, I can't figure out how to insert a proper cover page that appears before the TOC, with the TOC starting on the next page.
Problem 2: Page numbers in TOC all show "1"
I used the --toc option and successfully generated a table of contents. However, all items in the TOC show page number 1, even though the content spans multiple pages.
Command used:
pandoc project.html -o output.docx
--reference-doc=reference.docx
--toc
--lua-filter=pagebreak.lua
--metadata-file=meta.yaml
Is there something I'm doing wrong in terms of configuration? Or are there known limitations around these two issues?
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions