-
-
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
\def commands containing numbers #2901
Comments
Note that TeX control sequences can't contain numbers, so what you are actually doing is defining |
I have submitted a pull request that resolves the problem, and it should be in the next release. In the meantime, you can use the configuration MathJax = {
startup: {
ready() {
const TexError = MathJax._.input.tex.TexError.default;
const ParseUtil = MathJax._.input.tex.ParseUtil.default;
const NewcommandUtil = MathJax._.input.tex.newcommand.NewcommandUtil.default;
const NewcommandMethods = MathJax._.input.tex.newcommand.NewcommandMethods.default;
const MacroWithTemplate = NewcommandMethods.MacroWithTemplate;
NewcommandMethods.MacroWithTemplate = function (parser, name, text, n, ...params) {
const argCount = parseInt(n);
if (argcount || !params.length) {
MacroWithTemplate(parser, name, text, n, ...params);
} else {
parser.GetNext();
if (params[0] && !NewcommandUtil.MatchParam(parser, params[0])) {
throw new TexError('MismatchUseDef', 'Use of %1 doesn\'t match its definition', name);
}
parser.string = ParseUtil.addArgs(parser, text, parser.string.slice(parser.i));
parser.i = 0;
ParseUtil.checkMaxMacros(parser);
}
}
MathJax.startup.defaultReady();
}
}
}; to work around the problem. |
Fix handling of template macros with no actual arguments. (mathjax/MathJax#2901)
Issue Summary
The error occurs when using
\def
to define a command containing numbers, for exampleSteps to Reproduce:
In MathJax:

In LaTeX :

Technical details:
The text was updated successfully, but these errors were encountered: