在使用 rmarkdown 生成的 beamer 演示文稿中垂直居中对齐列的内容

Vertically center-align content of columns in a beamer presentation generated with rmarkdown

如何在 `rmarkdown::beamer_presentation 中垂直居中对齐多列内容?

根据对 的回答的评论中的建议,我尝试了 ::: {.column width="30%"},但对我不起作用。

如果有一种简单的方法可以以不同方式对齐每一列的内容,那也会非常有帮助(例如,c1:顶部,c2:中间,c3:底部, c4: 中间).

MWE

---
output:
  bookdown::pdf_book:
    base_format: rmarkdown::beamer_presentation
    slide_level: 2
    keep_tex: true
---

## Figures in columns top-aligned
::: columns

:::: {.column width="30%"}
```{r top-p-5, echo=FALSE, out.width='30%'}
plot(pressure[1:5,])
```
::::

:::: {.column width="30%"}
```{r top-p-10, echo=FALSE, out.width='50%'}
plot(pressure[1:10,])
```
::::

:::: {.column width="30%"}
```{r top-p-all, echo=FALSE, out.width='100%'}
plot(pressure[1:nrow(pressure),])
```
::::

:::

## Figures in columns center-aligned (not working)
::: columns

::: {.column width="30%"}
```{r center-p-5, echo=FALSE, out.width='30%'}
plot(pressure[1:5,])
```
:::

::: {.column width="30%"}
```{r center-p-10, echo=FALSE, out.width='50%'}
plot(pressure[1:10,])
```
:::

::: {.column width="30%"}
```{r center-p-all, echo=FALSE, out.width='100%'}
plot(pressure[1:nrow(pressure),])
```
:::

:::

您可以使用 :::: {.columns align=center} 居中对齐

---
output:
  bookdown::pdf_book:
    base_format: rmarkdown::beamer_presentation
    slide_level: 2
    keep_tex: true
---

## Figures in columns top-aligned
::: columns

:::: {.column width="30%"}
```{r top-p-5, echo=FALSE, out.width='30%'}
plot(pressure[1:5,])
```
::::

:::: {.column width="30%"}
```{r top-p-10, echo=FALSE, out.width='50%'}
plot(pressure[1:10,])
```
::::

:::: {.column width="30%"}
```{r top-p-all, echo=FALSE, out.width='100%'}
plot(pressure[1:nrow(pressure),])
```
::::

:::

## Figures in columns center-aligned (not working)
:::: {.columns align=center}

::: {.column width="30%"}
```{r center-p-5, echo=FALSE, out.width='30%'}
plot(pressure[1:5,])
```
:::

::: {.column width="30%"}
```{r center-p-10, echo=FALSE, out.width='50%'}
plot(pressure[1:10,])
```
:::

::: {.column width="30%"}
```{r center-p-all, echo=FALSE, out.width='100%'}
plot(pressure[1:nrow(pressure),])
```
:::

::::

为了补充@samcarter_is_at_topanswers.xyz 的有用答案,可以采用以下方法以不同方式对齐每列中的内容:

---
output:
  bookdown::pdf_book:
    base_format: rmarkdown::beamer_presentation
    slide_level: 2
    keep_tex: true
---

```{r echo=FALSE}
# CHECK PANDOC VERSION
library(rmarkdown)
if (pandoc_available())
  cat("pandoc", as.character(pandoc_version()), "is available\n (pandoc >2.11.2 is required)")
```

## Figures in columns center-aligned (set for all columns at once)
:::: {.columns align=center}

::: {.column width="30%"}
```{r center-p-5, echo=FALSE, out.width='30%'}
plot(pressure[1:5,])
```
:::

::: {.column width="30%"}
```{r center-p-10, echo=FALSE, out.width='50%'}
plot(pressure[1:10,])
```
:::

::: {.column width="30%"}
```{r center-p-all, echo=FALSE, out.width='100%'}
plot(pressure[1:nrow(pressure),])
```
:::

::::


## Figures in columns aligned differently (set for separately for each column)
:::: {.columns}

::: {.column width="30%" align=center}
center
```{r 3-center-p-5, echo=FALSE, out.width='30%'}
plot(pressure[1:5,])
```
:::

::: {.column width="30%" align=top}
top
```{r 3-top-p-10, echo=FALSE, out.width='50%'}
plot(pressure[1:10,])
```
:::

::: {.column width="30%" align=bottom}
bottom
```{r 3-bottom-p-all, echo=FALSE, out.width='100%'}
plot(pressure[1:nrow(pressure),])
```
:::

::::