# `Expresso.Element.Math.Tex`
[🔗](https://github.com/rellen/expresso/blob/main/lib/expresso/element/math/tex.ex#L1)

Makes the MathML of formulas in LaTeX with Temml

[Temml](https://temml.org) is a library in JavaScript, so `render!/2` runs
Node with the script `priv/temml/render.mjs`, through
`Expresso.Element.Diagram.Tool`. The project holds a copy of `temml.mjs`
and its license in `priv/temml/`, so a render needs Node and no package of
npm. `EXPRESSO_NODE` gives the path of Node, as for a diagram of Mermaid.
`version/0` gives the version of the copy.

One run of Node makes the MathML of each source of a list, so a deck starts
Node one time. Temml makes a formula in display mode, and it trusts `\class`
and `\data` only, because the parts of a formula use them. It refuses each
other command that writes an attribute or reads a file, such as
`\includegraphics`. The macros `\part` and `\id` give a name to a part.
`docs/math-parts.md` gives the design.

# `result`

```elixir
@type result() :: {:ok, String.t()} | {:error, String.t()}
```

The result for one source: its MathML, or the message of Temml

# `render!`

```elixir
@spec render!([String.t()]) :: [result()]
```

Make the MathML of each source, in one run of Node

The function returns one result for each source, in the same order: the
MathML of a source that Temml reads, or the message of Temml for a source
that it cannot read. An empty list needs no Node. The function raises an
`ArgumentError` when Node is not present, and when the script fails.

# `script`

```elixir
@spec script() :: Path.t()
```

The path of the script that runs Temml

# `tool`

```elixir
@spec tool() :: Expresso.Element.Diagram.Tool.t()
```

The tool, for `Expresso.Element.Diagram.Tool`

# `version`

```elixir
@spec version() :: String.t()
```

The version of the copy of Temml

---

*Consult [api-reference.md](api-reference.md) for complete listing*
