Skip to content

Commit

Permalink
Add "lean" template
Browse files Browse the repository at this point in the history
  • Loading branch information
grantmcdermott committed Jul 16, 2021
1 parent 700fd57 commit 9b18bd1
Show file tree
Hide file tree
Showing 10 changed files with 594 additions and 0 deletions.
46 changes: 46 additions & 0 deletions inst/rmarkdown/templates/lecturenotes-lean/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Course title
subtitle: Lecture title
author:
name: Your name
affiliation: University | Course code
# date: "`r format(Sys.time(), '%d %B %Y')`" ## Or "Lecture no."
output:
html_document:
keep_md: false
theme: journal
highlight: haddock
# code_folding: show
toc: yes
toc_depth: 4
toc_float: yes
css: css/preamble.css ## For multi-col environments
pdf_document:
latex_engine: xelatex
keep_tex: false ## Change to true if want keep intermediate .tex file
toc: true
toc_depth: 3
dev: cairo_pdf
# fig_width: 7 ## Optional: Set default PDF figure width
# fig_height: 6 ## Optional: Set default PDF figure height
extra_dependencies: ['booktabs', 'threeparttable', 'float'] # "longtable"
includes:
in_header: tex/preamble.tex ## For multi-col environments
pandoc_args:
--template=tex/mytemplate.tex ## For affiliation field. See: https://bit.ly/2T191uZ
always_allow_html: true
urlcolor: blue
mainfont: cochineal
sansfont: Fira Sans
monofont: Fira Code ## Although, see: https://tex.stackexchange.com/q/294362
## Automatically knit to both formats:
knit: (function(inputFile, encoding) {
rmarkdown::render(inputFile, encoding = encoding,
output_format = 'all')
})
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, cache = TRUE, dpi=300)
```

10 changes: 10 additions & 0 deletions inst/rmarkdown/templates/lecturenotes-lean/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Lecture Notes (lean)
description: >
My Rmd lecture notes setup, designed for exporting to both HTML and PDF
formats. Takes care of things like consistent multi-column environments and
regression table output, support for non-standard fonts in figures, nice
affiliation typesetting for PDF format, etc.
Note: This "lean" version just includes the scaffolding without any example
code.
create_dir: FALSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* See: https://bookdown.org/yihui/rmarkdown-cookbook/multi-column.html */
.columns {display: flex; flex-basis: auto}
Loading

0 comments on commit 9b18bd1

Please sign in to comment.