tth(x, ..., fixup = TRUE, Sweave = TRUE, mode = NULL)
ttm(x, ..., fixup = TRUE, Sweave = TRUE, mode = NULL)
tth.control(a = FALSE, c = FALSE, d = FALSE, e = 2, f = NULL, g = FALSE, i = FALSE, j = NULL, L = TRUE, n = NULL, p = NULL, r = TRUE, t = FALSE, u = FALSE, w = NULL, y = 2, xmakeindxcmd = NULL, v = FALSE)
tth
/ttm
?"hex"
, "dec"
, or "named"
,
the corresponding mode is enforced for all character entity references. See also the details.tth.control
.latex2gif
? Default omit."Content-type: text/HTML"
(for direct web serving)?0
no conversion, just ref.
1
convert to png/gif using user-supplied ps2png/gif.
2
(default) convert and include inline.0
to 9
. Default is 5
. For tth
only.tth
only.0
raw, 1
expand macros, 2
expand
equations.tth
only.0
no title, 1
single title only, head/body tags. 2
XHTML.
For tth
only.1
compress vertically,
2
inline overaccents.0
(none, same as FALSE
), 1
(same as TRUE
),
2
(even higher verbosity for debugging).tth
/ttm
return a character vector with HTML
code. tth.control
returns a character vector with collapsed
(non-default) control arguments. tth
and ttm
are simple R wrapper functions,
calling command line tools of the same name which either need to be
provided by the R package tth or be installed on the system (and
available in the search path). The command line tools have been
written by Hutchinson (2012) and a detailed manual is available online
at http://hutchinson.belmont.ma.us/tth/manual.cgi (which
actually produces an HTML version of the manual in real time using
tth). By default, the results of tth
and ttm
are processed further
to accomodate the Sweave
environments and fixup
certain
math symbols. Furthermore, optionally a particular mode
for character
entity references (mathematical symbols, greek letters, and other special characters)
can be enforced. For example, the greek small letter mu
can be represented in "named"
mode (&mgr;
or μ
),
in "hex"
mode (μ
) or "dec"
model (μ
).
Plain tth
employs "dec"
mode while plain ttm
employs
"named"
mode. But setting mode = "hex"
would convert all
character entity references to hex mode etc.
See http://www.w3.org/TR/xml-entity-names/bycodes.html for the list of
character entity references employed and http://dev.w3.org/html5/html-author/charref
for a somewhat nicer display.
tex <- c("This is \\textbf{bold} and this \\textit{italic}.",
"Points on the unit circle: $x^2 + y^2 = 1$.")
tth(tex)
ttm(tex)
h0 <- "$H_0: \\mu_0 = 0$"
tth(h0)
tth(h0, mode = "hex")
tth(h0, mode = "named")
ttm(h0)
ttm(h0, mode = "hex")
ttm(h0, mode = "dec")
Run the code above in your browser using DataCamp Workspace