The Mathpix Snip tool is quite impressive. I recommend you check it out! It could save you a lot of effort in trying to write $\rm\LaTeX$ code.
Here is an example at work. Original image:
First crack at the $\rm\LaTeX$ code generated by Mathpix Snip:
\(\begin{aligned} P(Y>1.5 | Y>1) &=\frac{P(Y>1.5 \cap Y>1)}{P(Y>1)} \\ &=\frac{P(Y>1.5)}{P(Y>1)} \\ &=\frac{1-P(Y \leq 1.5))}{1-P(Y \leq 1)} \\ &=\frac{1-F(1.5)}{1-F(1.5)} \\ &=\frac{0.125}{0.5} \\ &=0.25 \end{aligned}\)
which displays as
(\begin{aligned} P(Y>1.5 | Y>1) &=\frac{P(Y>1.5 \cap Y>1)}{P(Y>1)} \\ &=\frac{P(Y>1.5)}{P(Y>1)} \\ &=\frac{1-P(Y \leq 1.5))}{1-P(Y \leq 1)} \\ &=\frac{1-F(1.5)}{1-F(1.5)} \\ &=\frac{0.125}{0.5} \\ &=0.25 \end{aligned})
So the only catch here is that MathJax doesn't behave quite the same as regular $\rm\LaTeX$ in, say, TeXstudio. That is a setting you can change, though.