【问题标题】:figure before, not after #Discussion - R Markdown图之前,而不是之后#Discussion - R Markdown
【发布时间】:2022-01-02 21:51:51
【问题描述】:

我在定位人物时遇到问题。

我的标题:

\usepackage{amsmath}
\usepackage{pdflscape}
\newcommand{\blandscape}{\begin{landscape}}
\newcommand{\elandscape}{\end{landscape}}

我的一些 R Markdown 代码:

\newpage
\blandscape
```{r finaltable1_1, echo=FALSE}
table1_1
```
\elandscape

\newpage
\blandscape
```{r figone, message=FALSE, warning=FALSE, echo=FALSE, out.width='100%', fig.align='center', fig.cap='description.'}
knitr::include_graphics('./images/figure2.pdf')
```
\elandscape

\newpage
```{r figresults, message=FALSE, warning=FALSE, echo=FALSE, out.width='100%', fig.align='center', fig.cap='description.'}
knitr::include_graphics('./images/figure3.pdf')
```

\newpage
# Discussion

图 3 应该在讨论之前,但它在之后显示,关于可能发生的任何想法?

【问题讨论】:

  • 你的数字是 .pdf 吗?
  • 谢谢@manro 是的。我注意到,当我有一张小桌子,然后我有 \newpage # Discussion 时,“讨论”部分从小桌子的页面开始,而不是在新的页面中。有什么想法吗?
  • 我会看到的。等一下。
  • 是的,我看到了这个问题

标签: position r-markdown figure


【解决方案1】:

所以,您可以通过以下方式解决您的问题:

a) 减小此块中图片的宽度:

```{r figresults, message=FALSE, warning=FALSE, echo=FALSE, out.width='70%', fig.align='center', fig.cap='description.'}
knitr::include_graphics('pic.pdf')
```

b) 使用其他结构:

![My piccy-pic](pic.pdf){width=90%}

\begin{figure}[H]
\centering
\includegraphics[width=0.9\textwidth]{pic.pdf}
\caption{I'm here}
\end{figure}

【讨论】:

  • 成功了,非常感谢@manro!!
猜你喜欢
  • 2011-07-04
  • 2015-03-02
  • 1970-01-01
  • 1970-01-01
  • 2022-10-23
  • 1970-01-01
  • 2016-11-16
  • 1970-01-01
  • 2023-02-15
相关资源
最近更新 更多