Rmarkdown yaml 中的多个作者和字幕 [英] multiple authors and subtitles in Rmarkdown yaml
问题描述
我正在尝试按照 这个 pandoc 示例添加yaml 元数据块中的多个作者.pdf 将在 RStudio(版本 0.98.932)中生成,但没有作者信息.
I'm trying to follow this pandoc example to add multiple authors to an Rmarkdown file in the yaml metadata block. The pdf will generate in RStudio (Version 0.98.932), but there is no author information.
---
title: 'This is the title: it contains a colon'
author:
- name: Author One
affiliation: University of Somewhere
- name: Author Two
affiliation: University of Nowhere
date: "`r format(Sys.time(), '%d %B %Y')`"
tags: [nothing, nothingness]
abstract: |
This is the abstract.
It consists of two paragraphs.
output: pdf_document
---
我还想进一步自定义标题并添加副标题.可能吗?
I'd also like to customize the heading a bit more and add a subtitle. Possible?
推荐答案
rmarkdown 中的默认 Latex 模板不支持作者单位或字幕.它确实支持多个作者,但是正确的 yaml 语法是
The default latex template in rmarkdown does not support author affiliations or subtitles. It does support multiple authors however, the correct yaml syntax is
---
title: 'This is the title: it contains a colon'
author:
- Author One
- Author Two
date: "`r format(Sys.time(), '%d %B %Y')`"
tags: [nothing, nothingness]
abstract: |
This is the abstract.
It consists of two paragraphs.
output:
pdf_document:
template: NULL
---
如果你想自定义你的header,最好的方法是修改latex模板,在此处找到 以满足您的需求.然后将其复制到您的本地目录并将其传递到 template
字段中的标题.
If you want to customize your header, the best approach is to modify the latex template, found here to suit your needs. Then copy it to your local directory and pass it to the header in the template
field.
这篇关于Rmarkdown yaml 中的多个作者和字幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!