eqn2svg: Convert a LaTeX math formula to an SVG object

Description Usage Arguments Value Examples

View source: R/eqn2svg.R

Description

This function converts a LaTeX math formula to an SVG object. All text in the resulting SVG is in the form of SVG <path>s. The single-length vector is a standalone <svg> tag with the following attributes in place:

Usage

1
eqn2svg(eqn, preview = TRUE)

Arguments

eqn

The LaTeX equation text.

preview

Should a preview of the formula be shown? By default this is TRUE.

Value

A length 1 character vector containing <SVG> tag text.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Take LaTeX code for the Heaviside
# Function and convert that to SVG
heaviside <-
  eqn2svg(
    eqn = l_time_domain[25],
    preview = FALSE
  )

# Take LaTeX code for the Laplace
# transform of that function and
# obtain an SVG
heaviside_laplace <-
  eqn2svg(
    eqn = l_laplace_s_domain[25],
    preview = FALSE
  )

eqn2svg documentation built on Oct. 6, 2019, 5:04 p.m.