Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rmarkdown to Word output - insert page number for word document

I am editing a Rmarkdown file, I want to know is there a solution to insert page numbers for word in rmd file which will output to a word document.

---
title: "title"
output:
word_document:
    reference_docx: ../template/template.docx

like image 732
Minyi Han Avatar asked May 28 '18 07:05

Minyi Han


1 Answers

In MS Word, edit the header or footer of your word template file (../template/template.docx) to include a Word placeholder for the page number. Not only will that provide page numbers, but they will update if the document is edited or reformatted.

like image 143
DonJ Avatar answered Nov 20 '22 13:11

DonJ