Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to add page numbers and footer to docx WITHOUT specifying template?

Tags:

pandoc

I've only startd looking into pandoc a few hours ago so there's still lots I don't know. I know that if I modify a generated docx and add footer and page numbers, then I can use that as a template, but I'm wondering if it's possible to use pandox without a template and generate a footer and page numbers?

I was thinking this would be possible

pandoc <args> --page_numbers --footer="Created by John Smith"

Or is that only doable with a template?

like image 845
DeanAttali Avatar asked Jul 02 '15 21:07

DeanAttali


People also ask

Why does my footer disappear when I add a page number?

Your description suggests you're typing them. The problem with footnotes & page #s clashing suggests you haven't allowed any header/footer space from the edge of the page (see Page Setup>Layout). Was this reply helpful?


1 Answers

There is currently no default template for the docx format (see 1, 2, 3) so you cannot pass a footer file by command line.

You can use the reference-docx option to provide a footer but cannot override the footer variable:

pandoc -f markdown --reference-docx=template.docx -t docx input.md -o output.docx

Edit: Adding (from Word) page numbers on the template does work.

like image 157
lbeziaud Avatar answered Oct 10 '22 18:10

lbeziaud