0
votes

I am attempting to use the posterdown package in RMarkdown (https://pythonawesome.com/use-rmarkdown-to-generate-pdf-conference-posters-via-html-or-latex/) to generate a nice PDF file. I noticed that the default template is generated as an HTML file once you install the package. Is there any way to set it to to generate as a PDF instead of an HTML file?

Additionally, is there a way to customise the default color (green) in the header and titles to an HTML color code of my choice?

Here is the default 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
---

TIA!

1

1 Answers

2
votes

You can control the color with the YAML or inline CSS, you will want to add knit: pagedown::chrome_print to your YAML to get print to PDF and retain the CSS code. I also changed my code to self_contained: TRUE out of habit. When I run the code below, I get changed posterdown header color, and it opens in my default PDF viewer as it's now a .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;
}
```

enter image description here