compile_tikzpicture: Wraps and compiles a tikzpicture

View source: R/tikzsave.R

compile_tikzpictureR Documentation

Wraps and compiles a tikzpicture

Description

Takes the output of tikzDevice::tikz with standalone = FALSE, wraps into a latex document and then compiles using latexmk, cleaning up as it goes.

Usage

compile_tikzpicture(
  filename,
  packages = NULL,
  pre_begin_document = NULL,
  recompile = TRUE,
  create_png = FALSE
)

Arguments

filename

Character. Filename of a tikzpicture in .tex file

packages

Vector of strings. If no ⁠\⁠ is detected, then this is assumed to be an absolute file paths to a .sty file to include in preamble. Default is my paper.sty and math.sty in inst/tikzsave.

pre_begin_document

Verbatim text to include right before ⁠\begin{document}⁠

recompile

Logical. If FALSE, does not update if pdf date is newer than the tex date.

create_png

Logical. If true, will also output a png in addition to the pdf.

Value

Invisibly returns TRUE if compilation succeeds.


kylebutts/kfbmisc documentation built on April 17, 2025, 5:20 p.m.