I am having trouble aligning my comments and equations in the align environment. I would like my equations as far left as possible, the numbers to the equations as far right as possible (but guaranteed to stay on the same line!), and the comment right aligned to the number of the equation, with as much space as possible between the equation and comment.
It seems like the issue is that the text comments will not start farther to the left than the right-most part of the longest equation (like the third equation below).
Example:
\documentclass[12pt, letterpaper]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
&f'\left(0\right)=\lim\limits_{x\to 0} \frac{f\left(x\right)-f\left(0\right)}{x-0}
&\text{ limit definition of derivative}\\
&=\lim\limits_{x\to 0} \frac{x^2 \sin\left(\frac{1}{x}\right)}{x}=\lim\limits_{x\to 0} x\sin\left(\frac{1}{x}\right)
&\text{ simplifying the limit}\\
&0\leq\left| \sin \left(\frac{1}{x}\right) \right| \leq 1 \implies 0\leq \left|x \sin \left(\frac{1}{x}\right)\right|\leq \lvert x\rvert
&\text{bound for sine}
\end{align}
\end{document}
Output:
So far I have tried using the double &&
and the flalign
package, but neither have helped me.