You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use rmarkdown::latex_document() to generate a .tex-file and figures, that can then be converted to PDF using latexmk. I have a rather long table, which only renders correctly if I create my PDF using latexmk, since tinytex::latexmk()'s emulated version seems to run xelatex too few times. I found, the global option to make that possible, options(tinytex.latexmk.emulation = FALSE), and that correctly renders the PDF. However, since bookdown deletes all of the intermediate files generated by latexmk, the PDF often takes unnecessarily long to build. For this reason, I would like to just get the .tex-file and figures, and then automate PDF-generation via a Makefile. This is, however, not possible since the figures are not generated when using rmarkdown::latex_document(), even though it is a documented possibility.
This small example illustrates the issue. When I use the Build command in RStudio, this runs rmarkdown::render_site(encoding = 'UTF-8') and produces the .tex-file, but the corresponding figure is not created.
> devtools::session_info('bookdown')
Session info ---------------------------------------------------------------------------------------------------------------
setting value
version R version 3.4.4 (2018-03-15)
system x86_64, linux-gnu
ui RStudio (1.1.453)
language en_US:en
collate en_US.UTF-8
tz Europe/Copenhagen
date 2018-05-24
Packages -------------------------------------------------------------------------------------------------------------------
package * version date source
backports 1.1.2 2017-12-13 CRAN (R 3.4.4)
base64enc 0.1-3 2015-07-28 CRAN (R 3.4.4)
bookdown 0.7.10 2018-05-18 local
digest 0.6.15 2018-01-28 CRAN (R 3.4.4)
evaluate 0.10.1 2017-06-24 CRAN (R 3.4.4)
glue 1.2.0 2017-10-29 CRAN (R 3.4.4)
graphics * 3.4.4 2018-03-16 local
grDevices * 3.4.4 2018-03-16 local
highr 0.6 2016-05-09 CRAN (R 3.4.4)
htmltools 0.3.6 2017-04-28 CRAN (R 3.4.4)
jsonlite 1.5 2017-06-01 CRAN (R 3.4.4)
knitr 1.20 2018-02-20 CRAN (R 3.4.4)
magrittr 1.5 2014-11-22 CRAN (R 3.4.4)
markdown 0.8 2017-04-20 CRAN (R 3.4.4)
methods * 3.4.4 2018-03-16 local
mime 0.5 2016-07-07 CRAN (R 3.4.4)
Rcpp 0.12.17 2018-05-18 CRAN (R 3.4.4)
rmarkdown 1.9 2018-03-01 CRAN (R 3.4.4)
rprojroot 1.3-2 2018-01-03 CRAN (R 3.4.4)
stats * 3.4.4 2018-03-16 local
stringi 1.2.2 2018-05-02 CRAN (R 3.4.4)
stringr 1.3.1 2018-05-10 CRAN (R 3.4.4)
tinytex 0.5.4 2018-05-17 Github (yihui/tinytex@f9aba40)
tools 3.4.4 2018-03-16 local
utils * 3.4.4 2018-03-16 local
xfun 0.1 2018-01-22 CRAN (R 3.4.4)
yaml 2.1.19 2018-05-01 CRAN (R 3.4.4)
> rmarkdown::pandoc_version()
[1] ‘1.19.2.1’
> system('pdflatex --version')
pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018)
kpathsea version 6.3.0
Copyright 2018 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.34; using libpng 1.6.34
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.00
The text was updated successfully, but these errors were encountered:
options(tinytex.clean = FALSE) effectively solved my problem, so thank you for that solution.
I tested the updated version of rmarkdown, and the figure is saved now, but it seems that the pdf device for some reason doesn't capture all elements of the plot. I have attached the PDF-output I get here. unnamed-chunk-1-1.pdf
yihui
added a commit
to RLesur/rmarkdown
that referenced
this issue
Apr 1, 2019
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
I would like to use
rmarkdown::latex_document()
to generate a .tex-file and figures, that can then be converted to PDF usinglatexmk
. I have a rather long table, which only renders correctly if I create my PDF usinglatexmk
, sincetinytex::latexmk()
's emulated version seems to run xelatex too few times. I found, the global option to make that possible,options(tinytex.latexmk.emulation = FALSE)
, and that correctly renders the PDF. However, since bookdown deletes all of the intermediate files generated bylatexmk
, the PDF often takes unnecessarily long to build. For this reason, I would like to just get the .tex-file and figures, and then automate PDF-generation via a Makefile. This is, however, not possible since the figures are not generated when usingrmarkdown::latex_document()
, even though it is a documented possibility.This small example illustrates the issue. When I use the Build command in RStudio, this runs rmarkdown::render_site(encoding = 'UTF-8') and produces the .tex-file, but the corresponding figure is not created.
Info about my system:
The text was updated successfully, but these errors were encountered: