如何使用 \newenvironment 並在獨立文件中對齊

如何使用 \newenvironment 並在獨立文件中對齊

這有效:

\documentclass[]{article}
\usepackage{amsmath}

\newenvironment{f}{
    \csname align*\endcsname
}{
    \csname endalign*\endcsname
}

\begin{document}

\begin{f}
a = 1
\end{f}

\begin{f}
b = 2
\end{f}

\end{document}

但如果我在第一行更改article為乳膠抱怨:standalone

!插入缺少 \endgroup。
<插入的文字>
\endgroup
l.14 \end{f}

我該如何解決這個問題?我的目標是用來\documentclass[multi={f}]{standalone}獲取每個方程式的單獨頁面。

相關內容