Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

If I create a table with several (short) lists, currently I'm using a table construction with enumitem to (almost) remove the left margin. Now I still have a rather large margin at the top and the bottom (above and below) of the itemize lists.

Is there any way I can instruct either the itemize list or the table to remove this margin as well?

Code example:

\begin{tabular}{|m{3cm}|p{5.5cm}|p{5.5cm}|}
   \hline
    Category 2 &
    \begin{itemize}[leftmargin=*]
        \item A
        \item B
    \end{itemize} &
    \begin{itemize}[leftmargin=*]
        \item C
        \item F
    \end{itemize} \\
   \hline
\end{tabular}
share|improve this question
    
Is there a reason why you need a list environment inside tabular? For example, you could just use \textbullet~A and separate them by \par or even `\`? It will give a tight spacing yes seem to be list-like. –  Werner Jul 19 '12 at 19:10
    
Using the nolistsep option for the inner itemize environments helps, but will still leave some space. –  Gonzalo Medina Jul 19 '12 at 19:44

1 Answer 1

up vote 5 down vote accepted

Here are some options to work with, as alternative to using a list inside a tabular:

enter image description here

\documentclass{article}
\usepackage{array}% http://ctan.org/pkg/array
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
Original: \par
\begin{tabular}{|m{3cm}|p{5.5cm}|p{5.5cm}|}
   \hline
    Category 2 &
    \begin{itemize}[leftmargin=*]
        \item A Here is some text that should wrap inside the list
        \item B Here is some text that should wrap inside the list
    \end{itemize} &
    \begin{itemize}[leftmargin=*]
        \item C Here is some text that should wrap inside the list
        \item D Here is some text that should wrap inside the list
    \end{itemize} \\
   \hline
\end{tabular}

\verb|\textbullet| option: \par
\begin{tabular}{|m{3cm}|p{5.5cm}|p{5.5cm}|}
   \hline
    Category 2 &
    \textbullet~A Here is some text that should wrap inside the list \par
    \textbullet~B Here is some text that should wrap inside the list &
    \textbullet~C Here is some text that should wrap inside the list \par
    \textbullet~F Here is some text that should wrap inside the list \\
   \hline
\end{tabular}

Nested \verb|tabular| option: \par
\begin{tabular}{|m{3cm}|l|l|}
   \hline
    Category 2 &
    \begin{tabular}{@{\textbullet~}p{5cm}@{}}
      A Here is some text that should wrap inside the list \\
      B Here is some text that should wrap inside the list
    \end{tabular} &
    \begin{tabular}{@{\textbullet~}p{5cm}@{}}
      C Here is some text that should wrap inside the list \\
      F Here is some text that should wrap inside the list
    \end{tabular} \\
   \hline
\end{tabular}
\end{document}​

It is possible to modify the last option to be exactly 5.5cm in width. The above example merely illustrates list alternatives that adhere to tight spacing while simulating the list look/feel.

share|improve this answer
    
Thanks for showing me these options, as I'm quite a latex newbie, I did not know about the textbullet option which seems quite appropriate for my usage. :-) –  Matthias Jul 22 '12 at 9:53
    
And there are no other options using the itemize environment? The textbullet option does not work to indent multiline entries, and creating a table is rather cumbersome... thank you! –  strauberry Jul 24 at 11:28
    
@strauberry: You can use itemize and play with the vertical spacing lengths. –  Werner Jul 24 at 14:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.