Time for action – justifying a paragraph to the left

Remember the first parbox example which was fully justified but had those big gaps between the words. We shall give up justification to the right side to avoid such gaps.

  1. Create a new document containing these lines:
    \documentclass{article}
    \begin{document}
    \parbox{3cm}{\raggedright
        TUG is an acronym. It means \TeX\ Users Group.}
    \end{document}
  2. Typeset and look at the output:
    Time for action – justifying a paragraph to the left

What just happened?

We inserted the declaration \raggedright . From this point onwards, the text will be ragged-right. In other words, the text will be moved to the left margin - "flushed-left". There won't be hyphenation.

Because ...

Get LaTeX Beginners Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.