如何在rmarkdown beamer马德里演示文稿中结束标题3框?

Cor*_*one 9 latex r beamer knitr r-markdown

当使用Madrid beamer主题(以及其他一些主题)时,Header 3呈现为覆盖整个部分的框,但在markdown中,标题仅在开始时指定.如何指定该部分的结尾?

在下面的例子中,我想要第二个句子在框内,但第三个要回到白色背景.

例:

---
title: "Example"
output: 
  beamer_presentation:
    colortheme: beaver
    theme: Madrid
---

## Slide with Box

Hello, I'm not in the box

### This is a box
And this text is in the box!


I don't want to be in the box, but I am.
Run Code Online (Sandbox Code Playgroud)

产量

在此输入图像描述

Vin*_*mot 7

这对我有用:

## Slide with block 2

Hello, I'm not in the block.

\begin{block}{This is a block}
  And this text is in the block!
\end{block}


Hi, I'm not in the block either!
Run Code Online (Sandbox Code Playgroud)


boj*_*jan 5

使用较新版本的 Pandoc(我有 2.2.3.2),您可以使用受隔离的 div 来包围块。之前 1.6 版本对我来说不起作用。

因此,这将起作用:

## Slide with Box

Hello, I'm not in the box

::: {.block}
### This is a box
And this text is in the box!
:::

I don't want to be in the box, and I am not.
Run Code Online (Sandbox Code Playgroud)

::: {.block}:::界定块。请参阅https://github.com/jgm/pandoc/issues/2957

\begin{block}使用and的一个优点\end{block}是您可以在块内使用 markdown。