Reagent component wrapping the math-field
web component from
the Mathlive project, along with
associated utilities.
Reagent component wrapping the `math-field` web component from the [Mathlive](https://cortexjs.io/docs/mathlive) project, along with associated utilities.
(->math-json mf)
Given
a MathfieldElement
mf
, returns a MathJSON
representation (parsed into Clojure) of the currently displayed expression.
NOTE that for this or anything MathJSON related to work you'll need
to (require '[@cortex-js/compute-engine])
. If this package isn't loaded,
returns nil
.
Given a [`MathfieldElement`](https://cortexjs.io/docs/mathlive/#(MathfieldElement%3Aclass)) `mf`, returns a [MathJSON](https://cortexjs.io/math-json/) representation (parsed into Clojure) of the currently displayed expression. NOTE that for this or anything MathJSON related to work you'll need to `(require '[@cortex-js/compute-engine])`. If this package isn't loaded, returns `nil`.
(->placeholders mf)
(->placeholders mf {:keys [type] :or {type "latex"}})
Given
a MathfieldElement
mf
, returns a map of (string) placeholder name => current value of the
placeholder.
NOTE that for {:type "math-json"}
to work you'll need to (require '[@cortex-js/compute-engine])
. If this option is specified and the package
isn't loaded, returns nil
for each placeholder value.
Given a [`MathfieldElement`](https://cortexjs.io/docs/mathlive/#(MathfieldElement%3Aclass)) `mf`, returns a map of (string) placeholder name => current value of the placeholder. NOTE that for `{:type "math-json"}` to work you'll need to `(require '[@cortex-js/compute-engine])`. If this option is specified and the package isn't loaded, returns `nil` for each placeholder value.
Location of the fonts
directory in the CDN-served package
of mathlive.
Location of the `fonts` directory in the CDN-served package of [mathlive](https://www.npmjs.com/package/mathlive).
Location of the sounds
directory in the CDN-served package
of mathlive.
Location of the `sounds` directory in the CDN-served package of [mathlive](https://www.npmjs.com/package/mathlive).
(math-json->tex expr)
Given a Clojure data structure expr
representing
a MathJSON expression, returns a string of
LaTeX representing expr
.
NOTE that for this or anything MathJSON related to work you'll need
to (require '[@cortex-js/compute-engine])
. If this package isn't loaded,
returns nil
.
Given a Clojure data structure `expr` representing a [MathJSON](https://cortexjs.io/math-json/) expression, returns a string of LaTeX representing `expr`. NOTE that for this or anything MathJSON related to work you'll need to `(require '[@cortex-js/compute-engine])`. If this package isn't loaded, returns `nil`.
Reagent component around the MathLive equation editor.
NOTE: Following React's convention, :on-change
binds a listener to to the
input
event. See https://reactjs.org/docs/dom-elements.html#onchange
Reagent component around the [MathLive](https://github.com/arnog/mathlive) equation editor. NOTE: Following React's convention, `:on-change` binds a listener to to the `input` event. See https://reactjs.org/docs/dom-elements.html#onchange
Currently loaded version of the mathlive npm package.
Currently loaded version of the [mathlive](https://www.npmjs.com/package/mathlive) npm package.
(set-math-json! mf expr)
Given
MathfieldElement
mf
andexpr
representing a MathJSON expression,sets the value of mf
to the TeX version of expr
.
Equivalent to (.setValue mf (math-json->tex expr))
.
NOTE that for this or anything MathJSON related to work you'll need
to (require '[@cortex-js/compute-engine])
. If this package isn't loaded,
this command has no effect.
Given - a [`MathfieldElement`](https://cortexjs.io/docs/mathlive/#(MathfieldElement%3Aclass)) `mf` and - a Clojure data structure `expr` representing a [MathJSON](https://cortexjs.io/math-json/) expression, sets the value of `mf` to the TeX version of `expr`. Equivalent to `(.setValue mf (math-json->tex expr))`. NOTE that for this or anything MathJSON related to work you'll need to `(require '[@cortex-js/compute-engine])`. If this package isn't loaded, this command has no effect.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close