texToPng: Convert LaTeX to a png file

Description Usage Arguments Value Examples

View source: R/plot.R

Description

Convert LaTeX to a png file

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
texToPng(
  tex,
  width = NULL,
  height = NULL,
  dpi = 72,
  viewPng = FALSE,
  fontsize = 12,
  calcM = FALSE,
  crop = FALSE
)

Arguments

tex

TeX string. Remember to escape backslash with \.

width

Width of the png.

height

Height of the png (width are ignored).

dpi

Dpi of the png. Not used if width or height are specified.

viewPng

View the result in the plots window.

fontsize

Front size used in the LaTeX document.

calcM

Estimate 1 em in pixels in the resulting png.

crop

Call pdfcrop.

Value

The filename of the png or a list if calcM = TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
tex <- "$\\mathbb{R}_{\\geqq}$"
texToPng(tex, viewPng = TRUE)
texToPng(tex, fontsize = 20, viewPng = TRUE)
texToPng(tex, height = 50, fontsize = 10, viewPng = TRUE)
texToPng(tex, height = 50, fontsize = 50, viewPng = TRUE)
tex <- "MMM"
texToPng(tex, dpi=72, calcM = TRUE)
texToPng(tex, width = 100, calcM = TRUE)
f <- texToPng(tex, dpi=300)
pngSize(f)

## End(Not run)

gMOIP documentation built on Aug. 23, 2021, 5:09 p.m.