Essentially, I have an Rmd document configured as follows:
--- title: "Example" author: "me" date: "December 2014" output: pdf_document: fig_caption: yes keep_tex: yes --
Then in the document, I use ggplot2 to display some diagrams, for example:
```{r myLabel, fig.cap='My Caption'} qplot(1:10, 10:1) ```
Now, for some reason, I canβt explain or investigate deeper than this, the produced TeX does not contain a fig.env='figure' environment, even if I force it with fig.env='figure' . Instead, TeX has an includegraphics command:
\includegraphics{journal_files/figure-latex/myLabel-1.pdf}
Other figures in the same document have a digital environment with an inscription. Ie, TeX's "Knit PDF" output should produce:
\begin{figure}[htbp] \centering \includegraphics{journal_files/figure-latex/myLabel-1.pdf} \caption{My Citation} \end{figure}
The R Markdown log window displays only irrelevant things:
label: myLabel (with options) List of 2 $ fig.cap: chr "My Caption" $ fig.env: chr "figure" cropping journal_files/figure-latex/myLabel-1.pdf PDFCROP 1.38, 2012/11/02 - Copyright (c) 2002-2012 by Heiko Oberdiek.
Like me /
- find out what exactly is happening (debug log?), as soon as I click "Knit PDF" and get to TeX (the "R Markdown" output window does not show errors and even echo files [missing] captions!),
- or, better yet, did anyone have this problem and know what is wrong with RStudio, knitr and pandoc?
rstudio knitr r-markdown pandoc
fnl
source share