RMarkdown Beamer 中并排显示的图形和图形标题

问题描述 投票:0回答:1

enter image description here

enter image description here

剧情来自http://xkcd.com/1132,而我只想要一张幻灯片是图旁边的图标题。

enter image description here

---
title: "CH6 Testing"
date: ""
fontsize: 9pt
header-includes:
 \usepackage{color}
 \usepackage{pdfpages}
 \usepackage{xeCJK}
 \setbeamertemplate{itemize items}[circle] ##可以改變符號的形狀
output:
 beamer_presentation:
  latex_engine: xelatex
---


## 6.10 The local FDR



```{r,echo=F,out.width='40%',fig.cap='While the frequentist only has the currently available data, the Bayesian can draw on her understanding of the world or on previous experience. As a Bayesian, she would know enough about physics to understand that our sun’s mass is too small to become a nova. Even if she does not know physics, she might be an empirical Bayesian and draw her prior from a myriad previous days where the sun did not go nova.',fig.margin=F,fig.align='center'}
knitr::include_graphics("./frequentists_vs_bayesians.png")
```

    
latex r-markdown figure caption beamer
1个回答
0
投票

您可以使用

\captionof
包中的
caption
宏将标题放置在图像旁边的列中:

---
title: "CH6 Testing"
date: ""
fontsize: 9pt
header-includes:
 - \usepackage{color}
 - \usepackage{pdfpages}
 - \usepackage{xeCJK}
 - \setbeamertemplate{itemize items}[circle] ##可以改變符號的形狀
 - \usepackage{caption}
output:
 beamer_presentation:
  latex_engine: xelatex
---


## 6.10 The local FDR

\begin{columns}[onlytextwidth]
\begin{column}{.4\textwidth}
\includegraphics[width=\textwidth]{example-image-duck}
\end{column}
\begin{column}{.55\textwidth}
\captionof{figure}{While the frequentist only has the currently available data, the Bayesian can draw on her understanding of the world or on previous experience. As a Bayesian, she would know enough about physics to understand that our sun’s mass is too small to become a nova. Even if she does not know physics, she might be an empirical Bayesian and draw her prior from a myriad previous days where the sun did not go nova.}
\end{column}
\end{columns}



    

© www.soinside.com 2019 - 2024. All rights reserved.