想要在vscode下的Markdown文件中插入多行对齐的公式,但是尝试 align 和 align* 都不可行。
align
$$\begin{align}f(x) & = (m+n)^2 \\& = m^2+2mn+n^2 \\\end{align}$$123456
显示:
\begin{align} f(x) & = (m+n)^2 \\ & = m^2+2mn+n^2 \\ \end{align}1
align*
$$\begin{align*}f(x) & = (m+n)^2 \\& = m^2+2mn+n^2 \\\end{align*}$$123456
显示:
\begin{align*} f(x) & = (m+n)^2 \\ & = m^2+2mn+n^2 \\ \end{align*}1
解决
使用 aligned
$$\begin{aligned}f(x) & = (m+n)^2 \\& = m^2+2mn+n^2 \\\end{aligned}$$