if (FALSE) {
## some simple LaTeX
tex <- c("This is \\textbf{bold} and this \\textit{italic}.",
"Points on the unit circle: $x^2 + y^2 = 1$.")
## default settings: PNG with sans serif fonts
tex2image(tex, show = interactive())
## with fixed widths
tex2image(tex, width = 6, show = interactive())
tex2image(tex, width = 2, show = interactive())
## switch off header (-> LaTeX uses its standard serif fonts)
tex2image(tex, header = NULL, show = interactive())
## SVG output (system requirements: pdfcrop & pdf2svg)
tex2image(tex, format = "svg", show = TRUE)
}
Run the code above in your browser using DataLab