如何在 rmarkdown 演示文稿中包含左侧图像和右侧文本

How to include image on left side and text on the right side for rmarkdown presentation

如何在 Markdown 中完成此操作?

我在 Rmarkdown 中使用 beamer 演示文稿,我想要幻灯片左侧的图像和幻灯片右侧的文本。

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

但是对于 Markdown 而不是 Latex。

使用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}

我不会将 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}

你可以按照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)
:::
::::