# How can I make LaTeX break the word at the end of line more beautiful?

For some reason, I would like to output a very small page pdf file, like 2.7in * 4.5in. However, with such a small page layout, there are words in the last of some lines is always outside the text area. Here is an example:

\documentclass[12pt,oneside]{book}

\usepackage[
showframe,
paperwidth=2.75in,
paperheight=4.9in,
left=0.1in,
right=0.1in,
top=0.1in,
bottom=0.18in,
footskip=10pt
]{geometry}

\begin{document}
PMI® is the leader and the most widely recognized organization in terms of promoting project management best practices. PMI® strives to maintain and endorse standards and ethics in this field and offers publications, training, seminars, chapters, special interest groups, and colleges to further the project management discipline.
\end{document}


Is there anyway I can make it more aligned? Thank you in advance.

• With such a narrow text block width, often left-alignment can look better than full justification. Otherwise, \usepackage{microtype} (read the package documentation for recommendations and settings) can improve the appearance (sorry, I'm not using a machine with a TeX installation at the moment, so I can't test it myself). Oct 16 '16 at 16:49
• Related/duplicate: Temporarily increase the limit on space size?
– Werner
Oct 16 '16 at 17:31
• Compare the two answers below (using \sloppy and microtype, respecticely) without the showframe option of the geometry package. The microtype version presumably looks more even on the right margin than the sloppy version, even though some of the signs transcend the border. Oct 16 '16 at 17:36

Use the microtype package and/or modify \emergencystretch:

\documentclass[12pt,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage[
showframe,
paperwidth=2.75in,
paperheight=4.9in,
left=0.1in,
right=0.1in,
top=0.1in,
bottom=0.18in,
footskip=10pt
]{geometry}

\setlength\emergencystretch{3em}
\usepackage{microtype}
\begin{document}
PMI® is the leader and the most widely recognized organization in terms of promoting project management best practices. PMI® strives to maintain and endorse standards and ethics in this field and offers publications, training, seminars, chapters, special interest groups, and colleges to further the project management discipline.
\end{document}

• I think both solution works fine, but this solution I can mirco-modify the emergencystretch, which will give me more choices. Thank you! Oct 16 '16 at 17:35
• In this case, the \emergencystretch without microtype seem enough.
– Fran
Oct 16 '16 at 22:06
• yes I'm not sure why @MartinSchröder edited the answer to highlight microtype only Oct 16 '16 at 23:21
• @DavidCarlisle: Then why don't you edit your answer to explain your code more? I dislike code-only answers. Oct 17 '16 at 5:15

Add the declaration \sloppy to your preamble. Moreover, you should use \usepackage[utf8]{inputenc} in the preamble because of the registered-trade-mark sign that is invisible otherwise (you may have to replace utf8 by your encoding).

\documentclass[12pt,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage
[showframe,
paperwidth=2.75in,
paperheight=4.9in,
left=0.1in,
right=0.1in,
top=0.1in,
bottom=0.18in,
footskip=10pt
]{geometry}
\sloppy
\begin{document}
PMI® is the leader and the most widely recognized organization in
terms of promoting project management best practices. PMI® strives to
maintain and endorse standards and ethics in this field and offers
publications, training, seminars, chapters, special interest groups,
and colleges to further the project management discipline.
\end{document}


• This does works, but the output seems a little loose for the text. Thank you. I will read the inputenc package to see if there is any better solutions. Oct 16 '16 at 17:36
• +1 for noticing the R, I'd better update my answer! Oct 16 '16 at 17:41
• @CoeusWang If you want to keep the registered-trademark-sign but don't want to enable a particular input encoding, use the \textregistered command, i.e., drop the line \usepackage[utf8]{inputenc} and replace the two occurrences of ®  by \textregistered\ . Oct 16 '16 at 17:41
• \sloppy is never a solution, especially not in the preamble. ragged2e would be much better. Oct 16 '16 at 21:17
• @gernot, Thanks a lot for your remind! Yes I know to use \textregistered in text, since this is not the focus point for this question, I didn't implement it in the MWE. :) Oct 17 '16 at 2:54