I am exporting an rmarkdown
file to odt
, to html
, and to pdf
. But let's focus on the odt
export first.
I want to have an address as part of the YAML header:
---
title: Test Multi
address:
First Name
Institute
Street
City
output:
odt_document:
template: default.opendocument
---
# Just a test document
With some text
This address should then be exported as part of the 'header'. Therefore, I have added the following snippet into the default odt-template (saved as default.opendocument
):
$if(address)$
<text:p text:style-name="Author">$address$</text:p>
$endif$
But at the export the line breaks are lost:
Following this answer I tried pipes as in
---
title: Test Multi
address: |
| First Name
| Institute
| Street
| City
output:
odt_document:
template: default.opendocument
---
# Just a test document
With some text
But then, the address is missing completely from the odt.
So, my question is: How can I have the multi-line address from the YAML added to the export preserving the line breaks?
PS: I am using rmarkdown 1.12
and pandoc-2.7.3
`. If I replace `$address$ ` by `$address$` this works with your syntax in the `Rmd`.
– Andreas Aug 19 '19 at 07:51