Achieving Corporate Design Consistency in Reports with Indiedown

An R Markdown Solution

Angelica Becerra

Why PDF?

  • Offline access
  • Cross-Platform Consistency
  • Facilitate distribution
  • Long-Term Storage
  • Non-Editable Format

and think about the time to deal with logos, positioning, colors schemes, …

How can we include these elements using Rmarkdown?

How can we include these elements using Rmarkdown?

Logo in the first page

---
title: "Document with logo"
header-includes: 
   \usepackage{graphicx}
   \usepackage{fancyhdr}
   \pagestyle{fancy}
   \setlength\headheight{28pt}
   \fancyhead[L]{\includegraphics[width=10cm]{logo.png}}
   \fancyfoot[LE,RO]{GPIM}
output: pdf_document
---

\addtolength{\headheight}{1.0cm} 
\fancypagestyle{plain}{} the first page
\thispagestyle{fancy} 
\fancyhead[L]{\includegraphics[width = 100pt]{logo.png}}
\renewcommand{\headrulewidth}{0pt}

Logo in the first page

---
title: "Document with logo"
header-includes: 
   \usepackage{graphicx}
   \usepackage{fancyhdr}
   \pagestyle{fancy}
   \setlength\headheight{28pt}
   \fancyhead[L]{\includegraphics[width=10cm]{logo.png}}
   \fancyfoot[LE,RO]{GPIM}
output: pdf_document
---

\addtolength{\headheight}{1.0cm} 
\fancypagestyle{plain}{} the first page
\thispagestyle{fancy} 
\fancyhead[L]{\includegraphics[width = 100pt]{logo.png}}
\renewcommand{\headrulewidth}{0pt}

After setting up the colors, fonts, table of content…

Templates

  1. use_rmarkdown_template()
  2. Create your template
  3. Confirm that your template is accessible

Some issues

  • no idea about the errors
  • no idea about Latex
  • Some elements missing

Indiedown

Indiedown

Source: www.tg.ch

Indiedown

  • Keep all corporate design elements as code

  • indiedown does not modify the default .tex. Extends Pandoc .tex

Indiedown - First steps

Installation

install.packages("indiedown")

Create your own package

indiedown::create_indiedown_package("templateuser2024")

Build your package using Build and Reload in RStudio or with:

devtools::install("templateuser2024")

You have created the first template

You have created the first template

After the new package is built and installed, you will have available the new template (after restart)

How to customize the new template?

Customization points

Customization points

Customization points

Customization points

Customization points

Customization points

Customization points

Customization points

Main customization point

Convert this Rmd template

---
title: "Document with logo"
header-includes: 
   - \usepackage{graphicx}
   - \usepackage{fancyhdr}
   - \pagestyle{fancy}
   - \setlength\headheight{28pt}
   - \fancyhead[L]{\includegraphics[width=10cm]{logo_here.png}}
   - \vspace*{2cm}
output: pdf_document
---

\addtolength{\headheight}{1.0cm}
\fancypagestyle{plain}{} 
\thispagestyle{fancy}
\fancyhead[L]{\includegraphics[width = 100pt]{logo_here.png}}
\renewcommand{\headrulewidth}{0pt}
\vspace*{2cm}
\clearpage

To this template using indiedown

---
title: "Document with logo"
output: templateuser2024::templateuser2024
---
```{r}
library(templateuser2024)
cd_knit_chunk_opts()
```
```{r}
cd_page_title()
cd_footer()
```

With indiedown

  • The template is friendly to the final user.
  • Customization in R functions.
  • All corporate design elements are in the package.

Publications created with indiedown

Source: www.tg.ch

Publications created with indiedown

Source: www.stadt-zuerich.ch: report on top, report on bottom

Quarto and Typst?

Thanks!