仅仅使用 tabular
来实现, 大概是下面这样:
\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum}
\begin{document}
\lipsum[1][1-3]
\begin{equation}
\def\arraystretch{1.7}
\addtolength{\tabcolsep}{-3pt}
\begin{tabular}{rlrllll}
$\frac{1}{\sqrt{2}}y_1$ & $-$ & $\frac{1}{\sqrt{2}}y_2 $ & & & = & $f_1$\\
$\frac{1}{\sqrt{2}}y_1$ & $+$ & $\frac{1}{\sqrt{2}}y_2 $ & & & = & $f_2$\\
& $\textcolor{red}{+}$ & $\frac{1}{\sqrt{2}}y_2 $ & $+$ & $y_3$ & = & $f_3$\\
& $\textcolor{red}{+}$ & $-\frac{1}{\sqrt{2}}y_2$ & & & = & $f_4$\\
$\frac{1}{\sqrt{2}}y_1$ & & & $-$ & $y_3$ & = & $f_5$\\
$-\frac{1}{\sqrt{2}}y_1$ & & & & & = & $f_6$\\
\end{tabular}
\end{equation}
\lipsum[1][4-6]
\end{document}
用 tabular
比 align
之类的直观一点, 就是会多打一些 $
;如果想少打一些 &
, $
之类的符号,可以手搓一个表格数据解析的函数,但是感觉没必要(去用 tabularray
就好了)。
问 排版「多个对齐位点」带标号公式的最佳实践?