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 error "KaTeX parse error: Invalid size" occurred when using \\ [
#3745
Comments
That is not a bug. KaTeX is acting in precisely the same way that LaTeX acts with this input. When you write There are many work arounds. For instance
|
Thank you for replying. |
@ronkok I thought the same, but then I tested the following in LaTeX: \begin{align*}
a+b=c \\
[f(x)]^2
\end{align*} In fact, In fact, the following KaTeX code seems to be trying to implement exactly this: KaTeX/src/environments/array.js Lines 221 to 223 in 2c13d26
In fact, the above example works in KaTeX! What doesn't work is It looks like the culprit is |
\\[
\\ [
Fix `src/functions/cr.js`'s definition of `\\` to manually look for an optional argument via `future()` instead of `numOptionalArgs`, so that it does *not* skip over spaces. This matches the existing behavior of `\\` in `src/environments/array.js` and AMSMath's behavior of `\math@cr` via `\new@ifnextchar`. Fixes #3745
Fix `src/functions/cr.js`'s definition of `\\` to manually look for an optional argument via `future()` instead of `numOptionalArgs`, so that it does *not* skip over spaces. This matches the existing behavior of `\\` in `src/environments/array.js` and AMSMath's behavior of `\math@cr` via `\new@ifnextchar`. Fixes #3745 Co-authored-by: Ron Kok <ronkok@comcast.net>
Resolved via PR #3746. |
🎉 This issue has been resolved in version 0.16.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug:
When using
\\[
such as:The error
KaTeX parse error: Invalid size: 'f(x)' at position 9: a+b=c\\ [̲f̲(̲x̲)̲]̲^2
occurred.To Reproduce:
Can be reproduced at https://katex.org/.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: