Skip to content

Optional argument checking shouldn't expand #1419

@edemaine

Description

@edemaine

I've found that \lbrack, despite being \defd to [, doesn't get treated as the beginning of an optional argument in LaTeX:

\begin{array}
...
\\\lbrack 2ex \rbrack
...
\end{array}

doesn't get treated the same as ...\\[2ex] in LaTeX. However, KaTeX treats them the same (with \def\lbrack{[}). I believe this is because optional argument ([) detection uses \futurelet which grabs the next symbol, but doesn't expand it. Assuming this gets verified, we should adjust optional argument detection to use the appropriate MacroExpander tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions