1

I want to make a comparison using tabu environment with two columns. In order to make it look nicely, each column should look like two lists like in an itemize environment (so I use X columns). The first problem is that if I use itemize, the bullet points are not next to each other, but shifted, as shown here in this example:

\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{tabu}

\begin{document}

\begin{tabu} to \textwidth {X[1,l] | X[1,l]}
Advantages & Disadvantages\\
\hline\\
\begin{itemize}
\item Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage
\item Another advantage Another advantage Another advantage Another advantage Another advantage Another advantage 
\end{itemize}
&
\begin{itemize}
\item Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage
\item Another disadvantage Another disadvantage Another disadvantage Another disadvantage Another disadvantage 
\end{itemize}
\end{tabu}

\end{document}

On the other hand, if use $\bullet$, then there is no indentation, as you can see here:

\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{tabu}

\begin{document}

\begin{tabu} to \textwidth {X[1,l] | X[1,l]}
Advantages & Disadvantages\\
\hline\\
$\bullet$ Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage
&
$\bullet$ Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage\\
$\bullet$ Another advantage Another advantage Another advantage Another advantage Another advantage Another advantage 
&
$\bullet$ Another disadvantage Another disadvantage Another disadvantage Another disadvantage Another disadvantage
\end{tabu}

\end{document}

So what I tried is to use more columns and adapt their spacing. Here is what I mean:

\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{tabu}

\begin{document}

{\tabulinesep=2mm
\begin{tabu} to \textwidth {X[1,l] X[200,l] | X[1,l] X[200,l]}
Advantages & & Disadvantages &\\
\hline
$\bullet$ & Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage
&
$\bullet$ &Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage\\
$\bullet$ & Another advantage Another advantage Another advantage Another advantage Another advantage Another advantage 
&
$\bullet$ & Another disadvantage Another disadvantage Another disadvantage Another disadvantage Another disadvantage
\end{tabu}
}
\end{document}

However, this is a very, very, very, very bad hack... is there a more elegant solution?

Martin

2 Answers2

1

Much simpler: set the parameters for itemize inside tabu with enumitem and etoolbox. I added a trick stolen on this site to have unwanted vertical spacing at the top of cells containing lists:

\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{tabu}
\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{tabu}{\setlist[itemize]{wide = 0pt, leftmargin = *}}

    \makeatletter
    \newcommand*{\compress}{\@minipagetrue}
    \makeatother

\begin{document}

\begin{tabu} to \textwidth {>{\compress}X[1,l] | >{\compress}X[1,l]}
  Advantages & Disadvantages \\
  \hline \\
  \begin{itemize}
    \item Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage
    \item Another advantage Another advantage Another advantage Another advantage Another advantage Another advantage
  \end{itemize}
             &
  \begin{itemize}
    \item Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage
    \item Another disadvantage Another disadvantage Another disadvantage Another disadvantage Another disadvantage
  \end{itemize}
\end{tabu}

\end{document} 

enter image description here

Bernard
  • 271,350
1

This is closer to your approach. \labelsep is the distance used by itemize.

\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{tabu}

\begin{document}

{\tabulinesep=2mm
\begin{tabu} to \textwidth {l@{\hspace{\labelsep}}Xl@{\hspace{\labelsep}}X}
\multicolumn{2}{l}{Advantages} & \multicolumn{2}{l}{Disadvantages} \\
\hline
\textbullet & Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage Advantage
&
\textbullet &Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage Disadvantage\\
\textbullet & Another advantage Another advantage Another advantage Another advantage Another advantage Another advantage 
&
\textbullet & Another disadvantage Another disadvantage Another disadvantage Another disadvantage Another disadvantage
\end{tabu}
}
\end{document}

demo

John Kormylo
  • 79,712
  • 3
  • 50
  • 120