
複数行のステートメントをラベルでフォーマットしようとしています。
\documentclass{article}
\usepackage{amsmath}
\usepackage[showframe,pass]{geometry}
\begin{document}
Let $P(n)$ denote the statement that
\begin{equation}
\text{The sum of the natural numbers less than or equal to $n$ is given by the formula }
0 + 1 + \cdots + n = \frac{n(n+1)}{2}.
\tag{P(n)}
\end{equation}
\end{document}
align
残念ながら、この文は右余白からはみ出しています。水平方向の配置が正しくないため、 、multline
、環境の使用は適切ではないと思いますgather
。数式をどのようにフォーマットすればよいでしょうか?
欲しいもの:
- 環境と同じようにステートメントをインデントしたいと思います
quote
。 - ラベルを、現在の出力にある「(P(n))」ではなく「P(n)」にしたい
答え1
これはテキストなので、そのように扱う必要があります。
\documentclass{article}
\usepackage{amsmath}
\usepackage[showframe,pass]{geometry}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
Let $P(n)$ denote the statement that
\[
\begin{minipage}{0.75\textwidth}
The sum of the natural numbers less than or equal to $n$ is given by the formula
$0 + 1 + \cdots + n = \frac{n(n+1)}{2}$.
\end{minipage}
\tag{$P(n)$}
\]
\lipsum[3]
\end{document}
(いずれの場合も数式モードに注意してください)を使用すると\tag*{$P(n)$}
、括弧なしのタグが取得されます。
答え2
gathered
環境の中に環境を使うこともできますequation
。
Let $P(n)$ denote the statement that
\begin{equation}
\begin{gathered}
\text{The sum of the natural numbers less than or equal to $n$}\\
\text{is given by the formula $0 + 1 + \cdots + n = \frac{n(n+1)}{2}$.}
\end{gathered}
\tag*{P(n)}
\end{equation}