Theorem and Proof Environment in Beamer

1.1k views Asked by At

I am currently trying to use quarto beamer to making lecture slides. I would like to use the theorem environment in beamer, the qmd file however cannot render properly. Rendering stopped with latex error showing that Command \theorem already defined. I am wondering what have I done wrong?

The sample codes are as follows

---
title: "Untitled"
format: beamer
editor: visual
---

## Quarto

Quarto enables you to weave together content and executable code into a finished presentation. To learn more about Quarto presentations see <https://quarto.org/docs/presentations/>.

::: {#thm-test}
## Just a quick test
:::

If possible, I hope that I can include theorem, definition, example environment in quarto beamer presentation.

Thanks for the help in advance.

1

There are 1 answers

0
samcarter_is_at_topanswers.xyz On BEST ANSWER

Quarto very unhelpfully loads tons of unnecessary packages like amsthm, which beamer automatically loads, and then blindly tries to define a new theorem environment, even though beamer already has defined it. At the very minimum it should check if an environment is already defined before doing this.

You can work around the problem with the notheorems class options.

---
title: "Untitled"
format: beamer
editor: source
classoption: "notheorems"
---

## Quarto

Quarto enables you to weave together content and executable code into a finished presentation. To learn more about Quarto presentations see <https://quarto.org/docs/presentations/>.

::: {#thm-test}
## Just a quick test
:::