mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 04:08:43 +00:00
feat(function): add allowedInArgument
instead of greediness
property (#2134)
* 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>
This commit is contained in:
@@ -9,8 +9,8 @@ some gaps between KaTeX and LaTeX and therefore there may be breaking changes.
|
||||
## Macro arguments
|
||||
Tokens will not be expanded while parsing a macro argument. For example, `\frac\foo\foo`,
|
||||
where the `\foo` is defined as `12`, will be parsed as `\frac{12}{12}`, not
|
||||
`\frac{1}{2}12`. <!--To expand the argument before parsing, `\expandafter` can
|
||||
be used` like `\expandafter\frac\foo\foo`.-->
|
||||
`\frac{1}{2}12`. To expand the argument before parsing, `\expandafter` can
|
||||
be used like `\expandafter\frac\foo\foo`.
|
||||
|
||||
## `\def`
|
||||
`\def` no longer accepts a control sequence enclosed in braces. For example,
|
||||
@@ -22,3 +22,9 @@ It also no longer accepts replacement text not enclosed in braces. For example,
|
||||
## `\newline` and `\cr`
|
||||
`\newline` and `\cr` no longer takes an optional size argument. To specify vertical
|
||||
spacing, `\\` should be used.
|
||||
|
||||
## `\cfrac`, `\color`, `\textcolor`, `\colorbox`, `\fcolorbox`
|
||||
They are no longer allowed as an argument to primitive commands, such as `\sqrt`
|
||||
(without the optional argument) and super/subscript. For example,
|
||||
`\sqrt\textcolor{red}{x}` no longer works and should be changed to
|
||||
`\sqrt{\textcolor{red}{x}}`.
|
||||
|
Reference in New Issue
Block a user