Officedown: Images in page headers of reference docx

Created on 26 Apr 2021  路  7Comments  路  Source: davidgohel/officedown

I'm trying to knit a markdown with officedown::rdocx_document using a reference docx with an image in the page header. When knitting the markdown with regular word_document the header image is there, but when I use officedown::rdocx_document the header image is ignored. Is this normal? Does officedown::rdocx_document support images in the headers of reference docx's? Is there another way to add images in the page headers from the Rmd itself?

Here as example with the reference docx attached:

reference.docx

``````````

date: "r Sys.Date()"
author: "Your Name"
title: "officedown template"
output:
officedown::rdocx_document:

reference_docx: reference.docx

```{r setup, include=FALSE}

knitr::opts_chunk$set(echo = TRUE, fig.cap = TRUE)
library(officedown)
library(officer)
library(flextable)


# Title
```{r}
flextable(head(iris))

``````````

bug

All 7 comments

Yes, users did want to be able to define page width, height, margins etc. I added this feature but forgot to preserve header/footer. I will fix

Thanks. And thank you again for the officeverse. It's really useful.

It's fixed now. Thank you for letting me know about this problem.

That's great, David. Thanks to you for your work. I0m assuming it's on the github version, not CRAN yet, right?

Yes, it's only on github for now

Apologies David, I tried this with an image in the first page header and the GitHub version (0.2.3.001) does not seem to work. When I put the image in the default header it does work. Does this mean first page headers are not supported in officedown?

Apologies - I missed the discussion here: https://github.com/davidgohel/officedown/issues/35

@PHEindrakusuma This issue is closed as it is fixed. I just retried the example upper, and it works as expected. Please provide a reproducible example in a new issue if you think you met a bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madlogos picture madlogos  路  7Comments

evanmascitti picture evanmascitti  路  3Comments

CLRafaelR picture CLRafaelR  路  6Comments

CLRafaelR picture CLRafaelR  路  7Comments

bachlaw picture bachlaw  路  3Comments