Skip to content

Commit e7c9a47

Browse files
committed
\var and \simplify get braces around the produced TeX
so that things like negative numbers are treated as a single block, instead of being split up.
1 parent b586e8a commit e7c9a47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

themes/default/files/scripts/standalone_scripts/numbas-mathjax.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
const {scope} = parser.configuration.packageData.get('numbas');
3333

3434
const tok = jme.evaluate(expr, scope);
35-
const tex = jme.display.texify({tok}, settings, scope);
35+
const tex = '{' + jme.display.texify({tok}, settings, scope) + '}';
3636
const mml = new MathJax._.input.tex.TexParser.default(tex, parser.stack.env, parser.configuration).mml();
3737

3838
parser.Push(mml);
@@ -58,7 +58,7 @@
5858
const {scope} = parser.configuration.packageData.get('numbas');
5959

6060
const subbed_tree = jme.display.subvars(expr, scope);
61-
const tex = jme.display.treeToLaTeX(subbed_tree, ruleset, scope);
61+
const tex = '{' + jme.display.treeToLaTeX(subbed_tree, ruleset, scope) + '}';
6262
const mml = new MathJax._.input.tex.TexParser.default(tex, parser.stack.env, parser.configuration).mml();
6363

6464
parser.Push(mml);

0 commit comments

Comments
 (0)