I have been using \\ to start a new line in an align block:
\documentclass[12pt, a4paper, twoside, titlepage]{article}
\usepackage{amsmath}
\documentclass[12pt, a4paper, twoside, titlepage]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
&J(1)= & \text{Cost}\\
&\sum\limits_{i=1}^{m} (h_\Theta(x^i)-y^i)^2= & \text{Cost}\\
&\sum\limits_{i=1}^{3} (\Theta_1(x^i)-y^i)^2= & \text{Cost}\\
&\frac{1}{3}((1-1)^2+(2-2)^2+(3-3)^2)= & \text{Cost}\\
&\frac{1}{3}(0+0+0)= & \text{Cost}\\
&0
\end{align}
\end{document}
I've also seen this mark used in other code snippets like "How to align a set of multiline equations".
I am trying to write good Latex. However, I did not find any reference as to whether this newline mark is a good practice within an align block. Furthermore, some answers (like "Aligned equations in LaTeX") use a single blackslash (\). This seem to have the same effect, but does not work for me.
What's the right way to start a new line in an aligned block?
align, the right way to do it in fact – Au101 Mar 20 '17 at 21:58\\<newline>into a single backslash with no newline. We're trying to fix them, but they're quite a large number. If you find a doubtful one, please, make a comment at https://tex.meta.stackexchange.com/questions/7168/double-backslashes-disappear-from-code – egreg Mar 20 '17 at 21:58\\is the right answer? – Adam Matan Mar 20 '17 at 22:03\\is the right answer. Unfortunately the in-line markdown does funny things with backslashes, because the\is an escape character – Au101 Mar 21 '17 at 03:25texdoc <packagename>in a terminal is often the easiest way of finding it), so if you look inamsmath's docs, you'll see that\\is the way to go. @Au101 can write up an answer I suppose. – Torbjørn T. Mar 21 '17 at 19:33\\but with no spaces:\\I just wanted to make it absolutely clear =) – Au101 Mar 21 '17 at 19:38texdocand stuff =) – Au101 Mar 21 '17 at 19:39