# Using enumitem inside mdframed

I tried to use enumitems within mdframed as

\documentclass{article}
\usepackage{mdframed}
\usepackage{enumitem}
\usepackage{pifont}

\newcommand{\pitem}[1]{{\item {\small #1}}}

\begin{document}
\begin{mdframed}

\begin{itemize}[label=\ding{70}]
\pitem{Item}
\pitem{Item}
\pitem{Item}
\end{itemize}
\hrule
\begin{itemize}[label=\ding{80}]
\pitem{Item}
\pitem{Item}
\end{itemize}
\hrule
\begin{itemize}[label=\ding{90}]
\pitem{Item}
\pitem{Item}
\end{itemize}
\hrule
\begin{itemize}[label=\ding{212}]
\pitem{Item}
\pitem{Item}
\end{itemize}

\end{mdframed}
\end{document}


but striangly (at least to me), the first two sets of itemize will NOT work properly, but from the third set, everything is fine.

-
@lockstep: I suggest the tag macro ;-) –  Marco Daniel Apr 19 '12 at 17:36

The problem doesn't belong to any of your tagged packages. It belongs to your definition of pitem. You can't put item in an extra group.

\newcommand{\pitem}[1]{\item {\small #1}}


Here the complete code:

\documentclass{article}
\usepackage{mdframed}
\usepackage{enumitem}
\usepackage{pifont}

\newcommand{\pitem}[1]{\item {\small #1}}

\begin{document}
\begin{mdframed}

\begin{itemize}[label=\ding{70}]
\pitem{Item}
\pitem{Item}
\pitem{Item}
\end{itemize}
\hrule
\begin{itemize}[label=\ding{80}]
\pitem{Item}
\pitem{Item}
\end{itemize}
\hrule
\begin{itemize}[label=\ding{90}]
\pitem{Item}
\pitem{Item}
\end{itemize}
\hrule
\begin{itemize}[label=\ding{212}]
\pitem{Item}
\pitem{Item}
\end{itemize}

\end{mdframed}
\end{document}


-
perfect! I was struggling with this for hours and had no clue where is the source :) –  All Apr 19 '12 at 17:39
@Ali: If it works please accept my answer ;-) One unanswered question less which is tagged with mdframed ;-) –  Marco Daniel Apr 19 '12 at 17:43
Actually I tried to do this, but stackexchange does not allow accepting answer before 10-15min of the question date. Probably, SE had no idea of super-quick supporters like you ;) Your support is as perfect as your work on mdframed. This is the reason that I preferred to use mdframed instead of standard section`. Thanks again for your support and excellent work! –  All Apr 19 '12 at 17:51