-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
If \foo expands to a space (\def\foo{ }) or nothing (\def\foo{}), LaTeX will treat \frac\foo\foo just like \frac{}{}, i.e., two empty arguments. In KaTeX, in both cases, the arguments will get ignored (in math mode), so \frac\foo\foo x y will act just like \frac xy.
Another example: with \def\foo{foo}, \text\foo is equivalent to \text{foo} in LaTeX, but is treated as \text foo i.e. \text{f}oo in KaTeX.
One way to fix this is to move all function support into MacroExpander instead of Parser. I think a possible simpler fix is for MacroExpander to grab a function and its arguments, and then pass them on to Parser for actual handling.
Reactions are currently unavailable