transform_mathjax: 'MathJax' equation as 'HTML' or 'MathML'.

View source: R/write_mathjax.R

transform_mathjaxR Documentation

'MathJax' equation as 'HTML' or 'MathML'.

Description

Get 'HTML' or 'MathML' XML codes corresponding to the rendering of 'MathJax' equations.

Usage

transform_mathjax(x, to = "html")

Arguments

x

MathJax equations

to

output format, one of 'html' or 'mml'

Value

a character vector that contains 'html' or 'mml' codes corresponding to the equations.

Examples

x <- c("(ax^2 + bx + c = 0)",
       "x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.")
z <- transform_mathjax(x = x, to = "html")
cat(z, sep = "\n\n")
z <- transform_mathjax(x = x, to = "mml")
cat(z, sep = "\n\n")

equatags documentation built on June 14, 2022, 1:05 a.m.