提问人:Aleksandra 提问时间:6/3/2020 最后编辑:jay.sfAleksandra 更新时间:6/4/2020 访问量:471
R Markdown 中的列
Columns in R Markdown
问:
我正在尝试做简单的投影仪演示。我的代码如下所示:
---
title: "Untitled"
author: "Name"
output:
beamer_presentation:
theme: "AnnArbor"
colortheme: "dolphin"
fonttheme: "structurebold"
fontsize: 24pt
---
## Slide 1
\begin{columns}
\column{0.75\textwidth}
```{r echo = FALSE, warning=FALSE, out.width="75%"}
plot(1:10)
```
\column{0.25\textwidth}
text
\end{columns}
## Slide 2
\begin{columns}
\column{0.25\textwidth}
text
\column{0.75\textwidth}
```{r echo = FALSE, warning=FALSE, out.width="75%"}
plot(1:10)
```
\end{columns}
在第一张幻灯片上,我的绘图就在左边,文字很好看,但在第二张幻灯片上,我的绘图在幻灯片的中间,文本被移动到幻灯片的左侧。你知道如何让它看起来像第一张幻灯片上的美观吗?我会非常乐意提供任何帮助:)
答:
1赞
samcarter_is_at_topanswers.xyz
6/4/2020
#1
您观察到的是几个不同原因的组合:
您使用的主题的边距比平时小 - 所有内容看起来都非常局促
列的总宽度太大,它们会突出到边距中。使用其中任何一个或使它们更小
\begin{columns}[onlytextwidth]
通过使用您的绘图,您的图将仅跨越其列的四分之一,从而增加大量不对称的空白空间。如果对您来说太大,请缩小列
out.width="75%"
100%
为了避免第三帧中的文本左对齐,您可以使用
\centering
---
title: "Untitled"
author: "Name"
output:
beamer_presentation:
theme: "AnnArbor"
colortheme: "dolphin"
fonttheme: "structurebold"
keep_tex: true
fontsize: 24pt
---
## Slide 1
\begin{columns}[onlytextwidth]
\column{0.75\textwidth}
```{r echo = FALSE, warning=FALSE, out.width="100%"}
plot(1:10)
```
\column{0.25\textwidth}
\centering
text
\end{columns}
## Slide 2
\begin{columns}[onlytextwidth]
\column{0.25\textwidth}
\centering
text
\column{0.75\textwidth}
\hfill
```{r echo = FALSE, warning=FALSE, out.width="100%"}
plot(1:10)
```
\end{columns}
评论