In ordinary text, this ends a line in a way that does not right-justify the line, so the prior text is not stretched. That is, in paragraph mode (see Modes), the \newline
command is equivalent to double-backslash (see \\). This command is fragile (see \protect).
However, the two commands are different inside a tabular
or array
environment. In a column with a specifier producing a paragraph box such as typically p{...}
, \newline
will insert a line end inside of the column; that is, it does not break the entire tabular row. To break the entire row use \\
or its equivalent \tabularnewline
.
This will print ‘Name:’ and ‘Address:’ as two lines in a single cell of the table.
\begin{tabular}{p{1in}{\hspace{2in}}p{1in}} Name: \newline Address: &Date: \\ \hline \end{tabular}
The ‘Date:’ will be baseline-aligned with ‘Name:’.
© 2007–2018 Karl Berry
Public Domain Software
http://latexref.xyz/_005cnewline.html