LaTeX line break

StartSearchLaTeX for Beginners F.A.Q.LaTeX faqLaTeX topicsfont sizearrowsminipageitalicsboldtext colormatrixfontslistingstables

LaTeX line break

The line break occurs like the page break automatically. In general, the automatic line break also provides a very good result. However, there are a few places where the automatic line break is not very useful, for example between a name and a name extension or within a formula.

1.1 Prevent line breaks

Füin the event that LaTeX is to be prevented from separating between two specific consecutive words, the solution is a protected space ~ . This space is placed between the words. For example Dr.~Miller instead of Dr. Miller. The protected space does not prevent the line break. But there is no line break at the place where the protected space is.

To prevent a line break within a formula, the formula can be grouped. To do this, the beginning of the formula is provided with a opening curly bracket ({) and the end with a closing bracket (}). So $a^{2} + b^{2} = c^{2}$ becomes the expression ${a^{2} + b^{2} = c^{2}}$ and within this group there is no more line break. The additional brackets will not be displayed in the finished document.

nolinebreak 

To prevent a line break at a certain point the \nolinebreak command can be used. This command has an optional value that can be between 0 and 4. The default value is 4. The higher the value, the more likely a line break is prevented at this point.

1.2 set a line break

For the manual line break three different commands \\, \newline and \linebreak are available. However, only \\ and \linebreak have a practical meaning for the line break within the text, while \newline is mainly used in tables within p-columns for a line break.

\\

The command \\ inserts a line break at the position where it was set. This is also done within a closed paragraph. The command has an optional element \\[value / height], so it is possible to insert an additional space between the finished line and the following line, for example with \\[12pt] a empty line is inserted after the line break.

\\* 

If the star varinate of the command \\* is set, a possible page break is prevented. Also for this variant the optional element \\*[value / height] exists with the same properties as in the starless variant.

linebreak  

The command \linebreak inserts a line break at the place where it was set, like \\. The difference between \\ and \linebreak is that the line before the break is a margin alignment is used. The type of compensation depends on the used type of text alignment. With justification, the standard text alignment, the remaining text or words in the line are pulled apart until the line is completely filled. If the text is left-justified, the content is set closed to the left. If the text is right-justified, the content is set to the right. And in the case that the text is centered, the remaining content of the line is also centered. The command has an optional value \linebreak[value], which can be set between 0 and 4. The default value is 4. The higher the value is set, the more likely the line break is to be set.

newline

The \newline command is mainly used within tables. So its use allows to set a line break within the p-columns. Apart from this case, \\ should be used instead of \newline.

\begin{tabular}{p{4cm}ll}
That is one table \newline with three columns 
and the first column \newline has a fixed width & column 2  & column 3\\ 
Contents 1  & Contents 2 & Contents 3\\
\end{tabular}

That is one table with three columns and the first column has a fixed widthcolumn 2 column 3
Contents 1 Contents 2 Contents 3

Contact   Privacy Policy   disclosures

accept decline

This website uses cookies and pixel tags to ensure you get the best experience on our website. By using this website, you consent to the use of cookies.learn more about cookies see also our privacy policy