Skip to main content

typeset

Function typeset 

Source
pub fn typeset(
    tex: &str,
    display: bool,
    size: f64,
    color: [u8; 4],
) -> Result<MathPicture, MathError>
Expand description

Typeset tex — the text between the delimiters, $…$ and $$…$$ alike stripped — as a picture.

display chooses TeX’s display style (limits above and below a \sum, a full-height fraction) over text style, the same switch $$ makes over $. size is the font size in pixels the formula is set at: an inline formula takes the size of the text around it, a display one the body size. color is the ink, as [r, g, b, a] bytes.

Whitespace either side of tex is insignificant to TeX and is trimmed, so a display block whose source keeps the formula on lines of its own reads the same as one written on the delimiters’ line.