【发布时间】:2019-08-19 07:23:11
【问题描述】:
我正在将rmarkdown 文件导出到odt、html 和pdf。但让我们先关注odt 导出。
我想要一个地址作为 YAML 标头的一部分:
---
title: Test Multi
address:
First Name
Institute
Street
City
output:
odt_document:
template: default.opendocument
---
# Just a test document
With some text
然后,此地址应作为“标头”的一部分导出。因此,我在default odt-template中加入了如下sn-p(另存为default.opendocument):
$if(address)$
<text:p text:style-name="Author">$address$</text:p>
$endif$
但在导出时,换行符会丢失:
在this answer 之后,我尝试了管道
---
title: Test Multi
address: |
| First Name
| Institute
| Street
| City
output:
odt_document:
template: default.opendocument
---
# Just a test document
With some text
但是,该地址完全从 odt 中丢失。
所以,我的问题是:如何将 YAML 中的多行地址添加到导出并保留换行符?
PS:我正在使用rmarkdown 1.12 和pandoc-2.7.3
【问题讨论】:
标签: r-markdown pandoc