README.md 4.8 KB
Newer Older
Nicolas Lenz's avatar
Nicolas Lenz committed
1
# Pandoc Template: Slides
Nicolas Lenz's avatar
Nicolas Lenz committed
2

Nicolas Lenz's avatar
Nicolas Lenz committed
3
4
This is a template for building presentation slides using Markdown and Pandoc, mainly meant for usage as a git submodule.

Nicolas Lenz's avatar
Nicolas Lenz committed
5
6
7
You can take a look at my [functional programming slides](https://git.eisfunke.com/lab/fupro) or my[pandoc slides](https://git.eisfunke.com/lab/pandoc) if you want to see it in action.

I also have templates for other document types [here](https://git.eisfunke.com/document/pandoc-template).
Nicolas Lenz's avatar
Nicolas Lenz committed
8

Nicolas Lenz's avatar
Nicolas Lenz committed
9
10
11
12
13
14
15
16
## Requirements

You need the following software installed:

- Pandoc
- `pandoc-crossref`
- LuaLaTeX
- `make`
Nicolas Lenz's avatar
Nicolas Lenz committed
17
18
19
20
- These fonts:
  - [Zilla Slab](https://github.com/mozilla/zilla-slab)
  - [Raleway](https://github.com/theleagueof/raleway)
  - [Iosevka Funke](https://git.eisfunke.com/config/iosevka)
Nicolas Lenz's avatar
Nicolas Lenz committed
21

Nicolas Lenz's avatar
Nicolas Lenz committed
22
Alternatively you can use my [PandocPlus Docker image](https://git.eisfunke.com/software/container/pandoc-plus) if you don't want to install the software and fonts directly.
Nicolas Lenz's avatar
Nicolas Lenz committed
23
24
25
26

Instructions below!

## Preparing the Project
Nicolas Lenz's avatar
Nicolas Lenz committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

You need the files in this repo inside a folder named `template` in your project folder to use it. Use one of the following methods to get it.

### Use as download

- Download the repo: [zip file](https://git.eisfunke.com/document/pandoc-template/slides/-/archive/main/slides-main.zip)
- Extract the archive into a folder named `template` inside your project folder.

### Use as repo

- Clone this repo with `git clone https://git.eisfunke.com/document/pandoc-template/slides.git template` into your project folder.

### Use inside a Git repo

- Create a Git repo inside a folder using `git init` or clone an existing one with `git clone`
- Inside the repo folder create a Git submodule with this template repo: `git submodule add --name template https://git.eisfunke.com/document/pandoc-template/slides template`

Nicolas Lenz's avatar
Nicolas Lenz committed
44

Nicolas Lenz's avatar
Nicolas Lenz committed
45
46
47
48
49
## Usage

Your project directory should now look like this:

```
Nicolas Lenz's avatar
Nicolas Lenz committed
50
your project folder
Nicolas Lenz's avatar
Nicolas Lenz committed
51
52
53
54
├── literature.bib (optional, containing your biblatex references)
├── metadata.yaml (required, see below)
├── res (optional)
│   └── ... any images and other resources you need
Nicolas Lenz's avatar
Nicolas Lenz committed
55
├── src
Nicolas Lenz's avatar
Nicolas Lenz committed
56
57
│   ├── 10-your-first-source-file.md
│   ├── 20-your-second-source-file.md
Nicolas Lenz's avatar
Nicolas Lenz committed
58
│   └── … all your source files, they will be concatenated alphabetically
Nicolas Lenz's avatar
Nicolas Lenz committed
59
60
61
62
└── template
    └── … the contents of this repo
```

Nicolas Lenz's avatar
Nicolas Lenz committed
63
Compile your project with `make -f template/makefile`, the output will be in the file `out/slides.pdf`.
Nicolas Lenz's avatar
Nicolas Lenz committed
64

Nicolas Lenz's avatar
Nicolas Lenz committed
65
66
67
68
69
70
71
72
73
If you're using the docker image run this:

```sh
sudo docker pull registry.gitlab.fachschaften.org/nicolas.lenz/pandoc-plus  # to pull or update the image
sudo docker run --rm -v $PWD:/mnt registry.eisfunke.com/software/container/pandoc-plus make -C /mnt -f template/makefile
```

The first command will pull the image, the second will run the image by mounting the current working directory into the created container and then running `make` there to build the container.

Nicolas Lenz's avatar
Nicolas Lenz committed
74
75
76
77
78
79
80
81
82
83
### `metadata.yaml`

You need a `metadata.yaml` file for settings etc. All data is optional, except for `title`.

This minimal `metadata.yaml` would work to start you off:

```yaml
title: Your Title Here
```

Nicolas Lenz's avatar
Nicolas Lenz committed
84
This example shows all available options:
Nicolas Lenz's avatar
Nicolas Lenz committed
85
86

```yaml
Nicolas Lenz's avatar
Nicolas Lenz committed
87
title: Your Title Here  # required
Nicolas Lenz's avatar
Nicolas Lenz committed
88
89
subtitle: Your Subtitle Here
color-primary: ed6c00  # hex code for primary color for title slide and slide headings, this is the default
Nicolas Lenz's avatar
Nicolas Lenz committed
90
91
color-progress-bg: f07d8f  #  hex code for progress bar background, this is the default
color-progress-fg: a90d24  #hex code for progress bar foreground, this is the default
Nicolas Lenz's avatar
Nicolas Lenz committed
92
93
94
95
96
97
logo: logofile.png  # logo image file, will be shown on the title slide
author: Nicolas Lenz  # author for the title slide
date: 2022-04-28  # date for the title slide
institute: |  # will be shown on the right side of the title slide
  Line One

Nicolas Lenz's avatar
Nicolas Lenz committed
98
99
100
101
  Line Two
disclaimer: |  # will be shown on a slide after the title slide
  Line One

Nicolas Lenz's avatar
Nicolas Lenz committed
102
103
  Line Two

Nicolas Lenz's avatar
Nicolas Lenz committed
104
flake: false  # enables a snowflake in the background on the title slide, default is off
Nicolas Lenz's avatar
Nicolas Lenz committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

# customization options for the snowflake, these are the default settings
flake-symbols:
  - F
  - G
  - H
flake-rules:
  - "`F -> H[+HG][-HG]G`{=latex}"
  - "`G -> HF`{=latex}"
flake-axiom: FF
flake-order: 4
flake-rotation: 0
flake-step: 0.6cm
flake-width: 0.9cm
flake-scale: 1.0
flake-opacity: 0.1
```
Nicolas Lenz's avatar
Nicolas Lenz committed
122
123
124
125
126
127
128
129
130
131
132
133

### GitLab CI

This repo contains templates meant for inclusion into a `.gitlab-ci.yml` file if you want to build or deploy your slides using GitLab CI.

`build.gitlab-ci.yml` builds the pdf and tex files and saves them as artifacts. `pages.gitlab-ci.yml` can then be used to deploy the files via GitLab Pages. For example, if you wanted to do both, you could use this as your `.gitlab-ci.yml` in your project structured as described above:

```
include:
  - remote: https://git.eisfunke.com/document/pandoc-template/report/-/raw/main/build.gitlab-ci.yml
  - remote: https://git.eisfunke.com/document/pandoc-template/report/-/raw/main/pages.gitlab-ci.yml
```