我想编织一个pdf文档,但是关键字没有出现在最终文档中。有人可以说我在做什么错吗?
---
title: "title"
subtitle: "subtitle"
author: "author"
date: "09 04 2019"
output:
pdf_document:
keywords: "word1, word2, word3"
footerdate: yes
abstract: 'Insert abstract here'
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Introduction
答案 0 :(得分:0)
编织为PDF时,关键字将发送到文件元数据,但实际上在文件中不可见。 Source
答案 1 :(得分:0)
您可以customize the template
for PDF generation 或render Rmd files with base_format: rticles::elsevier_article
。
但是,还有另一种方法可以通过在 Rmd 文件中添加一些代码来在 PDF 上显示关键字:
\keyword
命令 (\providecommand{\keywords}[1]{\textbf{\textit{Keywords---}} #1}
) 提供到 YAML 的 header-includes
键中;---
title: "title"
subtitle: "subtitle"
author: "author"
date: "09 04 2019"
output:
pdf_document:
# keywords: "word1, word2, word3" # <- You don't have to add your keywords here since they only appear as the 'invisible' metadata of PDF
footerdate: yes
abstract: 'Insert abstract here'
header-includes:
- |
```{=latex}
\providecommand{\keywords}[1]{\textbf{\textit{Keywords---}} #1}
```
---
```{=latex}
\keywords{word1, word2, word3}
```
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Introduction