Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

columns with itemize

I'm trying to make alignment points in a list environment. The following code gives me an error, but it almost compiles to what I want, just missing the bullet points. I must be misunderstanding something about align and/or tabular and how they work with linebreaks. Guidance appreciated!

\documentclass{beamer}

\begin{document}

\begin{frame}
    \frametitle{Title}
    \begin{itemize}
    \begin{tabular}{ll}
        \item Topic Apple: &Something to say about it \\
        \item Topic Watermelons: &Something different
    \end{tabular}
    \end{itemize}
\end{frame}

\end{document}
like image 339
evencoil Avatar asked Jan 22 '23 02:01

evencoil


1 Answers

How about this?

\documentclass{beamer}

\begin{document}

\begin{frame}
  \frametitle{Title}

\begin{tabular}{p{0.4\textwidth}p{0.5\textwidth}}

\begin{itemize}
     \item Topic Apple:
     \item Topic Watermelon:
  \end{itemize} &

\begin{itemize}
  \item[] Something to say about it
  \item[] Something to say about it
\end{itemize} \\

\end{tabular}

\end{frame}

\end{document}

Yours will actually work if you change {ll} to {p{width}l} or {p{width}p{width}} but I found that if you don't have itemize in the second column, your text ends up vertically top aligned while the itemized text in the left column is center (or maybe even slightly bottom) aligned vertically so it doesn't look good.

I tried using the array package and m{width} which provides a vertical center alignment but that was still different than whatever itemize is using. I'd say just play with the width argument inside of p{} to get the spacing/width you want. If your right column spills on to another line, you may need a "dummy" item in the right column.

Anyway, based on all the jimmy rigging that might be necessary if things spill onto two lines, I'm assuming my solution is potentially hackish but it looks like it provides what you want for the most part.

the \item[] for the right column is to create the same itemize alignment with no bullet. If you want bullets on the right, just remove the empty square brackets and you'll have them.

like image 119
Hendy Avatar answered Feb 07 '23 21:02

Hendy