-
-
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
[v4 beta 6] overline + prime causing unexpected "double exponent" error #3234
Labels
Accepted
Issue has been reproduced by MathJax team
Code Example
Contains an illustrative code example, solution, or work-around
Merged
Merged into develop branch
Test Needed
v4
Comments
This is due to the changes from mathjax/MathJax-src/pull/1069, which left out a check after like Here is a configuration that can be used to add that in: MathJax = {
tex: {packages: {'[+]': ['fix-primes']}},
startup: {
ready() {
const {MacroMap} = MathJax._.input.tex.TokenMap;
const {Configuration} = MathJax._.input.tex.Configuration;
const NodeUtil = MathJax._.input.tex.NodeUtil.default;
const {entities} = MathJax._.util.Entities;
new MacroMap('fix-primes', {
'\'': 'Prime',
'\u2019': 'Prime',
'\u2032': 'Prime'
}, {
Prime(parser, c) {
let base = parser.stack.Prev();
if (!base) {
base = parser.create('token', 'mi');
}
if ((NodeUtil.isType(base, 'msubsup') && !NodeUtil.isType(base, 'msup') &&
NodeUtil.getChildAt(base, base.sup)) ||
(NodeUtil.isType(base, 'munderover') && !NodeUtil.isType(base, 'mover') &&
NodeUtil.getChildAt(base, base.over) &&
!NodeUtil.getProperty(base, 'subsupOK'))) {
throw new TexError('DoubleExponentPrime', 'Prime causes double exponent: use braces to clarify');
}
let sup = '';
parser.i--;
do {
sup += entities.prime; parser.i++, c = parser.GetNext();
} while (c === '\'' || c === entities.rsquo || c === entities.prime);
sup = ['', '\u2032', '\u2033', '\u2034', '\u2057'][sup.length] || sup;
const node = parser.create('token', 'mo', {variantForm: true}, sup);
parser.Push(parser.itemFactory.create('prime', base, node));
}
});
Configuration.create('fix-primes', {
handler: {character: ['fix-primes']}
});
MathJax.startup.defaultReady();
}
}
}; I will make a PR to add the missing check. |
dpvc
added
the
Code Example
Contains an illustrative code example, solution, or work-around
label
May 24, 2024
dpvc
added a commit
to mathjax/MathJax-src
that referenced
this issue
May 24, 2024
dpvc
added a commit
to mathjax/MathJax-src
that referenced
this issue
Jun 5, 2024
dpvc
added a commit
to mathjax/MathJax-src
that referenced
this issue
Jun 11, 2024
Fix regression from #1069 (mathjax/MathJax#3233, mathjax/MathJax#3234)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Accepted
Issue has been reproduced by MathJax team
Code Example
Contains an illustrative code example, solution, or work-around
Merged
Merged into develop branch
Test Needed
v4
Our testing ran into a lot of unexpected
Prime causes double exponent: use braces to clarify
processing errors after upgrading.It seems to always come down to overline and primes, e.g.,
\overline{\mathfrak{D}}'_j
\overline{c}''=\overline{n}
\begin{equation*} \|\overline{c}'\|_{\infty }\leqslant \|\overline{n}\|_{1}= \|n\|_{1}. \end{equation*}
The text was updated successfully, but these errors were encountered: