Artemio González López <artem...@mac.com> writes: > I’ve been having some problems with auctex formatting of some > equations. Here’s a minimal example: > > \documentclass[a4paper,11pt]{article} > > \usepackage{babel} > \usepackage{amsmath} > > \begin{document} > > \[ > I_O=Ml^2\begin{pmatrix} > \frac1{12}& 0& 0\\[2pt] > 0& \frac1{12}& 0\\[2pt] > 0& 0& \frac16 > \end{pmatrix}+Ml^2 > \begin{pmatrix} > \hfill\frac14& -\frac14& 0\\[2pt] > -\frac14& \hfill\frac14& 0\\[2pt] > \hfill 0& \hfill 0& \frac12 > \end{pmatrix}=Ml^2 > \begin{pmatrix} > \hfill\frac13& -\frac14& 0\\[2pt] > -\frac14& \hfill\frac13& 0\\[2pt] > \hfill0& \hfill0& \frac23 > \end{pmatrix} > \] > > \end{document} > > After the equation all text is aligned with the closing \[, which is a > pain. Is this reproducible? And, more importantly, how could I fix it?
Yes, I can reproduce this. I think your best bet is to have \begin|\end statements in their own line and format your input like this: \[ I_O=Ml^2 \begin{pmatrix} \frac1{12} & 0 & 0 \\[2pt] 0 & \frac1{12} & 0 \\[2pt] 0 & 0 & \frac16 \end{pmatrix} +Ml^2 \begin{pmatrix} \hfill\frac14 & -\frac14 & 0 \\[2pt] -\frac14 & \hfill\frac14 & 0 \\[2pt] \hfill 0 & \hfill 0 & \frac12 \end{pmatrix} =Ml^2 \begin{pmatrix} \hfill\frac13 & -\frac14 & 0 \\[2pt] -\frac14 & \hfill\frac13 & 0 \\[2pt] \hfill0 & \hfill0 & \frac23 \end{pmatrix} \] The alignment of '&' is of course unnecessary and was simply done by `align-regexp'. Best, Arash