tth: R Interface to the tth/ttm TeX to HTML Converter

Description Usage Arguments Details Value References Examples

Description

Convert TeX or LaTeX markup to HTML or HTML+MathML. Works for snippets as well as complete documents.

Usage

1
2
3
4
5
6
tth(x, ..., fixup = TRUE, Sweave = TRUE)
ttm(x, ..., fixup = TRUE, Sweave = TRUE)

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)

Arguments

x

character vector of (La)TeX code.

fixup

logical. Should the resulting code be fixed up by deleting blank or empty lines and by replacing certain math symbols (such as not lower/greater etc.)?

Sweave

logical. Should the Sweave code environments Sinput/Soutput be replaced by verabtim (and Schunk deleted) prior to conversion with tth/ttm?

...

arguments passed to tth.control.

a

logical. Enable automatic calls of LaTeX? If no aux file exists, attempt to call. picture environment conversion using latex2gif. Default omit.

c

logical. Prefix header "Content-type: text/HTML" (for direct web serving)?

d

logical. Disable definitions with delimited arguments? Default enable.

e

numeric specifying epsfbox handling: 0 no conversion, just ref. 1 convert to png/gif using user-supplied ps2png/gif. 2 (default) convert and include inline.

f

numeric specifying limit for built-up fraction nesting in display equations to 0 to 9. Default is 5. For tth only.

g

logical. Remove (instead of guessing intent of) font commands. Default guess font/size.

i

logical. Use italic font for equations (like TeX)? Default roman. For tth only.

j

numeric specifying index page length. Default is 20 lines.

L

logical. Should LaTeX commands (e.g., frac) be enabled without a docmentclass line?

n

numeric HTML title format control: 0 raw, 1 expand macros, 2 expand equations.

p

character specifying additional directories (paths) to search for input files.

r

logical. Raw HTML output (omit header and tail) for inclusion in other files?

t

logical. Display built-up items in textstyle equations? Default is inline. For tth only.

u

logical. Use unicode character encoding? Default is ISO-8859-1 (latin1).

w

numeric specifying HTML writing style. Default is no head/body tags, 0 no title, 1 single title only, head/body tags. 2 XHTML. For tth only.

y

numeric specifying equation style:1 compress vertically, 2 inline overaccents.

xmakeindxcmd

character specifying command for making index. Default is makeindex.

v

logical or numeric. Give verbose commentary? Verbosity level can also be 0 (none, same as FALSE), 1 (same as TRUE), 2 (even higher verbosity for debugging).

Details

tth and ttm are simple R wrapper functions, calling C functions 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 C functions 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).

Value

tth/ttm return a character vector with HTML code. tth.control returns a character vector with collapsed (non-default) control arguments.

References

Hutchinson IH (2012). TTH: The TeX to HTML Translator, Version 0.43. http://hutchinson.belmont.ma.us/tth/

Examples

1
2
3
4
tex <- c("This is \\textbf{bold} and this \\textit{italic}.",
  "Points on the unit circle: $x^2 + y^2 = 1$.")
tth(tex)
ttm(tex)


Search within the htmltools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.