
Estou tentando formatar uma instrução de várias linhas com um rótulo.
\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}
Infelizmente, a afirmação transborda a margem direita. Não creio que usar o align
, multline
ou os gather
ambientes seria adequado porque o alinhamento horizontal não seria correto. Como devo formatar a declaração matemática?
Coisas que eu gostaria:
- Gostaria que a declaração fosse recuada como no
quote
meio ambiente. - Quero que o rótulo seja "P(n)" em vez de "(P(n))" como está atualmente na saída
Responder1
Este é um texto, portanto deve ser tratado como tal:
\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}
Se você usar \tag*{$P(n)$}
(observe o modo matemático, em qualquer caso), obterá a tag sem parênteses:
Responder2
Você pode usar um gathered
ambiente dentro do equation
ambiente, como em
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}