2
我對乳膠很陌生,我正在試圖用數字標題創建圖形。爲什麼我不能使用fig.cap - Latex通過Sweave + Knitr
現在,當我嘗試把塊加入fig.cap
標題(第二塊),我得到的錯誤
Latex error: Not in outer par mode
我的代碼
<<echo = FALSE>>=
source("analysis.R")
repoData <- readRDS("data/repoData.rds")
a4width<- 8.3
a4height<- 11.7
@
\begin{figure}[h]
<<echo = FALSE, fig.width= a4width, fig.height=0.35*a4height>>=
G2(repoData)
@
\end{figure}
## ---- G2 ----
G2 <- function(df) {
# For inflation graph
plot <- ggplot(df, aes(x = Month, y = Percent)) +
geom_line(colour = "firebrick") +
xlab("") +
ylab("Repo rate") +
theme_classic() +
theme(axis.title.y = element_text(vjust = 1))
return(plot)
}
爲什麼會出現這種情況,這可怎麼解決?
啊。但是,我怎麼能指定數字放在哪裏呢?因爲我需要\ {figure}之後的[h](「here」)。 – uncool