mav*_*cks 1 markdown latex r beamer r-markdown
如何在`rmarkdown::beamer_presentation 中垂直居中对齐多列的内容?
正如对这个 SO 帖子的回答的评论中所建议的那样,我尝试过::: {.column width="30%"},但这对我不起作用。
如果有一种简单的方法可以为每一列以不同的方式对齐内容,那也将非常有用(例如,c1:顶部,c2:中间,c3:底部,c4:中间)。
---
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),])
```
:::
:::
Run Code Online (Sandbox Code Playgroud)
您可以使用:::: {.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),])
```
:::
::::
Run Code Online (Sandbox Code Playgroud)