\documentclass{article}
\usepackage{geometry}
\usepackage{amsthm, amsmath, amssymb}
\usepackage{anyfontsize}
\newgeometry{vmargin={15mm}, hmargin={12mm}}
\makeatletter
\newcommand{\mathleft}{\@fleqntrue\@mathmargin0pt}
\newcommand{\mathcenter}{\@fleqnfalse}
\makeatother
\begin{document}
\fontsize{18}{21.6}
\mathleft
\begin{gather*}
8x^2+10x-3=0\\\\
8x^2-2x+12x-3=0\\\\
2x(4x-1)+3(4x-1)=0\\\\
(2x+3)(4x-1)=0\\\\
x=-\frac{3}{2}\;or\;\frac{1}{4}\\\\\\\\\\\\
-7x^2-4x+3=0\\\\
-7x^2-7x+3x+3=0\\\\
-7x(x+1)+3(x+1)=0\\\\
(3-7x)(x+1)=0\\\\
x=\frac{3}{7}\;or\;-1\\\\\\\\\\\\
x^2+4=8x-8\\\\
x^2-8x+12=0\\\\
x^2-2x-6x+12=0\\\\
x(x-2)+-6(x-2)=0\\\\
(x-6)(x-2)=0\\\\
x=2\;or\;6
\end{gather*}
\end{document}
When I run this code I get a pdf with the first page blank and some of the actual text outside the page. How can I fix it so that it does not leave a blank page and the text stays in the page so that if it can't fit it creates a new page and puts the text there. Both of these issues disappear if the text between begin gather and end gather is small, but how do I make it work regardless of the amount of text or size of the font? The question is similar to this but I am not using the xcolor package or counters. To get the pdf I am using the TexShop application installed from mactex.
\\\\(four in a row) doesn't seem right. 12 is definitely wrong. If it's a separate display, then end thegather*and start a new one. – Teepeemm Jul 31 '21 at 22:22\fontsize{18}{21.6}does not select a font, you need\selectfontafter it. – David Carlisle Jul 31 '21 at 22:49\text{ or }rather than\;or\;– rmolina Jul 31 '21 at 23:14amsmathandamsthm,amsmathshould always be loaded first. – barbara beeton Aug 01 '21 at 00:26