2

I am sucessfully compiling my .rmd-file into html or pdf_documents with the global option of dev='tikz'. Unfortunately the resulting .tikz-files have a latex-body around them, which prevents me from including them as child documents in lyx.

TheTikZDevice-Manual seems to indicate, that the standAlone-option is responsible for this.

Is it possible to control this option (globally) from within RMarkdown or will I have to resort to calling tikz directly in each code chunk?

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
stats-hb
  • 958
  • 13
  • 31
  • Do I understand you correctly that the only reason you use the RMD file is to generate the TIKZ figures? You are not interested in the document itself? – CL. Jul 28 '16 at 09:08
  • Kind of. I use the RMD file to develop the plots (and share it with others along the way). But when it's done I would like to change the 'dev'-option and generate tikz-files ready to be sourced into my final documentation (latex/ lyx). (This way, I would have a computable script and everything is in one place only (compared to copying the commands to another RNW file or so)) – stats-hb Jul 29 '16 at 09:17
  • Can you add a reproducible example of how you produce RMD files that can be compiled to HTML containing tikZ graphics? Doesn't work for me … However, what about setting [`self_contained: false`](http://rmarkdown.rstudio.com/html_document_format.html#document_dependencies)? The tikZ figures should be rendered to PDF and if these PDFs are not deleted afterwards, you can embed them in the other document. – CL. Jul 29 '16 at 16:06

0 Answers0