
Estoy intentando formatear una declaración de varias líneas con una etiqueta.
\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}
Lamentablemente, el comunicado desborda el margen derecho. No creo que usar align
los multline
entornos gather
sea adecuado porque la alineación horizontal no sería correcta. ¿Cómo debo formatear la declaración matemática?
Cosas que me gustaría:
- Me gustaría que la declaración tuviera sangría como en el
quote
medio ambiente. - Quiero que la etiqueta sea "P(n)" en lugar de "(P(n))" como aparece actualmente en la salida.
Respuesta1
Este es texto, por lo que debe tratarse 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}
Si usa \tag*{$P(n)$}
(tenga en cuenta el modo matemático, en cualquier caso), obtendrá la etiqueta sin paréntesis:
Respuesta2
Puede utilizar un gathered
entorno dentro del equation
entorno, como en
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}