[英]R Markdown keywords don't appear in the document
我想編織一個 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
編織為PDF時,關鍵字將發送到文件元數據,但實際上在文件中不可見。 資源
您可以使用base_format: rticles::elsevier_article
自定義 PDF 生成template
或渲染 Rmd 文件。 但是,還有另一種方法可以通過在 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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.