mathml: MathML output

View source: R/mathml.R

mathmlR Documentation

MathML output

Description

MathML output

Usage

mathml(
  term = quote((a + b)^2L == a^2L + 2L * a * b + b^2L),
  flags = NULL,
  env = globalenv()
)

Arguments

term

an R call or symbol/number. This function translates term into a MathML string.

flags

(default NULL) list of flags that control the translation. This includes "context" settings such as error("ignore"), or a default number of decimal places for numeric output.

env

(default globalenv()) The R environment in which r_eval is being executed.

Details

In some functions, the Prolog code may ring back R, for example, to find the names of function arguments. For example (see vignette), when rendering the call integrate(g, lower=0L, upper=Inf) as Int_0^Inf g(x) dx, Prolog needs to know that the function g is a function of x. The Prolog rule then searches for the formalArgs of g in the environment env.

Value

A string with the MathML representation of term.

See Also

mathjax()

Examples

mathml(term=quote((a + b)^2L == a^2L + 2L*a*b + b^2L))
mathml(term=3.14159265, flags=list(round=3L))
mathml(term=3.14159265, flags=list(quote(round(3L))))


mathml documentation built on June 8, 2025, 11:12 a.m.