Generate Reproducible & Live HTML and PDF Conference Posters Using RMarkdown

Brent Thorne1, , Another G. Author2


1 Department of Earth Science, Brock University
2 Department of Graphics and Layouts, University of Posters; Canada

Introduction

Welcome to posterdown ! This is my attempt to provide a semi-smooth workflow for those who wish to take their R Markdown skills to the conference world. Most features from R Markdown are available in this package such as Markdown section notation, figure captioning, and even citations like this one (Allaire et al. 2022). The rest of this example poster will show how you can insert typical conference poster features into your own document.

Objectives

  1. Easy to use reproducible poster design.
  2. Integration with R Markdown.
  3. Easy transition from posterdown to pagedown report or manuscript documents (Xie et al. 2022).

Methods

This package uses the same workflow approach as the R Markdown you know and love. Basically it goes from RMarkdown > Knitr > Markdown > Pandoc > HTML/CSS > PDF. You can even use the bibliography the same way (Thorne 2019).

Results

Usually you want to have a nice table displaying some important results that you have calculated. In posterdown this is as easy as using the kable table formatting you are probably use to as per typical R Markdown formatting.

You can reference tables like so: Table 1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam placerat augue at velit tincidunt semper. Donec elementum porta posuere. Nullam interdum, odio at tincidunt feugiat, turpis nisi blandit eros, eu posuere risus felis non quam. Nam eget lorem odio. Duis et aliquet orci. Phasellus nec viverra est.

Table 1: Table caption.
Sepal.Length Sepal.Width Petal.Length Petal.Width
5.1 3.5 1.4 0.2
4.9 3.0 1.4 0.2
4.7 3.2 1.3 0.2
4.6 3.1 1.5 0.2
5.0 3.6 1.4 0.2
5.4 3.9 1.7 0.4
4.6 3.4 1.4 0.3
5.0 3.4 1.5 0.2
4.4 2.9 1.4 0.2
4.9 3.1 1.5 0.1

Or with figures: Figure 1, or Figure 2.

Great figure!

Figure 1: Great figure!

font_add_google("IBM Plex Sans Condensed", "ibm")
showtext_auto()

light_blue <- "#B5C2E2"
blue <- "#09689B"
  
annos <- c(2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022)
lab <- "*Name:* <span style = 'color:black'>George FLoyd</span><br>
*Age:* <span style = 'color:black'>25</span><br>
*A Father*"
anno_labs <- c(" **2013**",
               " **2014**",
               " **2015**",
               " **2016**",
               " **2017**",
               " **2017**",
               " **2019**",
               " **2020**",
               " **2021**",
               " **2022**")
lab_hjust = c(0, 0,0,0,0,0,0,0,0,0)

labs_df <- tibble(annos = annos, 
                  anno_labs = glue("<span style='color:black'>{anno_labs}</span>"),
                  lab_hjust = lab_hjust)


df <- read.csv("data_police.csv")

df$date <- as.Date(df$date, format = "%Y-%m-%d")

# Extract the year from the date column
df$year <- as.integer(format(df$date, "%Y"))

# Group the data by year and count the number of rows for each year
yearly_counts <- group_by(df, year) %>% 
  summarise(count = n())

# Plot the timeline plot using ggplot
ggplot(yearly_counts, aes(x=year, y=count)) +
  geom_line() +
   geom_text(
    mapping = aes(label = paste0( count)), 
    nudge_x = -0.3
  ) + 
  geom_segment(data = labs_df, aes(x = annos, xend = annos, y = 900, yend = 1200),
             linetype = 2, alpha = .1) +
  geom_curve(x = 2016.5, y = 980,
             xend = 2017, yend =1090,
             arrow = arrow(length = unit(.5, "cm")),
           color = "grey40")+
  #geom_segment(x = 2020, y = 1050,
      #       xend = 2021, yend =1156,
     #        arrow = arrow(length = unit(.1, "cm")),
    #       color = "orange")+
   #geom_richtext(aes(x = 2020, y = 1050,
   #                 label = lab), col="orange",hjust = 0)+
  
  
  #geom_segment(x = 2019, y = 1000,
     #        xend = 2020, yend =1142,
           #  arrow = arrow(length = unit(.1, "cm")),
    #       color = "orange")+
   #geom_richtext(aes(x = 2019, y = 1000,
     #               label = lab), col="orange",hjust = 0)+
  
  
 # geom_segment(x = 2018, y = 950,
    #         xend = 2019, yend =1097,
     #        arrow = arrow(length = unit(.1, "cm")),
      #     color = "orange")+
   #geom_richtext(aes(x = 2018, y = 950,
    #                label = lab), col="orange",hjust = 0)+
  
  
  annotate(geom = "text", x = 2016.05, y = 970, size = 2.5,
           label = "The highest consecutive\nincrements", hjust = 0, vjust = 0,
           lineheight = .9, family = "ibm", color = "grey40") +
  annotate("rect", xmin = 2021, xmax = 2022, ymin = 900, ymax = 1200,
           alpha = .1, fill="black")+
  annotate(geom = "text", x = 2021.5, y = 1164, size = 3.5,
           label = "Incomplete Report", hjust = 0, vjust = 0,
           lineheight = .9, family = "ibm", color = "darkblue", angle=90) +
  geom_point(color = light_blue) +
  ggtitle("Timeline Plot of Number of Events per Year") +
  scale_y_continuous(limits = c(900, 1200), breaks = c(900, 500, 1200), 
                     position = "right") +
  theme_minimal() +
  theme(text = element_text(family = "ibm"),
        panel.grid.minor = element_blank(),
        panel.grid.major.x = element_blank(),
        plot.title = element_text(face = "bold", hjust = .5),
        plot.caption = element_textbox_simple(width = unit(8.5, "in"), hjust = 0,
                                       lineheight = 1.25, size = 9,
                                       color = "grey40")) +
  labs(title = "Police fatal shooting ",
       y = "Total deaths", x = "Year (2013 - 2022)",
       caption = glue("<br>Data shown spans from 2013 and 2022 and it shows 
                      deaths after encounter with a police. 
                      As it is shown in the figure the first order is suggestive of an increasing fatal encounters with a police over the years. 
                      Comparing the percentage difference in total number of deaths by police, from 2013 to 2021 there is an increament of 6.5% (76 deaths). 
                      2021 shows the highest death numbers (1159) compared to the previous years. 
                      From these deaths xx% are attributed to Black community. 
                      Adjusting for the population difference the Black community faces xx times more risk of fatal police shooting as opposed white community. "))
Amazing, right?!

Figure 2: Amazing, right?!

Next Steps

Aliquam sed faucibus risus, quis efficitur erat. Vestibulum semper mauris quis tempus eleifend. Aliquam sagittis dictum ipsum, quis viverra ligula eleifend ut. Curabitur sagittis vitae arcu eget faucibus. In non elementum felis. Duis et aliquam nunc. Nunc pulvinar sapien nunc, vel pretium nisi efficitur in. Fusce fringilla maximus leo et maximus. Fusce at ligula laoreet, iaculis mi at, auctor odio. Praesent sed elementum justo. Aenean consectetur risus rhoncus tincidunt efficitur. Praesent dictum mauris at diam maximus maximus (Thorne 2019).

Conclusion

Try posterdown out! Hopefully you like it!

References

Allaire, JJ, Yihui Xie, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, Hadley Wickham, Joe Cheng, Winston Chang, and Richard Iannone. 2022. Rmarkdown: Dynamic Documents for r. https://CRAN.R-project.org/package=rmarkdown.
Thorne, Brent. 2019. Posterdown: Generate PDF Conference Posters Using r Markdown. https://github.com/brentthorne/posterdown.
Xie, Yihui, Romain Lesur, Brent Thorne, and Xianying Tan. 2022. Pagedown: Paginate the HTML Output of r Markdown with CSS for Print. https://github.com/rstudio/pagedown.