Skip to content

Commit

Permalink
Karolinska Institutet theme (#238)
Browse files Browse the repository at this point in the history
* Added KI theme

* Expanded title

* <h*> tags have the same weight as body text

* Added link to correct logo

* Updated NEWS

* Simplified font choice (it's now consistent across OSes)

* More minor edits to style

* Updated demo file
  • Loading branch information
ellessenne authored and tcgriffith committed Dec 23, 2019
1 parent 71b0b39 commit 377d9d8
Show file tree
Hide file tree
Showing 4 changed files with 424 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGES IN xaringan VERSION 0.14

## NEW FEATURES

- Added a theme following the Karolinska Institutet design guidelines (@ellessenne, #238).

## BUG FIXES

- Removed the `xmlns` attribute in the `<html>` tag in the default HTML template (thanks, @pat-s, #197).
Expand Down
104 changes: 104 additions & 0 deletions inst/examples/ki-demo.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: "Karolinska Institutet Theme"
subtitle: "...powered by xaringan"
author: "Alessandro Gasparini"
date: "Last updated: `r Sys.Date()`"
output:
xaringan::moon_reader:
css: ["ki", "ki-fonts"]
nature:
highlightStyle: solarized-dark
countIncrementalSlides: false
---

```{r setup, include = FALSE}
options(htmltools.dir.version = FALSE)
```

# Hello World

Install the **xaringan** package from [Github](https://github.com/yihui/xaringan):

```{r eval=FALSE, tidy=FALSE}
devtools::install_github("yihui/xaringan")
```

--

You are recommended to use the [RStudio IDE](https://www.rstudio.com/products/rstudio/), but you do not have to.

- Create a new R Markdown document from the menu `File -> New File -> R Markdown -> From Template -> Ninja Presentation`;<sup>1</sup>

--

- Click the `Knit` button to compile it;

--

- or use the [RStudio Addin](https://rstudio.github.io/rstudioaddins/)<sup>2</sup> "Infinite Moon Reader".

.footnote[
[1] 中文用户请看[这份教程](http://slides.yihui.org/xaringan/zh-CN.html)

[2] See [#2](https://github.com/yihui/xaringan/issues/2) if you do not see the template or addin in RStudio.
]

---

# Extra colours

The `ki` theme includes extra colours and font sizes.

Colours: .plum[`.plum[]`], .grey[`.grey[]`], .white[`.white[]`], .black[`.black[]`], .cyclamen[`.cyclamen[]`], .main[`.main[]`], .accent[`.accent[]`], .text[`.text[]`], .text-inverse[`.text-inverse[]`].

The colours of the theme can be easily customised - see `ki.css`.

---

# Extra font sizes:

The `ki` theme includes extra colours and font sizes.

Font-sizes: .tiny[(.)tiny[]], .scriptsize[(.)scriptsize[]], .footnotesize[(.)footnotesize[]], .small[(.)small[]], .normalsize[(.)normalsize[]], .large[(.)large[]], .Large[(.)Large[]], .LARGE[(.)LARGE[]], .huge[(.)huge[]], .Huge[(.)Huge[]], .references[(.)references[]].

---

# Lists

1. One

2. Two

3. Three


* A

* B

* C

---

# R output

```{r cars}
s <- summary(cars)
s
```

As you can see above, the monospaced font supports ligatures.

---

# Plot

```{r pressure, echo = FALSE}
plot(pressure)
```

---

# Disclaimer

The Karolinska Institutet logo is used for dissemination purposes only - please read the webpage with the visual identity guidelines: https://staff.ki.se/download-karolinska-institutets-logo
16 changes: 16 additions & 0 deletions inst/rmarkdown/templates/xaringan/resources/ki-fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import url('https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,700&display=swap');
@import url('https://fonts.googleapis.com/css?family=Fira+Sans+Condensed:400,400i,700&display=swap');
@import url('https://fonts.googleapis.com/css?family=Fira+Code:400,700&display=swap');

body {
font-family: "Fira Sans", sans-serif;
}

h1, h2, h3, h4, h5, h6, .remark-slide-number {
font-family: "Fira Sans Condensed", sans-serif;
font-weight: normal;
}

.remark-code, .remark-inline-code {
font-family: "Fira Code", monospace;
}
Loading

0 comments on commit 377d9d8

Please sign in to comment.