ToLatex

it.grypho.scala.leonardo.latex.ToLatex
object ToLatex

Renders an expression as LaTeX source (issue F_0016).

A second renderer, not a replacement. toString emits the input grammar and must keep doing so — it is what :save writes and what the round-trip invariant re-parses. LaTeX is display only, and the arrow runs one way: nothing ever reads this back.

Why the package sits here. A renderer that must match on scalar.Sin and matrix._Matrix cannot live in core, which depends on no domain; it sits above every package, exactly as parser does. toString is no counterexample — it is an override on each node, not a function anywhere.

Coverage is a curated set plus a fallback (F_0016 Decision 2): a node without a rule renders through ToLatex.fallback as \mathrm{…} of its toStringcorrect and plain rather than wrong — which is what lets the emitter improve node by node without ever being half-broken. Step 1 covers the scalar operator core; matrices, binders and the named-function macros are steps 2–4.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ToLatex.type

Members list

Value members

Concrete methods

def apply(e: _Expression): String

Renders an expression as LaTeX.

Renders an expression as LaTeX.

Value parameters

e

the expression

Attributes

Returns

LaTeX source with no surrounding math delimiters — the caller chooses between $…$, \[…\] or a renderer's own API