11

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?

DeanAttali
  • 25,268
  • 10
  • 92
  • 118

1 Answers1

12

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.

Community
  • 1
  • 1
lbeziaud
  • 312
  • 4
  • 13
  • So I can use a specific footer, but there's no way to make it a variable basically? Do you also know the answer about page numbers? – DeanAttali Jul 13 '15 at 08:14
  • Exactly! Adding the page number in the footer does work. Count is incremented if needed. – lbeziaud Jul 13 '15 at 08:26
  • Page numbers are treated the same as footer/header? – DeanAttali Jul 13 '15 at 08:40
  • What do you mean? Inserting page numbers into the template from Word will add page numbers on the output document. – lbeziaud Jul 13 '15 at 08:44
  • I mean: there is no way to specify a parameter to pandoc saying `--page_nums=true/false`, right? Page numbers will only exist if using a template document that has page numbers? – DeanAttali Jul 13 '15 at 08:47
  • Correct. Pandoc does not provide an option to toggle page numbering (regardless of the output format). – lbeziaud Jul 13 '15 at 08:56