tikz.pdf | R Documentation |
generate a PDF file from the given latex commands
tikz.pdf(file, ..., fontsize = 12, preamble = NULL)
file |
the path to the to-be-generated pdf file. |
... |
the latex commands. |
fontsize |
the fontsize in latex points. |
preambles |
the latex preambles |
the document class is "standalone", the tikz package is automatically loaded.
# 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))
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.