[Tex/LaTex] Prevent hyphenation and use line break in block of text

hyphenationline-breaking

I have a custom block of text on my title page which can be longer than a single line. By default LaTeX is hyphenating a word at the end of a line, but I want it to break on to the next line.

How do I force this to happen?

I know I can use \\ in the text, but I'm creating a standard template for a documents and I would prefer it to handle this edge case automatically instead of having to remember to break the text manually.

E.g.

This is my title longpiece-
oftext

should be

This is my title
longpieceoftext

Best Answer

See this answer in the UK TeX FAQ.

Three "easy" ways to prevent hyphenation for a text block (as opposed to the whole document) are:

  • Enclose the text block in a raggedright environment (this typesets the block raggedright and makes hyphenation very unlikely);

  • Enclose the text block in a group and set \hyphenpenalty and \exhyphenpenalty to 10000;

  • EDIT: Load the hyphenat package and write \nohyphens{(text block)}.

Minimal example:

\documentclass{article}

\usepackage[english]{babel}

\usepackage{hyphenat}

\usepackage{blindtext}

\textwidth 300pt

\begin{document}

\blindtext

\begin{raggedright}

\blindtext

\end{raggedright}

\begingroup
\hyphenpenalty 10000
\exhyphenpenalty 10000

\blindtext

\endgroup

\nohyphens{\blindtext}

\end{document}

EDIT 2: The biblatex package provides the additional commands \nohyphenation (which normally should be used inside a group) and \textnohyphenation{(text)}.

Related Question