Katex: \begin{align} not support

Created on 4 Dec 2017  路  5Comments  路  Source: KaTeX/KaTeX

I want to use KaTex instead Mathjax, but the existed formula contain begin{align}, it cannot render with KaTex

Most helpful comment

You can use \begin{aligned} within math mode. Does this suit your purpose?

All 5 comments

You can use \begin{aligned} within math mode. Does this suit your purpose?

@edemaine the formulas has already exist in database, should I use RegExp to covert align to aligned? Im worry that if there are some other incompatible formulas grammar between latex and katex

If the formulas are already supposed to be in math mode, then you should be using aligned instead of align. Yes, a regex would work.

If you have \begin{align} ... \end{align} at the text level, i.e., instead of \[ ... \] or something similar, then that is at least correct at the LaTeX level, and you're really looking for a solution to #604. Until that time, a regex replacing \begin{align} with \[\begin{aligned} and \end{align} with \end{aligned}\] would work as a stopgap.

thanks锛宎nd one more question: in #604 I see the solution to "align",and are there some other risk of incompatible formulas grammar between latex and katex ?

Katex renders aligned weirdly. To support a compatibility with other grammars (latex), please make \begin{align}..\end{align} work.

e.g.

$$
\begin{aligned}
V^*(s) &=  \max_a \Big( \underbrace{r(s, a) + \gamma V^*(s')}_{=Q^*(s, a)} \Big)
\end{aligned}
$$

image

Was this page helpful?
0 / 5 - 0 ratings