# Align math to the left

I need to align math to the left. I tried to add [fleqn] option to the \documentclass command - it works but now all equations in the document are aligned to the left which isn't what I want.

My LaTeX code looks like this

\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* environment is used only for example. Is there any environment instead of gather* which is suitable for my needs? Thanks

That's a rather strange requirement, perhaps easiest is if you use $$ instead of \[. $$ is officially not supported syntax, the main problem being that it does not+ work with fleqn which seems to be exactly what you want here.

Note never leave a blank line above a display math, whether , \[ or \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}


You can do that nesting gathered in aflalign(*) environment:

\documentclass{article}

\usepackage{mathtools}
\usepackage[showframe]{geometry}

\begin{document}

Classic math which I don't want align to the left

$$\begin{gathered} x^2 + 3 \\ 2x - 5 = z \end{gathered}$$

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}