O'Reilly logo

LaTeX Beginners Guide by Stefan Kottwitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required