latexify() returns the LaTeX code of an equation, a list of equations or
the equations of a system, as the Latexify recipes of ModelingToolkit:
one equation is lhs = rhs, several are an align environment with one
lhs &= rhs row each. Other objects are passed to symcompR::latex().
Examples
t <- t_nounits; D <- D_nounits
x <- Variable("x", t); k <- Parameter("k")
latexify(D(x) ~ -k * x)
#> [1] "\\frac{d}{d t} x{\\left(t \\right)} = - k x{\\left(t \\right)}"
cat(latexify(System(list(D(x) ~ -k * x), t, name = "s")))
#> \begin{align}
#> \frac{d}{d t} x{\left(t \right)} &= - k x{\left(t \right)}
#> \end{align}