Liking cljdoc? Tell your friends :D

sicmutils.expression.render

Functions and utilities for rendering symbolic expressions to various backends like LaTeX, infix or Javascript.

Functions and utilities for rendering symbolic expressions to various backends
like LaTeX, infix or Javascript.
raw docstring

*TeX-sans-serif-symbols*clj/s

If true, ->TeX will render symbols with more than 1 character using a sans-serif typestyle via \mathsf. Defaults to true.

If true, [[->TeX]] will render symbols with more than 1 character
using a sans-serif typestyle via `\mathsf`. Defaults to true.
sourceraw docstring

*TeX-vertical-down-tuples*clj/s

If true, ->TeX will render down tuples as vertical matrices with square braces. Defaults to false.

If true, [[->TeX]] will render down tuples as vertical matrices
with square braces. Defaults to false.
sourceraw docstring

->infixclj/s

Converts an S-expression to printable infix form. Numeric exponents are written as superscripts. Partial derivatives get subscripts.

Converts an S-expression to printable infix form. Numeric exponents
are written as superscripts. Partial derivatives get subscripts.
sourceraw docstring

->JavaScriptclj/s

Convert the given expression to a string representation of a JavaScript function.

Parameters to the function will be extracted from the symbols in the expression. Common subexpression elimination will be performed and auxiliary variables will be bound in the body of the function; the names of these symbols are obtained from the nullary function option :symbol-generator, which defaults to a function yielding _1, ....

If :parameter-order is specified, it is used to determine function parameter order in one of two ways:

If it is set to a function, that function will be called on the sequence of parameters and is expected to return the parameters in the desired sequence.

Otherwise, it is interpreted as the sequence of parameters itself. If not specified, the default behavior is sort.

If :deterministic? true is supplied, the function will assign variables by sorting the string representations of each term before assignment. Otherwise, the nondeterministic order of hash maps inside this function won't guarantee a consistent variable naming convention in the returned function. For tests, set :deterministic? true.

Convert the given expression to a string representation of a
JavaScript function.

Parameters to the function will be extracted from the symbols in the expression.
Common subexpression elimination will be performed and auxiliary variables
will be bound in the body of the function; the names of these symbols are
obtained from the nullary function option :symbol-generator, which defaults to
a function yielding `_1, ...`.

If `:parameter-order` is specified, it is used to determine function parameter
order in one of two ways:

If it is set to a function, that function will be called on the sequence of
parameters and is expected to return the parameters in the desired sequence.

Otherwise, it is interpreted as the sequence of parameters itself. If not
specified, the default behavior is `sort`.

If `:deterministic? true` is supplied, the function will assign variables by
sorting the string representations of each term before assignment. Otherwise,
the nondeterministic order of hash maps inside this function won't guarantee a
consistent variable naming convention in the returned function. For tests, set
`:deterministic? true`.
sourceraw docstring

->TeXclj/s

(->TeX expr & {:keys [equation]})

Convert the given expression to TeX format, as a string.

If you set the :equation keyword argument to a truthy value, the result will be wrapped in an equation environment. :equation <string> will insert a \label{<string>} entry inside the equation environment.

For example:

(let [expr (+ 'x 'xy)]
  (println
    (->TeX expr :equation "label!")))

\begin{equation}
\label{label!}
x + y
\end{equation}
Convert the given expression to TeX format, as a string.

If you set the `:equation` keyword argument to a truthy value, the result will
be wrapped in an equation environment. `:equation <string>` will insert a
`\label{<string>}` entry inside the equation environment.

For example:

```clojure
(let [expr (+ 'x 'xy)]
  (println
    (->TeX expr :equation "label!")))

\begin{equation}
\label{label!}
x + y
\end{equation}
```
sourceraw docstring

infix-sym->unicodeclj/s

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close