iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
👩‍🏫

Creating Research Presentation Slides with Marp: Moving Beyond Beamer

に公開

I have been using different tools for creating presentation slides for laboratory meetings and other occasions as follows:

  • When I want to build them thoroughly: PowerPoint
  • When I want to build them simply: Beamer (on Overleaf)

However, I was hoping for something even easier to use than Beamer.


Recently, I learned about Marp, a tool that lets you create slides using Markdown, and read several articles about it.

https://qiita.com/tomo_makes/items/aafae4021986553ae1d8

https://dev.classmethod.jp/articles/make-slides-from-markdown-with-marp/

The tool itself seemed very user-friendly, but the slide designs introduced in the articles felt like they were geared toward Lightning Talks (LT) and weren't quite to my liking.

So, I created my own Marp theme with a more academic flavor and would like to introduce it here.

How to Install

I'll assume you have Marp for VS Code already installed.

Please place the following file in your directory:

.vscode/settings.json
{
    "markdown.marp.themes": [
        "https://raw.githubusercontent.com/kaisugi/marp-theme-academic/main/themes/academic.css"
    ]
}

Now, you can use the theme by including the following at the beginning of your Markdown file:

---
marp: true
theme: academic
---

Demo

---
marp: true
theme: academic
paginate: true
math: katex
---

<!-- _class: lead -->

# Creating Laboratory Presentation Slides with Marp

#### ~ Let's graduate from Beamer ~

<br>

**Author Taro**
Hogehoge Lab M2
YYYY/MM/DD


---

<!-- _header: Table of Contents -->

1. Introduction
1. Code Blocks
1. Mathematical Formulas
1. Figures


---

<!-- _header: Introduction -->

- Marp is software for creating **slides** using **Markdown**.
  - Basic Markdown syntax is supported.
- You can move to the next page simply by inserting a horizontal rule `---` in Markdown.$^1$

> 1: Since Marp is developed according to the CommonMark Markdown specification, the "footnote" syntax (the one using `[^1]`), which is not part of CommonMark, is not provided. Therefore, I implemented a pseudo-footnote by referring to https://github.com/marp-team/marp/discussions/150#discussioncomment-1302384.


---

<!-- _header: Code Blocks -->

```python
import torch
print(torch.cuda.is_available())
```

You can write code blocks like this.

```python
from transformers import AutoModelForMaskedLM, AutoTokenizer
model = AutoModelForMaskedLM.from_pretrained("cl-tohoku/bert-base-japanese-whole-word-masking")
tokenizer = AutoTokenizer.from_pretrained("cl-tohoku/bert-base-japanese-whole-word-masking")

inputs = tokenizer.encode_plus("私はとても[MASK]です。", return_tensors='pt')
outputs = model(**inputs)
tokenizer.convert_ids_to_tokens(outputs.logits[0][1:-1].argmax(axis=-1))
```

The width is automatically adjusted (refer to [Auto-scaling](https://github.com/marp-team/marp-core#auto-scaling-features) in the documentation).


---

<!-- _header: Mathematical Formulas -->

$$ I_{xx}=\int\int_Ry^2f(x,y)\cdot{}dydx $$

$$
f(x) = \int_{-\infty}^\infty
    \hat f(\xi)\,e^{2 \pi i \xi x}
    \,d\xi
$$

You can write mathematical formulas like this. Of course, inline $\LaTeX$ is also available.  
You can also use emojis: :smile:


---

<!-- _header: Figures -->

1. First, download the image (`kenkyu_woman_seikou.png`) from [this Irasutoya link](https://www.irasutoya.com/2018/10/blog-post_723.html) by right-clicking.
2. Create a directory named `images` in the same directory as this Markdown file, and place the downloaded image there. Now you're all set.

![w:300 center](./images/kenkyu_woman_seikou.png)

If You Want to Make Corrections to the Theme

Please submit an Issue or PR to the following GitHub repository.
If you like the theme, please give it a star 🌟 🙇

https://github.com/kaisugi/marp-theme-academic

Discussion