7

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.

enter image description here

1
  • @lockstep: I suggest the tag macro ;-) Apr 19, 2012 at 17:36

1 Answer 1

10

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.

Instead use:

\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}

enter image description here

3
  • perfect! I was struggling with this for hours and had no clue where is the source :)
    – Googlebot
    Apr 19, 2012 at 17:39
  • @Ali: If it works please accept my answer ;-) One unanswered question less which is tagged with mdframed ;-) Apr 19, 2012 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!
    – Googlebot
    Apr 19, 2012 at 17:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .