# How do I split a long equation with equal sign on new line? [duplicate]

I have a long equation that must fit in a two-column journal. I know how to break up the right-hand terms nicely, but even so it won't fit and I need the equal signs to start on a new line, but I can't figure out how to do it nicely.

Here is what I've tried:

\begin{align*}
p(\{K_{\text{pre}},\theta_{\text{b,pre}},\sigma_{\text{pre}},K_{\text{post}},\theta_{\text{b,post}},\sigma_{\text{post}}\}\mid D)\\
\begin{split}=\phantom{} & p(\{K_{\text{pre}},\theta_{\text{b,pre}},\sigma_{\text{pre}}\}\mid D)\\
& \times p(\{K_{\text{post}},\theta_{\text{b,post}},\sigma_{\text{post}}\}\mid D)
\end{split}
\\
\begin{split}=\phantom{} & p(\{K_{\text{pre}},\theta_{\text{b,pre}},\sigma_{\text{pre}}\}\mid D_{\text{pre}})\\
& \times p(\{K_{\text{post}},\theta_{\text{b,post}},\sigma_{\text{post}}\}\mid D_{\text{post}})
\end{split}
\end{align*}


and the result:

Ideally I guess the right-hand lines should be "moved" to the left, but I'm not sure how to do that. I've seen the answers to How can I split an equation over two lines but here the first equal sign must come on a new line.

## marked as duplicate by Mico, Maarten Dhondt, Troy, TeXnician, CarLaTeXJun 15 '17 at 8:57

• Add & before p(\{K_{pre}.....) – Michael Fraiman Jun 15 '17 at 7:43

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
p(\{K_{\text{pre}},&\theta_{\text{b,pre}},\sigma_{\text{pre}},K_{\text{post}},\theta_{\text{b,post}},\sigma_{\text{post}}\}\mid D)\\
=& p(\{K_{\text{pre}},\theta_{\text{b,pre}},\sigma_{\text{pre}}\}\mid D)\\
& \times p(\{K_{\text{post}},\theta_{\text{b,post}},\sigma_{\text{post}}\}\mid D)\\
= & p(\{K_{\text{pre}},\theta_{\text{b,pre}},\sigma_{\text{pre}}\}\mid D_{\text{pre}})\\
& \times p(\{K_{\text{post}},\theta_{\text{b,post}},\sigma_{\text{post}}\}\mid D_{\text{post}})
\end{align*}
\end{document}


Apparently the alignment is valid in both {align} and {split}, so you can add a single one in the left-hand side of your equation.

EDIT: As Mico noted, you can remove the {split} environment. The output is the same.

• Since the OP's code is using an align* environment, you may want to show how the code might be simplified by doing away with both split environments. – Mico Jun 15 '17 at 7:53

I guess you're using a two column format, or you wouldn't need such splitting.

You can use aligned for the bottom part:

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

\usepackage{lipsum} % just for the example

\newcommand{\ts}[1]{\mathrm{#1}} % better than \ts

\begin{document}

\lipsum*[2]
\begin{align*}
& p(\{
K_{\ts{pre}},\theta_{\ts{b},\ts{pre}},\sigma_{\ts{pre}},
K_{\ts{post}},\theta_{\ts{b},\ts{post}},\sigma_{\ts{post}}
\}\mid D
)
\\
&= p(\{K_{\ts{pre}},\theta_{\ts{b,pre}},\sigma_{\ts{pre}}\}\mid D)\\

I did some changes to your input. The first is using \mathrm instead of \text: with the latter, if your formula happens to be in a theorem statement, the subscripts would be set in italics.
The second is to split \ts{b,post} and similar into two, for consistency.