Upgrade auto-render extension for AMS environments and Pandoc delimiters
See original GitHub issueThe KaTeX main branch now includes eight environments that AMS LaTeX accepts in text mode. That is, in AMS LaTeX, these environments do not not need enclosing \[…\] delimiters. It would be good if the auto-render extension could also recognize those environments and invoke KaTeX without need for \[…\] delimiters.
The relevant environments are:
- {align}
- {align*}
- {alignat}
- {alignat*}
- {equation}
- {equation*}
- {gather}
- {gather*}
KaTeX has a new rendering option, called topEnv which has been included for this purpose. If the auto-render extension matches one of these environments, it should call KaTeX with rendering option topEnv: true and then KaTeX will know how to handle it.
While we’re at this, I think it would also be good if the $...$ option (if included) be adjusted in line with Pandoc, which imposes the following constraint:
The opening $ must have a non-space character immediately to its right, while the closing $ must have a non-space character immediately to its left, and must not be followed immediately by a digit.
Either or both or these improvements may be better if there was a configuration flag that allowed the extension to work in the old manner.
@danielhollas You once expressed a willingness to take this on. Are you still game?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (6 by maintainers)

Top Related StackOverflow Question
Sure. Also for clarity, I think changes to core KaTeX are separate from what @danielhollas has agreed to do. Another one of us needs to take that on.
@edemaine Just to be sure that I understand, you are asking for an adjustment to core KaTeX so that it would accecpt a string either with or without an enclosing
$…$. Is that correct?