While I'm often happy with my output PDF result, my latex code often gets very ugly. Poor code readability makes the editing process very difficult. Are there any simple tricks to format my code to make it more readable?
Here's an example:
\begin{align*}
H_3\ket{\psi(t)} &= \left(\hbar\epsilon \int_{z_0}^{z_0+l}E_a^{(-)} E_a^{(+)} E_b^{(-)} E_b^{(+)} dz \right) \ket{\psi(t)} \\
&= \underbrace{\left(\hbar\epsilon \int_{z_0}^{z_0+l}E_a^{(-)} E_a^{(+)} E_b^{(-)} E_b^{(+)} dz \right)}_{\text{equation \ref{H3}}} \underbrace{\left( \sum_n \sum_m c_{nm}(t) e^{-2 \pi i(n+m)c t/L} \ket{1_n}_a\ket{1_m}_b \right)}_{\ket{\psi(t)}} \\
\end{align*}
How would you clean this up? Personally, I'm interested in adding new lines to make the individual lines more readable. But by indenting or splitting my code out into different lines I get error messages.
%characters instead of blank lines, too. – Mike Renfro May 14 '16 at 02:18