雑学1472774 views
小学社会308820 views
高校生物550093 views
中学社会667316 views
いろは2990632 views
高校日本史189949 views
中学数学621754 views
りんご195339 views
高校倫理1434270 views
Computer365661 views
Help
Tools

English

gathered 環境|LaTeX

gathered 環境は複数行の数式を中央揃えでまとめて表示するための環境です。<!-- c853a06c90d5419a9bdaf752fc0b5015_0 --> の中で使います。

基本的な使い方

複数の式を中央揃えで縦に並べます。

\[
\begin{gathered}
a + b = c \\
x + y = z
\end{gathered}
\]

align 環境と違い、揃える位置を & で指定する必要がありません。各行が独立して中央揃えになります。

3 行以上の数式

何行でも追加できます。

\[
\begin{gathered}
a = 1 \\
b = 2 \\
c = 3 \\
d = 4
\end{gathered}
\]

括弧で囲む

\left\right で括弧を付けることができます。

\[
\left\{
\begin{gathered}
x + y = 5 \\
x - y = 1
\end{gathered}
\right.
\]

連立方程式を表すときに便利です。

長さの異なる式

各行の長さが異なっていても、それぞれ中央に配置されます。

\[
\begin{gathered}
a = b \\
x + y + z = 10 \\
p = q
\end{gathered}
\]

数式の途中に挿入

他の数式の一部として使うこともできます。

\[
A = \left(
\begin{gathered}
\text{条件 1} \\
\text{条件 2}
\end{gathered}
\right)
\implies B
\]

aligned との違い

aligned 環境は & で揃え位置を指定しますが、gathered は単純に中央揃えです。

\[
\begin{aligned}
x + y &= 5 \\
x &= 3
\end{aligned}
\quad\text{vs}\quad
\begin{gathered}
x + y = 5 \\
x = 3
\end{gathered}
\]

左側の aligned は等号の位置が揃い、右側の gathered は各行が独立して中央に配置されています。

複数のグループ

複数の gathered を横に並べることもできます。

\[
\begin{gathered}
a = 1 \\
b = 2
\end{gathered}
\qquad
\begin{gathered}
x = 3 \\
y = 4
\end{gathered}
\]

説明文の追加

式の前後に説明を付けることもできます。

\[
\text{ここで、}
\begin{gathered}
a > 0 \\
b > 0
\end{gathered}
\text{とする。}
\]