
Preciso alinhar a matemática à esquerda. Tentei adicionar [fleqn]
uma opção ao \documentclass
comando - funciona, mas agora todas as equações do documento estão alinhadas à esquerda, o que não é o que eu quero.
Meu código LaTeX é assim
\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*
ambiente é usado apenas por exemplo. Existe algum ambiente que gather*
seja adequado às minhas necessidades? Obrigado
Responder1
Esse é um requisito bastante estranho, talvez o mais fácil seja usar $$
em vez de \[
. $$
não é uma sintaxe oficialmente suportada, o principal problema é que isso acontecenão+ trabalho com fleqn
o qual parece ser exatamente o que você deseja aqui.
Observação: nunca deixe uma linha em branco acima de uma matemática de exibição, seja $$
, \[
ou\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}
Responder2
Você pode fazer esse aninhamento gathered
em um flalign(*)
ambiente:
\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}