-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The option 'family' for tex2svg / tex2chtml has no default value #2512
Comments
Ok, this is caused by the addition of the <script>
MathJax = {
startup: {
ready() {
const {HTMLDocument} = MathJax._.handlers.html.HTMLDocument;
const {userOptions} = MathJax._.util.Options;
const {STATE} = MathJax._.core.MathItem;
HTMLDocument.prototype.convert = function (math, options = {}) {
let {family, format, display, end, ex, em, containerWidth, lineWidth, scale} = userOptions({
family: '', format: this.inputJax[0].name, display: true, end: STATE.LAST,
em: 16, ex: 8, containerWidth: null, lineWidth: 1000000, scale: 1
}, options);
if (containerWidth === null) {
containerWidth = 80 * ex;
}
const jax = this.inputJax.reduce((jax, ijax) => (ijax.name === format ? ijax : jax), null);
const mitem = new this.options.MathItem(math, jax, display);
if (this.outputJax.options.mtextInheritFont) {
mitem.outputData.mtextFamily = family;
}
if (this.outputJax.options.merrorInheritFont) {
mitem.outputData.merrorFamily = family;
}
mitem.start.node = this.adaptor.body(this.document);
mitem.setMetrics(em, ex, containerWidth, lineWidth, scale);
mitem.convert(this, end);
return (mitem.typesetRoot || mitem.root);
};
MathJax.startup.defaultReady();
}
}
};
</script> It is longer than I would like, but you have to replace the entire |
Update convert() to accept 'family' parameter (mathjax/MathJax#2512)
When will this fix be released? |
We are hoping to get a release out later this week. |
I use
MathJax.getMetricsFor
to get an options object fortex2chtml
ortex2svg
, as described in the typesetting page in the docs.It includes an attribute
family
whose value is the empty string. When I pass the object totex2chtml
, I get an error "Invalid option "family" (no default exists)". So it looks easy to fix, but I don't know where to look for the default values.Here's a node script which produces the error:
(I'd love to fix this myself, but I can't remember how to run unminified MathJax v3)
The text was updated successfully, but these errors were encountered: