tikz.pdf: generate a PDF file from the given latex commands

View source: R/flowchart.R

tikz.pdfR Documentation

generate a PDF file from the given latex commands

Description

generate a PDF file from the given latex commands

Usage

tikz.pdf(file, ..., fontsize = 12, preamble = NULL)

Arguments

file

the path to the to-be-generated pdf file.

...

the latex commands.

fontsize

the fontsize in latex points.

preambles

the latex preambles

Details

the document class is "standalone", the tikz package is automatically loaded.

Examples

# an SIR model
SIR = Compartmental$new(S, I, R, title="SIR")
SIR$transition(S->I ~ beta*S*I/N, N=S+I+R, name="infection")
SIR$transition(I->R ~ gamma*I, name="recovery")
tikz.pdf("SIR.pdf", flowchart(SIR, TexFormatter$new(),
  S=Node(at=c(0,0)),
  I=Node(at=c(2,0)),
  R=Node(at=c(4,0))
))

junlingm/REpiSim documentation built on Nov. 28, 2023, 2:35 a.m.