I would like to understand (and to find a solution for it) the following problem. First, the MWE :
\documentclass{article}
\usepackage{mdframed}
\usepackage{fancybox}
\newsavebox{\mcBox}
\newenvironment{monItemize}{
\renewcommand{\item}%
{\end{lrbox}%
\fbox{
\usebox{\mcBox}
} \\\begin{lrbox}{\mcBox}}%
\begin{lrbox}{\mcBox}%
}
{\end{lrbox}
\fbox{%
\usebox{\mcBox}%
}%
}
\newcommand{\itemm}{}
\newenvironment{monItemizeMD}{
\renewcommand{\itemm}%
{\end{lrbox}%
\begin{mdframed}[userdefinedwidth=3cm]%
\usebox{\mcBox}
\end{mdframed}%
\begin{lrbox}{\mcBox}}%
\begin{lrbox}{\mcBox}%
}
{\end{lrbox}
\begin{mdframed}[userdefinedwidth=3cm]%
\usebox{\mcBox}
\end{mdframed}%
}
\begin{document}
\begin{monItemize}
\item aaa
\item bbb
\end{monItemize}
\begin{monItemizeMD}
\itemm ccc
\itemm ddd
\end{monItemizeMD}
\end{document}
In the environment monItemize
, I redefine \item
, which puts the content in a fbox
.
In the environment monItemizeMD
, I define the items thru a command \itemm
, instead of \item
, and the content lies in a mdframed-Box instead of a \fbox
.
- Question: If I use
\item
inmonItemizeMD
(of course, both in the definition and in the Instance of the environment), it fails to compile. Why ? - Question: How secure is it, generally speaking, to redefine
\item
? - Question: Can i solve the problem of Question 1, still using
\item
? Because my problem is, that, in many already existing documents, i have such an environment with\item
redefined. And in my documentclass, i wanted to replace the\fbox
by mdframed boxes.