16

In a document I have several multicols units, in which on one side there is an image and on the other side some information in a itemize.

Now, depending on the image / information, the two "sections" vary in their vertical size. Is there a possibility to center both parts inside that multicols unit?

For example I have

\begin{multicols}{2}
   \begin{figure}[H]
        \includegraphics[scale=0.7]{1bitalu.png}
    \end{figure}

    \vfill
    \columnbreak

    \begin{itemize}
        \item "Arithmetic Logical Unit" für mehrere Rechenarten
        \item Addition, Subtraktion, logisches AND / OR, Vergleich etc.
        \item Parallele "Berechnung" aller Operationen
        \item Selektion mit einem "Multiplexer"
        \item Selektion durch die Kontrolleinheit (Control Unit)
    \end{itemize}
\end{multicols}

which results in

enter image description here

but I want to have it like this

enter image description here

Is there an easy way to achieve this?

0

1 Answer 1

14

Here are two options, using multicol or array's m{<len>} column specification:

enter image description here

\documentclass{article}
\usepackage{graphicx,multicol}% http://ctan.org/pkg/{graphicx,multicol}
\usepackage{array}% http://ctan.org/pkg/array
\begin{document}
\begin{multicols}{2}
  \null \vfill
  \includegraphics[width=.8\columnwidth]{example-image-a}

  \vfill \null    
  \columnbreak

  \begin{itemize}
    \item ``Arithmetic Logical Unit'' f\"ur mehrere Rechenarten
    \item Addition, Subtraktion, logisches AND / OR, Vergleich etc.
    \item Parallele ``Berechnung'' aller Operationen
    \item Selektion mit einem ``Multiplexer''
    \item Selektion durch die Kontrolleinheit (Control Unit)
  \end{itemize}
\end{multicols}

\noindent
\begin{tabular}{@{}m{\dimexpr.5\textwidth-.5\columnsep}m{\dimexpr.5\textwidth-.5\columnsep}@{}}
  \centering\includegraphics[width=.8\linewidth]{example-image-a} &
  \begin{itemize}
    \item ``Arithmetic Logical Unit'' f\"ur mehrere Rechenarten
    \item Addition, Subtraktion, logisches AND / OR, Vergleich etc.
    \item Parallele ``Berechnung'' aller Operationen
    \item Selektion mit einem ``Multiplexer''
    \item Selektion durch die Kontrolleinheit (Control Unit)
  \end{itemize}
\end{tabular}
\end{document}

An m{<len>} column specification centers its content by placing the "anchor" in the middle vertically.

5
  • What is \null doing?
    – azetina
    Dec 11, 2012 at 0:45
  • 2
    @azetina: \null is defined in the LaTeX kernel latex.ltx as \def\null{\hbox{}}. It initiates horizontal mode, and therefore puts something on a line. Since vertical filling sometimes require "end points" in order to stretch, using \null is a viable option. It may not be necessary here, but it doesn't hurt.
    – Werner
    Dec 11, 2012 at 0:51
  • What other possibilities are there? Is \leavevmode one?
    – azetina
    Dec 11, 2012 at 0:53
  • @azetina: You can use \leavevmode, or \mbox{}. Not sure whether this answers your question.
    – Werner
    Dec 11, 2012 at 1:01
  • @Werner this is technically not quite correct: \null does not initiate horizontal mode, it stays in whatever mode you are in. All it does is to add an empty \hbox to the current mode which in this case is v-mode. It works alright in this case but this fact makes it a bit dangerous. The "LaTeX" way would probably be \vspace*{\stretch{1}} or \mbox{}\vfill Jan 3, 2013 at 16:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .