
Necesito alinear las matemáticas a la izquierda. Intenté agregar [fleqn]
una opción al \documentclass
comando; funciona, pero ahora todas las ecuaciones del documento están alineadas a la izquierda, que no es lo que quiero.
Mi código LaTeX se ve así
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Classic math which I don't want align to the left
\[
2x + 5
\]
Multiline math which must be left-aligned
\begin{gather*}
x^2 + 3 \\
2x - 5
\end{gather*}
\end{document}
gather*
El entorno se utiliza sólo por ejemplo. ¿Existe algún entorno que gather*
sea adecuado para mis necesidades? Gracias
Respuesta1
Ese es un requisito bastante extraño, quizás lo más fácil sea si lo usas $$
en lugar de \[
. $$
es una sintaxis oficialmente no compatible, el principal problema es que nono+ trabajo con fleqn
el que parece ser exactamente lo que quieres aquí.
Tenga en cuenta que nunca deje una línea en blanco encima de una matemática en pantalla, ya sea $$
, \[
o\begin{align}
\documentclass[fleqn]{article}
\usepackage{amsmath}
\begin{document}
Classic math which I don't want align to the left
$$
2x + 5
$$
Multiline math which must be left-aligned
\begin{gather*}
x^2 + 3 \\
2x - 5 \\
\end{gather*}
\end{document}
Respuesta2
Puedes hacer ese anidamiento gathered
en un flalign(*)
entorno:
\documentclass{article}
\usepackage{mathtools}
\usepackage[showframe]{geometry}
\begin{document}
Classic math which I don't want align to the left
\begin{equation}
\begin{gathered}
x^2 + 3 \\
2x - 5 = z
\end{gathered}
\end{equation}
Multiline math which must be left-aligned
\begin{flalign}
\hskip\parindent & \begin{gathered}
x^2 + 3 \\
2x - 5 = z
\end{gathered} &
\end{flalign}
\end{document}