以PDF格式呈现Posterdown软件包(R)中的HTML文件

以PDF格式呈现Posterdown软件包(R)中的HTML文件,r,pdf,latex,r-markdown,R,Pdf,Latex,R Markdown,我试图使用RMarkdown()中的posterdown包生成一个漂亮的PDF文件。我注意到,默认模板在安装包后生成为HTML文件。有没有办法将其设置为生成PDF文件而不是HTML文件 此外,是否有一种方法可以自定义标题和标题中的默认颜色(绿色)为我选择的HTML颜色代码 这里是默认的YAML --- title: Generate Reproducible & Live HTML and PDF Conference Posters Using RMarkdown author:

我试图使用RMarkdown()中的
posterdown
包生成一个漂亮的PDF文件。我注意到,默认模板在安装包后生成为HTML文件。有没有办法将其设置为生成PDF文件而不是HTML文件

此外,是否有一种方法可以自定义标题和标题中的默认颜色(绿色)为我选择的HTML颜色代码

这里是默认的YAML

---
title: Generate Reproducible & Live HTML and PDF Conference Posters Using RMarkdown
author:
  - name: Brent Thorne
    affil: 1
    orcid: '0000-0002-1099-3857'
  - name: Another G. Author
    affil: 2
affiliation:
  - num: 1
    address: Department of Earth Science, Brock University
  - num: 2
    address: Department of Graphics and Layouts, University of Posters; Canada
column_numbers: 3
logoright_name: https://raw.githubusercontent.com/brentthorne/posterdown/master/images/betterhexlogo.png
logoleft_name: https://raw.githubusercontent.com/brentthorne/posterdown/master/images/betterhexlogo.png
output: 
  posterdown::posterdown_html:
    self_contained: false
bibliography: packages.bib
---


蒂亚

您可以使用或内联CSS控制颜色,您需要将
knit:pagedown::chrome\u print
添加到YAML中,以便打印到PDF并保留CSS代码。出于习惯,我还将代码更改为“自包含:TRUE”。当我运行下面的代码时,我会更改
posterdown
标题颜色,并在默认的PDF查看器中打开,因为它现在是.PDF

---
title: Generate Reproducible & Live HTML and PDF Conference Posters Using RMarkdown
author:
  - name: Brent Thorne
    affil: 1
    orcid: '0000-0002-1099-3857'
  - name: Another G. Author
    affil: 2
affiliation:
  - num: 1
    address: Department of Earth Science, Brock University
  - num: 2
    address: Department of Graphics and Layouts, University of Posters; Canada
column_numbers: 3
logoright_name: https://raw.githubusercontent.com/brentthorne/posterdown/master/im    ages/betterhexlogo.png
logoleft_name: https://raw.githubusercontent.com/brentthorne/posterdown/master/ima    ges/betterhexlogo.png
output: 
  posterdown::posterdown_html:
    self_contained: TRUE
knit: pagedown::chrome_print
---

```{css, echo=FALSE}
div.title_container{
   background-color: #ff7f50;
}

div.logo_left{
  background-color: #ff7f50;
}
div.logo_right{
  background-color: #ff7f50;
}
```

您可以使用或内联CSS控制颜色,您需要将
knit:pagedown::chrome\u print
添加到YAML中,以将打印转换为PDF并保留CSS代码。出于习惯,我还将代码更改为“自包含:TRUE”。当我运行下面的代码时,我会更改
posterdown
标题颜色,并在默认的PDF查看器中打开,因为它现在是.PDF

---
title: Generate Reproducible & Live HTML and PDF Conference Posters Using RMarkdown
author:
  - name: Brent Thorne
    affil: 1
    orcid: '0000-0002-1099-3857'
  - name: Another G. Author
    affil: 2
affiliation:
  - num: 1
    address: Department of Earth Science, Brock University
  - num: 2
    address: Department of Graphics and Layouts, University of Posters; Canada
column_numbers: 3
logoright_name: https://raw.githubusercontent.com/brentthorne/posterdown/master/im    ages/betterhexlogo.png
logoleft_name: https://raw.githubusercontent.com/brentthorne/posterdown/master/ima    ges/betterhexlogo.png
output: 
  posterdown::posterdown_html:
    self_contained: TRUE
knit: pagedown::chrome_print
---

```{css, echo=FALSE}
div.title_container{
   background-color: #ff7f50;
}

div.logo_left{
  background-color: #ff7f50;
}
div.logo_right{
  background-color: #ff7f50;
}
```