How can I mix itemize and tabular environments?

I have the following list:

\begin{itemize}
\item És associativa:$\qquad(x+y)+z=x+(y+z)$
\item És commutativa:$\qquad x+y=y+x$
\item Té element neutre:$\qquad\exists 0\in\K : 0+x=x+0=x$
\item Té element invers:$\qquad\forall x\in\K\;\exists(-x)\in\K : x+(-x)=(-x)+x=0$
\end{itemize}


But I want to align that like

\begin{tabular}{ll}
És associativa:&$\quad(x+y)+z=x+(y+z)$\\
És commutativa:&$\quad x+y=y+x$\\
Té element neutre:&$\quad\exists 0\in\K : 0+x=x+0=x$\\
Té element invers:&$\quad\forall x\in\K\;\exists(-x)\in\K : x+(-x)=(-x)+x=0$\\
\end{tabular}


How can I "mix" them?

-
Welcome to TeX.sx! What do you exactly want? The bullets of the itemize list in your table? You can add them in a separat row ... –  Kurt Oct 7 '12 at 17:28
@Kurt Yes, I want the bullets like in the first code, but the text after the : left-aligned too like in the second one. How can I do that? I am a latex newby... –  Oriol Oct 7 '12 at 17:36

Here is a minor enhancement to Kurt's solution.

Using the array package you can define a new column type L which automatically inserts the bullet at the start of the column in which it is used:

Notes:

• This could also be done with the collcell package. This commented out in the code below, but that would only make sense if there was further processing you wanted to do with the entries in the first column.

Code:

\documentclass[a5paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}  % add packages you need here ...

\usepackage{array}
\newcolumntype{L}{>{\labelitemi~~}l<{}}

%% Don't need above two lines if want to use collcell pacakage
%\usepackage{collcell}

\newcommand*{\K}{\mathbf{K}}%  Not sure what \K is supposed to be

\begin{document}
\begin{tabular}{L l}
És associativa:    & $\quad(x+y)+z=x+(y+z)$\\
És commutativa:    & $\quad x+y=y+x$\\
Té element neutre: & $\quad\exists 0\in\K : 0+x=x+0=x$\\
Té element invers: & $\quad\forall x\in\K\;\exists(-x)\in\K : x+(-x)=(-x)+x=0$\\
\end{tabular}
\end{document}

-
Thanks, it works! But in my case the list is inside another list, so I have used \newcolumntype{L}{>{\labelitemii~~}l<{}}. Is there a way to make it recognize automatically the level of the list? –  Oriol Oct 7 '12 at 18:54
I don't know how to do that, but that would be a excellent separate question to ask here as it may be useful to know in situations other than this specific case. –  Peter Grill Oct 8 '12 at 3:27

There is no requirement for intermixing the two environments if you manage some of the box widths yourself. The following MWE shows an environment myitemize - based on itemize, that breaks across the page boundary and sets the width of an item (\myitemlen) if it's set at the beginning of the environment. Otherwise, it takes the natural width of each specified item.

\documentclass{article}
\usepackage[utf8]{inputenc}% http://ctan.org/pkg/inputenc
\newlength{\myitemlen}
\newcommand{\myitem}[1]{%
\olditem\ifdim\myitemlen>0pt
\makebox[\myitemlen][l]{#1}%
\else
#1%
\fi}
\newenvironment{myitemize}
{% \begin{myitemize}
\begin{itemize}\let\olditem\item\let\item\myitem}
{\end{itemize}}% \end{myitemize}
\newcommand{\K}{\mathbf{K}}
\begin{document}
\begin{myitemize}
\item{És associativa:} $(x+y)+z=x+(y+z)$
\item{És commutativa:} $x+y=y+x$
\item{Té element neutre:} $\exists 0\in\K : 0+x=x+0=x$
\item{Té element invers:} $\forall x\in\K\;\exists(-x)\in\K : x+(-x)=(-x)+x=0$
\end{myitemize}

\begin{myitemize}
\item{És associativa:} $(x+y)+z=x+(y+z)$
\item{És commutativa:} $x+y=y+x$
\item{Té element neutre:} $\exists 0\in\K : 0+x=x+0=x$
\item{Té element invers:} $\forall x\in\K\;\exists(-x)\in\K : x+(-x)=(-x)+x=0$
\end{myitemize}

\end{document}

-
Thanks, but if I change the texts later maybe the widest one will be another item, istead of "Té elemetn neutre:" –  Oriol Oct 7 '12 at 18:16
@Oriol: Exactly. And you can change that again. It would be possible to modify the environment into something different (like myitemize) so that you specify the text that is the widest every time you use it. enumitem can also be employed here. Note that a tabular will not break across the page boundary, while a regular itemize will. –  Werner Oct 7 '12 at 18:22
@Oriol: I've updated my answer to be a little more user-friendly. :) –  Werner Oct 8 '12 at 6:59

You can do it like this (\textbullet inserts the bullet, and you have to mark the new row with a &. To be more flexible you can use \labelitemi instead of \textbullet as Juri said in his comment):

%http://tex.stackexchange.com/questions/75717/how-can-i-mix-itemize-and-tabular-environments#comment161963_75717
\documentclass[a5paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}  % add packages you need here ...

\begin{document}
\begin{tabular}{lll}
\labelitemi & És associativa:&$\quad(x+y)+z=x+(y+z)$\\
\labelitemi & És commutativa:&$\quad x+y=y+x$\\
\labelitemi & Té element neutre:&$\quad\exists 0\in\K : 0+x=x+0=x$\\
\labelitemi & Té element invers:&$\quad\forall x\in\K\;\exists(-x)\in\K : x+(-x)=(-x)+x=0$\\
\end{tabular}
\end{document}

-
@Kurt Thanks, it works! But in my case the list is inside another list, so I have used \labelitemii. Is there a way to make it recognize automatically the level of the list? –  Oriol Oct 7 '12 at 18:25
If you put \def\curlabelitem{\csname\csname @itemitem\endcsname\endcsname} in your preamble, you can then use \curlabelitem and it will point out to the correct thing at every place. –  tohecz Oct 7 '12 at 19:11
@tohecz It throws errors. Must I include any package? –  Oriol Oct 7 '12 at 19:34
Well, you might want to use \\[\itemsep] instead of \\  to get the proper spacing. –  tohecz Oct 7 '12 at 19:37
@Oriol oh sorry, things might be a bit more complicated. I forgot you're not in the list. It should be: \makeatletter \def\curlabelitem{\begingroup\advance\@itemdepth\@ne\csname labelitem\romannumeral\the\@itemdepth\endcsname\endgroup} \makeatother –  tohecz Oct 7 '12 at 19:41
show 1 more comment