* Apply operator spacing to Unicode ∙ ∘ ∖
* Appease Semantic Versioning.
* Fix website build issue
* Tweak docs to space final bin correctly
Co-authored-by: Erik Demaine <edemaine@mit.edu>
* feat: \nonumber and \notag support
Support `\nonumber` (and equivalent `\notag`) using a global macro
`\@eqnsw` to track whether one occurs in each row, similar to how
amsmath uses global `\@eqnswtrue`/`\@eqnswfalse`.
Fix#2950
* Remove duplicate mention of align*
* Working version of \tag within {align}
* Simpler subparse mechanism
* Fix flow errors, clarifying set-to-undefined
* Document that \tag works in rows
* Add screenshot tests
* Add Jest tests
* Add Safari screenshot
* Commit message about fixing \tag
Fixes#2379
* Apply suggestions from code review
Co-authored-by: ylemkimon <y@ylem.kim>
* Revise and move getAutoTag
* Fix handling of split
* Remove unnecessary feedTokens
Co-authored-by: ylemkimon <y@ylem.kim>
Co-authored-by: ylemkimon <y@ylem.kim>
* feat: implement \relax as no-op function
BREAKING CHANGE: `\relax` is now implemented as a function. It'll stop
expansions and parsing, so the behavior around `\relax` may change.
For example, `\kern2\relax em` will no longer work.
* Round distances to 4 places
* Revert numbers in mathMLTree.js
* Update Jest test
* fix: round dimension to 4 places via makeEm
* test: update screenshots
* docs: add link to this PR
Co-authored-by: ylemkimon <y@ylem.kim>
Close all groups after parse, in particular in case of parse error,
completing `Namespace`'s simulation of local definitions.
Fixes#3122
Co-authored-by: ylemkimon <y@ylem.kim>
* fix: \char support for >16-bit Unicode characters
`String.fromCharCode` only supports Unicode characters up to 16-bit.
`String.fromCodePoint` from ECMAScript 2015 supports all Unicode code points.
Unfortunately, IE doesn't support the latter, so use former as fallback.
Fixes#3004
Co-authored-by: ylemkimon <y@ylem.kim>
* feat: text-mode cedilla accent via \c
Add text-mode accent function `\c` and corresponding Unicode support.
Part of #638
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
* Update screenshots
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
* chore(deps): update selenium/standalone-firefox docker tag to v20210422 [skip netlify]
* test(screenshotter): update screenshots
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Young Min Kin <mail@ylem.kim>
Previously, the matrix family of environments assumed that the number of
columns was given by the number of columns in the first row. This
didn't work when there were zero rows, and it didn't handle the case
where future rows have more columns than the first (which is visible
when using an alignment other than `c`, such as `\begin{matrix*}[r]`).
Fixes#3017
Co-authored-by: ylemkimon <y@ylem.kim>
* feat: Allow text-mode accents in math mode, except in strict mode
LaTeX only issues a warning when using e.g. `\r` in math mode.
KaTeX will now do the same with the default `strict` setting of `warn`.
Fixes#2983
* Fix accent mode
Co-authored-by: ylemkimon <y@ylem.kim>
* fix#2990
fix make stretchycode to textNode bug.
* fix: fix stretchy.js@mathMLnode line too long
* chore(screenshotter): update stretchy snapshots
* fix: remove dup '\' in cdrightarrow cdleftarrow and cdlongequal
* test: add stretchy MathML builder test case
Co-authored-by: nferzhuang <nferzhuang@tencent.com>
Co-authored-by: Ron Kok <ronkok@comcast.net>
* fix: Correctly parse \ followed by whitespace
LaTeX parses `\` followed by whitespace including up to one newline
as equivalent to `\ `. (With multiple newlines, you get paragraph
breaks.)
Fix#2860.
* Improve comments
* Avoid second RegExp match in control words
* Document capturing groups
Co-authored-by: Ron Kok <ronkok@comcast.net>
Support single characters having a catcode of 13 (active) or 12 (other),
and expand a macro defined for the character only if it's active.
This enables defining `~` as a macro, but avoiding expansion in URLs.
Fix#2924
Co-authored-by: ylemkimon <y@ylem.kim>
* Combine characters together in all expressions
Call `tryCombineChars` in `buildExpression`
* update screenshots, exclude 'coverage' from lint
* update MathML snapshots
* don't combine two 'mbin's or two 'mord's
* update screenshots
* update screenshots
Co-authored-by: ylemkimon <y@ylem.kim>
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
* Support {CD}
* Edit screenshotter test to fit on one page
* Update screenshots
* Remove bogus Safari screenshot
* Edit documentation to avoid tag conflicts and explain delimiters
* Add type annotations
* Add bogus safari screenshot
* Update with real Safari screenshot
* Set label vertical alignment
* Revise call to parseExpression() per PR 2085 changes to macro parsing
* Update Firefox screenshot
* Pick up review comments
* Add unit tests and snapshot.
* Tighten up label collection.
* Better loop index
* remove extra space
* Picked up comments. Added a parse check. Added a test.
Co-authored-by: ylemkimon <y@ylem.kim>
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
Co-authored-by: Kevin Barabash <kevinb7@gmail.com>
* Remove `greediness` property
Use boolean `grouped` property instead, which is more consistent with
LaTeX.
BREAKING CHANGE: \cfrac, \color, \textcolor, \colorbox, \fcolorbox are
no longer grouped.
* Rename grouped to allowedInArgument
* Reenable tests
* Update documentation
* Fix typo
Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>