YAML front in R markdown version 2: add foundation and logo

Can I add an institution and logo to the front YAML element in R markdown version 2?

I'm looking for something like this

--- title: "My report" author: "me" institution: "Swansea University" logo: "logo.png" output: pdf_document: toc: yes --- 
+5
source share
1 answer

The answer is to use a template file, but you need to tweak a bit for its bit:

 --- title: "My report" author: "me" output: pdf_document: toc: yes includes: in_header: style.tex --- 

Prepare the document "style.tex" in the same folder as your markup file, and make sure that you change the working directory in R to this folder.

Add the following lines to your style.tex file:

 \institute{My institute} \pgfdeclareimage[width=2cm]{logo}{logo.png} \usebackgroundtemplate{\pgfuseimage{logo}} 

Thanks: Inserting a logo into a ray presentation using R Markdown

+1
source

Source: https://habr.com/ru/post/1204555/


All Articles