多列方程組的頂部對齊

多列方程組的頂部對齊

我需要將以下方程組對齊到頂部:

\begin{equation}
\begin{aligned}
    S_{1} &= \frac{11.0}{24.1} &= 0.46 \text{ пкФ}/{\%}; \\[1em]
    S_{2} &= \frac{25.6}{32.3} &= 0.79 \text{ пкФ}/{\%}; \\[1em]
    S_{3} &= \frac{34.3}{42.0} &= 0.82 \text{ пкФ}/{\%}; \\[1em]
    S_{4} &= \frac{45.2}{53.1} &= 0.85 \text{ пкФ}/{\%}; \\[1em]
    S_{5} &= \frac{60.0}{67.0} &= 0.90 \text{ пкФ}/{\%}; \\[1em]
    S_{6} &= \frac{72.2}{82.3} &= 0.88 \text{ пкФ}/{\%};
\end{aligned}
\qquad \qquad
\begin{aligned}
    S_{7} &= \frac{59.4}{65.9} &= 0.90 \text{ пкФ}/{\%}; \\[1em]
    S_{8} &= \frac{45.0}{51.6} &= 0.87 \text{ пкФ}/{\%}; \\[1em]
    S_{9} &= \frac{34.7}{42.4} &= 0.82 \text{ пкФ}/{\%}; \\[1em]
    S_{10} &= \frac{25.5}{33.2} &= 0.77 \text{ пкФ}/{\%}; \\[1em]
    S_{11} &= \frac{10.6}{24.0} &= 0.44 \text{ пкФ}/{\%};
\end{aligned}
\end{equation}

對齊預覽 有任何想法嗎?

答案1

用於兩種環境(由於 Unicode 錯誤,\begin{aligned}[t]我不得不刪除這些語句)\text{..}

然而,有一些缺點:方程式編號放錯了!

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{siunitx}



\begin{document}

\begin{equation}
\begin{aligned}[t]
    S_{1} &= \frac{11.0}{24.1} &= 0.46 {\si{\percent}}; \\[1em]
    S_{2} &= \frac{25.6}{32.3} &= 0.79 {\si{\percent}}; \\[1em]
    S_{3} &= \frac{34.3}{42.0} &= 0.82 {\si{\percent}}; \\[1em]
    S_{4} &= \frac{45.2}{53.1} &= 0.85 {\si{\percent}}; \\[1em]
    S_{5} &= \frac{60.0}{67.0} &= 0.90 {\si{\percent}}; \\[1em]
    S_{6} &= \frac{72.2}{82.3} &= 0.88 {\si{\percent}};
\end{aligned}
\qquad \qquad
\begin{aligned}[t]
    S_{7} &= \frac{59.4}{65.9} &= 0.90  {\si{\percent}}; \\[1em]
    S_{8} &= \frac{45.0}{51.6} &= 0.87  {\si{\percent}}; \\[1em]
    S_{9} &= \frac{34.7}{42.4} &= 0.82  {\si{\percent}}; \\[1em]
    S_{10} &= \frac{25.5}{33.2} &= 0.77 {\si{\percent}}; \\[1em]
    S_{11} &= \frac{10.6}{24.0} &= 0.44 {\si{\percent}};
\end{aligned}
\end{equation}
\end{document}

在此輸入影像描述

答案2

另一種方法:在第二列中新增一條虛擬線,確保它與其他線具有相同的高度。這使得方程式編號垂直居中。

如果線條具有不同的高度,則這將無法運作。

我用“xxx”替換了希臘字母,因為對我來說使用 pdflatex 更容易,它不能很好地處理 unicode 字元。

您實際上並不需要&第二個等號之前的那一秒,但是如果您確實想確保這些等號對齊,並且某些分數可能比其他分數更寬,您可以使用{alignedat}{2}and double第二 &;這將使第二個等號周圍的間距保持與第一個等號相同的寬度。

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{aligned}
    S_{1} &= \frac{11.0}{24.1} &= 0.46 \text{ xxx}/{\%}; \\[1em]
    S_{2} &= \frac{25.6}{32.3} &= 0.79 \text{ xxx}/{\%}; \\[1em]
    S_{3} &= \frac{34.3}{42.0} &= 0.82 \text{ xxx}/{\%}; \\[1em]
    S_{4} &= \frac{45.2}{53.1} &= 0.85 \text{ xxx}/{\%}; \\[1em]
    S_{5} &= \frac{60.0}{67.0} &= 0.90 \text{ xxx}/{\%}; \\[1em]
    S_{6} &= \frac{72.2}{82.3} &= 0.88 \text{ xxx}/{\%};
\end{aligned}
\qquad \qquad
\begin{aligned}
    S_{7} &= \frac{59.4}{65.9} &= 0.90 \text{ xxx}/{\%}; \\[1em]
    S_{8} &= \frac{45.0}{51.6} &= 0.87 \text{ xxx}/{\%}; \\[1em]
    S_{9} &= \frac{34.7}{42.4} &= 0.82 \text{ xxx}/{\%}; \\[1em]
    S_{10} &= \frac{25.5}{33.2} &= 0.77 \text{ xxx}/{\%}; \\[1em]
    S_{11} &= \frac{10.6}{24.0} &= 0.44 \text{ xxx}/{\%}; \\[1em]
    \phantom{ \frac{10.6}{24.0}}
\end{aligned}
\end{equation}

\end{document}

範例程式碼的輸出

相關內容