I wish to design a convenience command \lazycmd that works like this (simplified version):
\newcommand{\lazycmd}[1]{%
...
}
% Use case 1.
\lazycmd{
\item one
\item two
}
% Use case 2.
\lazycmd{
custom
}
\lazycmd is expected to:
- Add
\begin{itemize}and\end{itemize}in the front and the back of#1, if the argument begins with\item(with leading spaces skipped). This is my "normal case". - Otherwise, copy
#1. This is my "special case", as the argument will provides its own format.
The problems are, how to use "\item" as a string in the comparison, and how to skip any potential leading spaces? Thanks a lot!
