【解决】ParseError: KaTeX parse error: \cr valid only within a tabular/array environment

使用array即可,如:

效果一

$\begin{array}{cc}
1\\2
\end{array}$

$\begin{array}{cc}1\\2\end{array}$

1 2 \begin{array}{cc} 1\\2 \end{array} 12

效果二

$\begin{array}{cc}
\LARGE f(x)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^2}{2\sigma^2}}\\(-\infty<x<+\infty)
\end{array}$

f ( x ) = 1 2 π σ e − ( x − μ ) 2 2 σ 2 ( − ∞ < x < + ∞ ) \begin{array}{cc} \LARGE f(x)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^2}{2\sigma^2}}\\(-\inftyf(x)=2π σ1e2σ2(xμ)2(<x<+)

你可能感兴趣的:(KaTex)