Skip to content

Commit f17b488

Browse files
committed
escape underscores in \texttt for long names
MathJax 4 seems to apply math-mode rules to underscores in \texttt, so we now need to escape them to produce literal underscores
1 parent e7c9a47 commit f17b488

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/scripts/jme-display.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ Texifier.prototype = {
15811581
var name = tok.nameWithoutAnnotation;
15821582
var annotations = tok.annotation;
15831583
longNameMacro = longNameMacro || (function(name) {
1584-
return '\\texttt{' + name + '}';
1584+
return '\\texttt{' + name.replaceAll('_', '\\_') + '}';
15851585
});
15861586
/** Apply annotations to the given name.
15871587
*

0 commit comments

Comments
 (0)