Rmd report does not import margins, header o footer from template when using officedown::rdocx_document:

776 Views Asked by At

Edit:

I installed again the previous version of the package (ver. 0.2.1) and the problem is solved.

__

I am making a Rmarkdown report with the officedown package.

My Word output imports well the Word Styles of the template document, but does not import the margins, header or footer of the same template, did the sintax change?, here is the YAML of the report:

---
output:
  officedown::rdocx_document:
   reference_docx: template.docx
---   

The template works well when is used with the officer package, or when is used with the "normal" word output like this:

---
output:
  word_document:
    reference_docx: template.docx
---

Any ideas?

Thanks a lot for the help, i have been using the officeverse packages a lot in the last year and these are awesome

1

There are 1 best solutions below

1
On BEST ANSWER

I had the same problem, but you can set these parameters in the YAML header as mentioned in the Officeverse book.

Units in inches

output: 
  officedown::rdocx_document:
  page_size:
    width: 8.3
    height: 11.7
    orient: "portrait"
  page_margins:
    bottom: 1
    top: 1
    right: 1.25
    left: 1.25
    header: 0.5
    footer: 0.5
    gutter: 0.5