如何在左侧包含图像,在右侧包含文本以进行rmarkdown演示

时间:2017-07-08 21:29:25

标签: html r markdown r-markdown beamer

如何在Markdown中完成?

我在Rmarkdown中使用投影仪演示,我希望幻灯片左侧有一个图像,幻灯片右侧有文字。

基本上,这样做:https://tex.stackexchange.com/questions/165475/figure-next-to-text-in-beamer

但是Markdown不是乳胶。

3 个答案:

答案 0 :(得分:6)

使用multicol包:

---
title: "Untitled"
author: "Martin"
date: "7/9/2017"
output: 
  beamer_presentation: 
    keep_tex: yes
header-includes:
  - \usepackage{multicol}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## R Markdow

\begin{multicols}{2}

  \null \vfill
  \includegraphics[width=.3\textwidth]{unnamed.png}
  \vfill \null

\columnbreak

  \null \vfill
  \begin{itemize}
    \item Item 1
    \item Item 2
  \end{itemize}
  \vfill \null
\end{multicols}

enter image description here

答案 1 :(得分:1)

您可以按照Pandoc的方式来做!有关更多信息,请参见manual

---
output: beamer_presentation
---

:::: {.columns}
::: {.column width="60%"}
![giraffe](giraffe.jpg)
:::
::: {.column width="40%"}
["Funny giraffe looking at the side"](https://www.flickr.com/photos/8070463@N03/9594476129) by [Tambako the Jaguar](https://www.flickr.com/photos/8070463@N03) is licensed under [CC BY-ND 2.0](https://creativecommons.org/licenses/by-nd/2.0/?ref=ccsearch&atype=rich)
:::
::::

screenshot


图片:捷豹Tambako的“有趣的长颈鹿看着侧面”已获CC BY-ND 2.0许可。要查看此许可证的副本,请访问https://creativecommons.org/licenses/by-nd/2.0/

答案 2 :(得分:0)

我不会将multicol包与Beamer一起使用,Beamer对于列具有自己的机制:

---
output: 
  beamer_presentation:
    theme: "CambridgeUS"
    keep_tex: true

---

# test

\begin{columns}[onlytextwidth,T]
  \begin{column}{.45\linewidth}
    \includegraphics[width=\linewidth]{example-image-duck}
  \end{column}
  \begin{column}{.45\linewidth}
    test
  \end{column}
\end{columns}

enter image description here

相关问题