如何將方程式與等號對齊,並在方程式之間插入文字行?

如何將方程式與等號對齊,並在方程式之間插入文字行?

我想對齊關於“=”符號的未編號方程,其間有一兩行語句。而且,我希望它們居中。這是我在程式碼中所做的:

\begin{align*}
T & = \frac{0.161V}{\sum as}\\
\sum as & = \frac{0.161V}{T}\\
\end{align*}
Substituting the known values, we get,\\
\begin{align*}
\sum as & = \frac{0.161 \times 120000}{1.5}\\
\sum as & = 13360 \text{ O W U}
\end{align*}
The total absorption of the hall is 13,360 open window units (O W U)\\
Therefore, the average absorbing power of the surface\\
\begin{align*}
a & = \frac{\sum as}{\sum s}\\
\implies a & = \frac{13360}{25000}\\
\implies a &=0.5344 \text{sabine}
\end{align*}
The average absorbing power of the surface is 0.5344 sabine.

上面的程式碼給出了等號未對齊的輸出。我希望它們居中並對齊。此方程式也出現在語句的下一行。我希望他們排成一列。請幫忙。

答案1

解決方案已經在評論中提到了。我在這裡介紹了這個很棒的包siunitx,因為它可以更好地打印數字並且單位間距正確。我還為你們宣布了兩個新單位。如果您稍後決定\text{sabine}應該變成\mathscr{S}什麼,您只需一次編輯即可更改整個文件。

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}
\usepackage{siunitx}
\DeclareSIUnit{\sabine}{\text{sabine}}
\DeclareSIUnit{\owu}{\text{OWU}}

\begin{document}
\begin{align*}
    T &= \frac{0.161 V}{\sum as}\\
    \sum as &= \frac{0.161 V}{T}\\
    \intertext{Substituting the known values, we get,}
    \sum as &= \frac{0.161 \times 120000}{1.5}\\
    \sum as &= \SI{13360}{\owu}
    \intertext{The total absorption of the hall is \num{13360} open window units (\si{\owu}).
    Therefore, the average absorbing power of the surface is:}
    a & = \frac{\sum as}{\sum s}\\
     \smashoperator{\implies} a &= \frac{13360}{25000}\\
     \smashoperator{\implies} a &= \SI{0.5344}{\sabine}
\end{align*}
The average absorbing power of the surface is \SI{0.5344}{\sabine}.
\end{document}

在此輸入影像描述

相關內容