4

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. enter image description here

  • 1
    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). – Paul Gessler 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. – gernot Oct 16 '16 at 17:36
14

Use the microtype package and/or modify \emergencystretch:

enter image description here

\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}
| improve this answer | |
  • I think both solution works fine, but this solution I can mirco-modify the emergencystretch, which will give me more choices. Thank you! – Coeus Wang 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 – David Carlisle 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. – Martin Schröder Oct 17 '16 at 5:15
5

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}

enter image description here

| improve this answer | |
  • 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. – Coeus Wang Oct 16 '16 at 17:36
  • +1 for noticing the R, I'd better update my answer! – David Carlisle 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\ . – gernot Oct 16 '16 at 17:41
  • 1
    \sloppy is never a solution, especially not in the preamble. ragged2e would be much better. – Martin Schröder 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. :) – Coeus Wang Oct 17 '16 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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