[Tex/LaTex] Display certain objects in a document side by side

floatspositioning

What is the standard way in latex to display certain objects (e.g. pictures, tables, etc.) side by side, instead of one below the other?
I thought about using the tabular environment for this, but I'm not sure if there isn't a better way.

Best Answer

The standard LaTeX way is minipages.

In order to make sure that your multiple minipages end up on the same line, their horizontal dimensions have to add up to something less than the current \textwidth. So if I care about lining them up, I often use multiples of \textwidth as the minipage widths. Such as

\documentclass{article}
\usepackage{lipsum} % just for demonstration

\begin{document}
\noindent
\begin{minipage}[t]{0.3\textwidth}
  \lipsum[1]
\end{minipage}
\hfill
\begin{minipage}[t]{0.6\textwidth}
  \lipsum[2-3]
\end{minipage}

\end{document}

The \hfill control sequence inserts an infinitely stretchable amount of glue between the minipages—effectively pushing the second one all the way to the edge of the line. Since the total widths of the boxes is 0.9\textwidth, you get a separation of 0.1\textwidth between the minipages.

Another method is the multicol package, but that's mainly for columns of text side-by-side.

Related Question