1

I've noticed that in Beamer a "Columns" environment placed inside an "itemize" environment does not respect the indentation for items:

\documentclass{beamer}
\begin{document}

\begin{frame}
\begin{itemize}
  \item item 1
    \begin{columns}[t] % contents are top vertically aligned
      \begin{column}{0.5\textwidth} 
        Contents of first column \\ split into two lines
      \end{column}
      \begin{column}{0.5\textwidth} 
        Contents of second column \\ split into two lines
      \end{column}
    \end{columns}
\item item 2    
\end{itemize}
\end{frame} % 

\end{document}

Is this behaviour normal ? Should not an indentation be included to align the columns to the item content ?

I know I can fix this by inserting in the beginning an empty column as:

\begin{column}{\leftmargini}
\end{column}

but I'm wondering whether there is a native, more elegant solution.

2
  • 1
    what about a tabular inside the item? Commented Jan 7, 2017 at 10:43
  • Not solving the problem, but your columns are too wide. They have to be less then 1 textwidth, as they come with small margins and a separation between the columns Commented Jan 7, 2017 at 12:44

1 Answer 1

2

I think, you should turn around the usage of the environments. On the outside, use columns-environment, to define the layout of that specific slide. Than fill your columns with contents, for example an itemize-environment.

The itemize-environment does not offer a columns-environment and hence must fail as it did in your example.

EDIT

As suggested: this is the usage with an tabular-like environment:

\documentclass{beamer}
\usepackage{tabularx}           % adapts columnwidth
\usepackage{array}              % for creating new columntypes
\usepackage{ragged2e}           % for line wrapping within words

%% Define a new column for your tabular in the itemize environment.
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}

\begin{document}

\begin{frame}
  \frametitle{Two columns in \texttt{itemize}}
  \begin{itemize}
  \item item 1
    \begin{tabularx}{\linewidth}{@{} *{2}{L} @{}} % @{} to remove
                                % white space at the left and right
                                % border of the table
      Contents of first column \newline split into two lines
   & Contents of second column \newline split into two lines 
    \end{tabularx}
  \item item 2    
  \end{itemize}
\end{frame}

\end{document}

And its result:

enter image description here

2
  • ok, but turning environments around does not make much sense in this case: conceptually, I have a list of items among which just one need a splitted layout ... Anyway what you're saying is that "columns" is an environment of the "frame" environments and so is not said to behave regularly inside an "itemize" environment ?
    – dario
    Commented Jan 7, 2017 at 11:29
  • @dario: You are correct. It is an environment of the frame and not of itemize. If you need two or more columns in your itemize-environment, you'll have to try another approach, for example a tabular-environment.
    – Jan
    Commented Jan 7, 2017 at 11:49

You must log in to answer this question.

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