2

I'm trying for my slides and wondering how to use \pause in code. Minimum working example (Test.qmd) is below for reference.

---
title: "Test Slides"
format:
  revealjs: 
    chalkboard: 
      buttons: false
    preview-links: auto
    css: styles.css
---

## Intro
Here is a TikZ picture

```{r, engine = 'tikz'}
\begin{tikzpicture}
 \draw (0,0) circle (1cm);
 %\pause
 \draw (0,0) circle (2cm);
\end{tikzpicture}
```

2 Answers 2

1

Using \pause inside a tikzpicture is not the best of ideas. This can cause other problems, like missing footlines.

Instead, I suggest to use the overlay-beamer-styles library:

---
title: "Test Slides"
format: beamer
header-includes:
  - \usepackage{tikz}
  - \usetikzlibrary{overlay-beamer-styles}
---

### Intro

Here is a TikZ picture

```{=latex}
\begin{tikzpicture}
 \draw (0,0) circle (1cm);
\draw[visible on=<2->] (0,0) circle (2cm);
\end{tikzpicture}
```

enter image description here

1
  • This works fine for beamer format. Wondering if there is any solution for revealjs format.
    – MYaseen208
    Jun 14 at 5:21
0

mwe

---
title: "Test Slides"
format: beamer
---

### Intro

Here is a TikZ picture

```{=latex}
\begin{tikzpicture}
 \draw (0,0) circle (1cm);
\pause
\draw (0,0) circle (2cm);
\end{tikzpicture}
```

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .