微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

是否还有其他人在 Rmarkdown 中遇到了 \FloatBarrier 的问题

如何解决是否还有其他人在 Rmarkdown 中遇到了 \FloatBarrier 的问题

如果我使用 \FloatBarrier 来维护所需的文档顺序,我会收到以下错误并且无法编织 PDF(特别是 PDF)。它可能在六个月前奏效。

! Undefined control sequence.
l.128 \FloatBarrier
                    \#\# Of Officer Initiated Stops,how does the race of the 

Error: LaTeX Failed to compile more_effective_policing.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See more_effective_policing.log for more info.

一个可重现的例子: *注意:我只是打开了一个认的 Rmarkdown,然后我添加了 \FloatBarrier。然后我尝试编织成 PDF。

---
title: "knit"
author: "James Ades"
date: "6/9/2021"
output:
  pdf_document: default
  html_document: default
---

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


## R Markdown

This is an R Markdown document...

{r cars}
summary(cars)


## Including Plots

You can also embed plots,for example:


{r pressure,echo=FALSE}
plot(pressure)

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

\FloatBarrier

解决方法

如果你想使用它的宏之一,你必须加载 placeins 包:

---
title: "knit"
author: "James Ades"
date: "6/9/2021"
output:
  pdf_document: 
    keep_tex: true
  html_document: default
header-includes:
  \usepackage{placeins}
---

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


## R Markdown

This is an R Markdown document...

{r cars}
summary(cars)


## Including Plots

You can also embed plots,for example:


{r pressure,echo=FALSE}
plot(pressure)

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

\FloatBarrier

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。