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.

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

share|improve this question
    
@lockstep: I suggest the tag macro ;-) –  Marco Daniel Apr 19 '12 at 17:36
add comment

1 Answer 1

up vote 10 down vote accepted

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

share|improve this answer
    
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
add comment

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.