R markdown/bookdown - 如何在摘要下方显示关键字?

标签 r knitr bookdown

我在 .Rmd 文件中定义了关键字,但它们在输出 PDF 中不可见。

<小时/>

电流输出

output without keywords

<小时/>

预期结果

expected results with keywords

<小时/>

当前.Rmd

.Rmd 文件的第一行如下所示:

---
title: "No keywords within the output file"
abstract: "This is sample text for abstract. Generally speaking, I would like to show keywords list below an abstract (as in case of the linked example)"
keywords: "keywordA, keywordB"
author: "Mateusz Kędzior"
output: 
  bookdown::pdf_document2:
    keep_tex: true
    number_sections: yes
    toc: false
base_format: rticles::elsevier_article
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Elsevier article

This is an R Markdown document.

I'm trying to prepare an Elsevier article. 

最佳答案

我想知道base_format是否真的在你的示例中做了任何工作(无论有没有base_format,输出看起来都是一样的)。由于 base_formatpdf_book 的参数,请考虑将 YAML header 更改为

---
title: "No keywords within the output file"
author: 
- name: "Mateusz Kędzior"
abstract: "This is sample text for abstract. Generally speaking, I would like to show keywords list below an abstract (as in case of the linked example)"
keywords: "keywordA, keywordB"
output: 
  bookdown::pdf_book:
    keep_tex: true
    number_sections: yes
    toc: false
    base_format: rticles::elsevier_article
---

这将为您提供以下输出:

enter image description here

<小时/>

或者,向摘要添加关键字:

    abstract: "This is sample text for abstract. Generally speaking, I would like
 to show keywords list below an abstract (as in case of the linked example) \\par
 \\textbf{Keywords:} a, b"

获取

enter image description here

关于R markdown/bookdown - 如何在摘要下方显示关键字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42272048/

相关文章:

R - 使用 data.table 连接超过 2^31 行

python - knitr 设置 block 中是否需要 "library(reticulate)"

R:如何更改knitr word中文本的字体和对齐方式

r - 如何在 bookdown 中使用新的 bs4() 主题?

r - 在 R 中,如何将数据帧的某些行与某些逻辑相加?

r - 如何读取文本文件并替换 R 中的单词?

css - Rvest,html_nodes 返回空列表和字符串,使用网站

r - 将 R Markdown 发布到 Wordpress 时,不在 shorttag 中对内容进行 html 编码

r - 如何在标题中添加引号(bookdown)

引用带有 bookdown 的数字