Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have following code:

\section{This is some long text and probably it will be broken}

I would like to prevent word division like:

This is some long text and pro-
bably it will be broken

And the second issue is to break it in a nice way, for example:

This is some long text and probably it will be
broken

looks bad, because only word 'broken' will be placed in second line. It would be nicer to do it in this way:

This is some long text and probably
it will be broken
share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

You can use a manual line change in the title (and the optional argument of the \section command to prevent the line change from appearing in the headings and in the ToC). Another option would be to use the \sloppy command and non-breaking spaces (but this will probably produce a bad box):

\documentclass{article}

\begin{document}
\tableofcontents

\section[This is some long text and probably it will be broken]{This is some long text and probably\\ it will be broken}

\section{\sloppy This is some long text and probably it~will~be~broken}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.