Changelog
0.86.0 2022-12-02
import 'https://unpkg.com/@cortex-js/compute-engine@latest/dist/compute-engine.min.esm.js';
or
import { ComputeEngine } from 'https://unpkg.com/@cortex-js/compute-engine@latest/dist/compute-engine.min.esm.js';
to create custom Compute Engine instances, which can then be associated with a
mathfield using mf.setOptions({computeEngine: ce})
or mf.computeEngine = ce
.
If the Compute Engine library is not loaded, some functionality of the mathfield
will not be available: mf.expression
will always return null
and cannot be
used to change the content of the mathfield, and math-json
is not available as
a format on the clipboard,
\left...\right
command was
incorrect."placeholder-change"
event was not dispatched.Changelog
0.85.0 2022-11-15
\mathtip{math}{tip}
and \texttip{math}{tip}
commands.
These commands are also supported by MathJax.options.enablePopover
option which can be set to false
to prevent
the auto-complete popover from being displayed.\error{}
command which displays its content with a red underline.mf.computeEngine = ce
. If none is provided, a default Compute Engine
instance is created when necessary. Setting the property to null
will
prevent the Compute Engine from being used, but the MathJSON format will not
be available.Audio
element, but browsers have limitations to the number
of Audio
elements which can be instantiated in a page at a time, and this
limit is reached surprisingly quickly wiht multiple mathfields on a page.window.mathlive
global is now globalThis[Symbol.for("mathlive")]
. This
is mostly used internally for coordination between mathfields in the same
context but it also includes the version
property which may be of use for
debugging or to report issues.<math-field>
did not inherit the options from their parent container.Changelog
0.84.0 2022-10-19
renderMathInElement
or renderMathInDocument
to render math
content, the math content can now be provided as MathJSON in addition to LaTeX
by using a <script>
tag with a type of math/json
.<script type="math/json">
["Cos", ["Divide", "Pi", 7]]
</script>
MathfieldElement
now has a setter for expression
, which allows to set
the value of a mathfield to a MathJSON expression.null
as a value for fontsDirectory
and soundDirectory
to prevent
any attempt to resolve these values.Changelog
0.83.0 2022-10-02
When navigating with the keyboard from a numerator to a denominator (or any above/below branch), determine the new position of the caret visually, rather than by its index in the subexpression. Contributed by @manstie
Commands and key bindings to manipulate array/matrix:
| Key Binding | Command |
| :--------------------------------------------------------------------- | :---------------- |
| <kbd>ctrl/⌘</kbd>+<kbd>;</kbd><br/><kbd>ctrl/⌘</kbd>+<kbd>RETURN</kbd> | addRowAfter
|
| <kbd>ctrl/⌘</kbd>+<kbd>shift</kbd>+<kbd>;</kbd> | addRowBefore
|
| <kbd>ctrl/⌘</kbd>+<kbd>,</kbd> | addColumnAfter
|
| <kbd>ctrl/⌘</kbd>+<kbd>shift</kbd>+<kbd>,</kbd> | addColumnBefore
|
| <kbd>ctrl/⌘</kbd>+<kbd>BACKSPACE</kbd> | removeRow
|
| <kbd>shift</kbd>+<kbd>BACKSPACE</kbd> | removeColumn
|
Contributed by @manstie
Updated to Compute Engine 0.8
matrix
, aligned
, etc)
would not be displayed.Changelog
0.81.0 2022-09-28
placeholders
property on MathfieldElement
to get access to the
"fill-in-the-blank" mathfields, i.e.
<math-field readonly>f(x)=\placeholder[var1]{x}</math-field>
\sum
). Smart
superscript moves immediately out of the superscript if the input is a single
digit. Works well for, e.g. x^2
but is less desirable with \sum
.Changelog
0.80.0 2022-09-27
readonly
or disabled
attribute of a mathfield,
hide the virtual keyboard if the mathfield had the focus.Enter
into
the mathfield.input
event was dispatched when the value of the mathfield was
changed programatically.convertLatexToMarkup()
usable from Node.js\pu{123 kJ//mol}
.\pu{123 J*s}
.makeSharedVirtualKeyboard()
, listen for the
virtual-keyboard-toggle
on the object returned by
makeSharedVirtualKeyboard()
:const k = makeSharedVirtualKeyboard();
k.addEventListener('virtual-keyboard-toggle', (ev) =>
console.log('toggling ', ev)
);
math-mode
event is now cancelable (by calling .preventDefault()
on the
event). This can be used for example to turn off the ability to switch to the
LaTeX editing mode:// Prevent change to LaTeX (or text) mode
mf.addEventListener('mode-change', (ev) => ev.preventDefault(), {
capture: true,
});
plonk
was added. It plays a sound indicating an error, and can
associated with a keybinding, or triggered with mf.executeCommand()
.mf.offsetFromPoint()
.\mathchoice
command.\kern
, \mkern
and \mspace
command.Changelog
0.79.0 2022-09-06
onMulticharSymbol
handler has been renamed to onInlineShortcut
modelHooks
have been removed. Use the corresponding events
instead: move-out
, focus-out
, announce
.onModeChange
, onReadAloudStatusChange
, onBlur
, onFocus
,
onContentWillChange
, onContentDidChange
, onSelectionDidChange
,
onUndoStateWillChange
, onUndoStateDidChange
and onCommit
deprecated
listeners have been removed. Used the corresponding events mode-change
,
read-aloud-status-change
, blur
, focus
, beforeinput
, input
,
selection-change
, undo-state-change
and change
.onKeystroke
handler has been removed. Instead use
mf.addEventListener("keydown",...)
alpha2
-> \alpha_{2}
\;
) are now clickable and selectablefractionNavigationOrder
mode is denominator-numerator
.\mathcolor
would be serialized. The correct command is \textcolor
which despite its
name is also applicable in math mode.Changelog
0.78.2 2022-08-18
\brace
and \brack
. These
commands are provided for improved compatibility with existing LaTeX content,
but in general infix commands are not recommended to create new content.#1583 Changing the focus programatically could result in subsequent keyboard input being incorrect
#1581 Added padding to labels below and above extensible arrows (e.g.
\xrightarrow
)
The \ce
command would not render chemical equations (regression).