I'm trying to build a RMarkdown template to match a corporate template, which includes a large .png logo on the first page before the title, author and date.
With latex/pdf output we appear to be able to solve this with
--header-includes
in the yaml, but this isn't an option for docx output.
I've seen examples where an image is inserted into the title (paying attention to whitespace after the image line):
author: "name"
title: |

My Title
date: "`r Sys.Date()`"
output:
officedown:rdocx_document:
reference_docx: my_template.DOCX
This compiles, but the resulting DOCX gives a warning of unreadable content in the document when opened. If I let Word attempt to recover, the image is replaced with a red x and a "picture can not be displayed".
The image is also included in the main body towards the end of the document.
If it is excluded from the title:
but remains in the body, it will render fine, so it's not a problem with the image. However, if it is in the body and in the title:
then both are replaced with "picture can not be displayed". i.e. Including it in the yaml breaks the image throughout the document.
I've also tried using a "first page different" header in the docx template (i.e. this question/answer: Rmarkdown to Word output - insert image above header), however this gets inserted AFTER the Title/TOC before the first bit of body text for some reason.
Is this a bug with rmarkdown? officedown? or am I trying to do something which is impossible? Does anyone know an alternative workaround, or replicate this problem?