# how to write a long equation in a 2 column format paper

I wanna write a long equation in for a 2-column template of a paper. I used the aligned command to do that, but it doesn't work.

I attache the target equation I am trying to obtain.

Here is my try:

 \begin{aligned} L ( \mathbf { m } ) = & k \exp \left( - \frac { 1 } { 2 } ( \mathbf { g } ( \mathbf { m } ) - \mathbf { d } _ { \mathrm { obs } } - \mathbf { d } _ { D } ) ^ { t } \mathbf { C } _ { D } ^ { - 1 } ( \mathbf { g } ( \mathbf { m } ) \\ & - \mathbf { d } _ { \mathrm { obs } } - \mathbf { d } _ { D })\right) \end{aligned}


The problem is that the \left( \right) pair is split over two lines. Either add some dummy closing and opening macros \right. and \left. at the end and start of the line or manually choose the size (I'd recommend the later because automatically resizes brackets are often wrong)

# Dummy macros:

\documentclass[twocolumn]{article}

\usepackage{mathtools}

\begin{document}

\begin{aligned} L ( \mathbf { m } ) = & k \exp \left( - \frac { 1 } { 2 } ( \mathbf { g } ( \mathbf { m } ) - \mathbf { d } _ { \mathrm { obs } } - \mathbf { d } _ { D } ) ^ { t } \mathbf { C } _ { D } ^ { - 1 } ( \mathbf { g } ( \mathbf { m } ) \right. \\ & \left. - \mathbf { d } _ { \mathrm { obs } } - \mathbf { d } _ { D }) \vphantom{\frac { 1 } { 2 }} \right) \end{aligned}

\end{document}


# Manual size:

\documentclass[twocolumn]{article}

\usepackage{mathtools}

\begin{document}

\begin{aligned} L ( \mathbf { m } ) = & k \exp \biggl( - \frac { 1 } { 2 } ( \mathbf { g } ( \mathbf { m } ) - \mathbf { d } _ { \mathrm { obs } } - \mathbf { d } _ { D } ) ^ { t } \mathbf { C } _ { D } ^ { - 1 } ( \mathbf { g } ( \mathbf { m } ) \\ & - \mathbf { d } _ { \mathrm { obs } } - \mathbf { d } _ { D })\biggr) \end{aligned}

\end{document}


i would rewrite your equation in the following more compact (and meaningful) form:

\documentclass[twocolumn]{article}
\usepackage{mathtools}

\usepackage{lipsum}% for dummy text
\begin{document}
\lipsum[1]
$$L(\mathbf{m}) = k \exp\Bigl(- \tfrac{1}{2}\bigl(\mathbf{A}(\mathbf{m}\bigr)^{t} \mathbf{C}_{D}^{-1}\bigl(\mathbf{A}(\mathbf{m}\bigr)\Bigr)$$
where $\mathbf{A}(\mathbf{m}) = \mathbf{g}(\mathbf{m}) - \mathbf{d}_{\mathrm{obs}} - \mathbf{d}_{D}$.

\lipsum[2]
\end{document}


Two variants, one with a different alignment, the other with multline. I used the medium-sized fraction command for the fractional coefficient, as I think it looks better than the full \displaystyle:

\documentclass[twocolumn]{article}

\usepackage{mathtools, nccmath}
\usepackage{lipsum}

\begin{document}

\lipsum[11]
\begin{aligned} L (\mathbf {m}) = k \exp \Bigl(&\medmath{-\frac {1} {2}}\bigl(\mathbf {g}(\mathbf {m}) - \mathbf {d}_{ \mathrm {obs}} - \mathbf {d}_{D} \bigr)^{\!t}\cdot \\% &\mathbf{C}_{D}^{-1} \bigl(\mathbf{g}(\mathbf{m}) - \mathbf{d} _{\mathrm{obs}} - \mathbf{d}_{D}\bigr) \Bigr) \end{aligned}
\lipsum[13]
\begin{multline}
L (\mathbf {m}) =
k \exp \Bigl( \medmath{-\frac {1} {2}}\bigl(\mathbf {g} (\mathbf {m}) - \mathbf {d}_{ \mathrm {obs}} - \mathbf {d}_{D} \bigr)^{\!t}\cdot \\%
\mathbf {C}_{D}^{- 1} \bigl(\mathbf{g} (\mathbf{m}) - \mathbf{d}_{\mathrm{obs}} - \mathbf {d}_{D}\bigr)\Bigr)
\end{multline}

\end{document}