Time for action – using the minipage environment

We will use the minipage environment instead of \parbox to get a text with a width of just 3 cm.

  1. Modify the parbox example to get the following code:
    \documentclass{article}
    \begin{document}
    \begin{minipage}{3cm}
    TUG is an acronym. It means \TeX\ Users Group.
    \end{minipage}
    \end{document}
  2. Typeset and look at the output:
    Time for action – using the minipage environment

What just happened?

By using \begin{minipage}, we started a "page in a page". We specified the width of 3cm by the mandatory argument. From this point onwards, the text lines will have a width of 3cm. They will be automatically wrapped and fully justified. We ended this restriction with ...

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.