Skip to contents

Adds a LaTeX mathematical expression to the scene. Requires LaTeX to be installed on the system.

Usage

add_latex(
  scene,
  latex,
  position = c(0, 0, 0),
  size = 1,
  color = "#FFFFFF",
  opacity = 1
)

Arguments

scene

A Scene object

latex

LaTeX string (without $ delimiters)

position

Position as c(x, y) or c(x, y, z)

size

Size multiplier

color

Text color

opacity

Opacity (0 to 1)

Value

The Scene object (invisibly) for piping

Examples

if (FALSE) { # \dontrun{
scene("latex_demo") %>%
  add_latex("E = mc^2") %>%
  write_in() %>%
  pause(1) %>%
  add_latex("\\int_0^\\infty e^{-x^2} dx = \\frac{\\sqrt{\\pi}}{2}",
            position = c(0, -2, 0)) %>%
  write_in() %>%
  render()
} # }