# [Tex/LaTex] Align math to the left

horizontal alignmentmath-mode

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}
{"ft_lang_label":"__label__en","ft_lang_prob":0.8693879,"math_prob":0.8577345,"size":899,"snap":"2023-14-2023-23","text_gpt3_token_len":240,"char_repetition_ratio":0.12067039,"word_repetition_ratio":0.0,"special_character_ratio":0.24694104,"punctuation_ratio":0.061349694,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9937925,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-08T14:27:46Z\",\"WARC-Record-ID\":\"<urn:uuid:1eecf2cc-1bb6-4208-849c-253a904c9ef9>\",\"Content-Length\":\"22036\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1b735c37-3bf4-46d7-8d5a-2921fbc18f67>\",\"WARC-Concurrent-To\":\"<urn:uuid:c91dbe92-ebb8-4400-bf38-49085004090f>\",\"WARC-IP-Address\":\"45.77.5.190\",\"WARC-Target-URI\":\"https://imathworks.com/tex/tex-latex-align-math-to-the-left/\",\"WARC-Payload-Digest\":\"sha1:U5G3WG6NXWFNVWYIII3YEAYYXP5JTEP2\",\"WARC-Block-Digest\":\"sha1:SEIMJ34LXLGEA2UXGDFZ2BRRWXY3WJBT\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224655027.51_warc_CC-MAIN-20230608135911-20230608165911-00211.warc.gz\"}"}