【问题标题】:How to end a header 3 box in rmarkdown beamer madrid presentation?如何在 rmarkdown beamer madrid 演示文稿中结束标题 3 框?
【发布时间】:2015-02-07 09:12:33
【问题描述】:

当使用 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.

输出

【问题讨论】:

  • @zx8754 这对我不起作用。

标签: r latex knitr r-markdown beamer


【解决方案1】:

这对我有用:

## 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!

【讨论】:

  • 聪明 - 直接切换到 LaTeX,markdown 然后忽略 LaTeX 并通过它。完美
  • 它仍然对我有用,你能更具体地说明它是如何不起作用的吗? (操作系统、R 版本、RStudio 版本等)
【解决方案2】:

使用较新版本的 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.

::: {.block}::: 分隔块。见https://github.com/jgm/pandoc/issues/2957

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

【讨论】:

    猜你喜欢
    • 2020-01-21
    • 2023-02-23
    • 1970-01-01
    • 2021-01-30
    • 1970-01-01
    • 1970-01-01
    • 2017-11-15
    • 2020-08-09
    • 2016-06-11
    相关资源
    最近更新 更多