# How to start a new line in an equation using $$So I have got a pretty complex equation (with different types of brackets) and it's too long, so I want to break the equation up to start a new line. The equation is: \begin{document}$$
Cl_f(\vec x):=\min\left\lbrace a\in\{1,\cdots,m\} : p_a Tr(F^{(n)}_a\rho^{(n)}_{\vec{x}})=\max_j\left\lbrace p_j Tr ( F^{(n)}_j\rho^{(n)}_{\vec{x}}), 1\le j\le m \right\rbrace\right\rbrace. \notag
$$\end{document}  How do I start a new line in the equation when using $$? Say for eg., I want to break the equation up to start a new line after the colon sign (:), just before p_a. I would like the output to look something like:

Cl_f(\vec x):=\min\left\lbrace a\in\{1,\cdots,m\} :
p_a Tr(F^{(n)}_a\rho^{(n)}_{\vec{x}})=\max_j\left\lbrace p_j Tr ( F^{(n)}_j\rho^{(n)}_{\vec{x}}), 1\le j\le m \right\rbrace\right\rbrace. \notag


I have tried using \begin{align*} but it's giving me funny error messages in the log (which I think it's to do with the bracket calls). I am good to use , \begin{align*} or any other method as long as I can get the output that I am after, with minimal packages that I need to load if possible. ## 2 Answers •  syntax for math environment is used in plain TeX, not in LaTeX, where is used $ and $ instead.
• For multiline math expression you need to use some of the amsmath packages environments: align, gather, etc.
• Your equations contain errors (unpaired braces)

An working example with your equations can be:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align*}
Cl_f(\vec x)
& := \min\Bigl(a\in\{1,\cdots,m\} : p_a Tr\Bigl(F^{(n)}_a\rho^{(n)}_{\vec{x}}\Bigr) \Bigr)  \\
&  = \max_j\Bigl(p_j Tr \Bigl( F^{(n)}_j\rho^{(n)}_{\vec{x}}\Bigr)\Bigr),
\quad 1\le j\le m.
\end{align*}
\end{document}


which gives:

Addendum: According to your comments below, I guess that you looking for the following:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align*}
Cl_f(\vec x) := {}
& \min\Bigl(a\in\{1,\cdots,m\} : \\
& \,p_a Tr\Bigl(F^{(n)}_a\rho^{(n)}_{\vec{x}}\Bigr) \Bigr)
= \max_j\Bigl(p_j Tr \Bigl( F^{(n)}_j\rho^{(n)}_{\vec{x}}\Bigr)\Bigr),
\quad 1\le j\le m.
\end{align*}
\end{document}


• Hi @Zarko, thanks! How do I start a new line after the colon sign (:), just before p_a? Mar 29, 2021 at 7:41
• @Leockl, on the same way as is started the second equation line. See addendum to answer (will appear ASAP). Mar 29, 2021 at 7:43
• Thanks @Zarko for the updated addendum, but in doing so you have added an extra = sign right after the colon sign. I would really like to make the equation look like in the 2nd grayed out box in my original post/question above (ie. on 2 lines only). Really appreciate your help. Mar 29, 2021 at 8:00
• @Leockl, your comment wasn't so clear ... hopefully now you have what you after. Mar 29, 2021 at 9:04
• @Leockl, as you can see from equation code, in it instead \left\lbrace and \right\rbrace are used Bigl( and \Bigr). However, you can use \left( and \right) if the both are on the same side of equations (between them had not to be ampersand). Mar 29, 2021 at 10:22

You could use the multline* environment, as in:

\begin{document}
\begin{multline*}
Cl_f(\vec x):=\min\left\lbrace a\in\{1,\cdots,m\} : p_a Tr(F^{(n)}_a\rho^{(n)}_{\vec{x}})=\\=\max_j\left\lbrace p_j Tr ( F^{(n)}_j\rho^{(n)}_{\vec{x}}), 1\le j\le m \right\rbrace\right\rbrace. \notag
\end{multline*}
\end{document}

• your first sentence seems to imply that you can use \\  in $$, which is not the case. Mar 29, 2021 at 7:31 • Hi @José Carlos Santos, do you mean if I use multline*, then I would be able to use \ to start a new line? Mar 29, 2021 at 7:44 • Yes, that is what I meant. Mar 29, 2021 at 7:53 • \\  doesn't work in $$ or \[ Mar 29, 2021 at 9:40
• @DavidCarlisle Thank you. I've edited my answer. Mar 29, 2021 at 9:44