I'm creating a Beamer presentation and I wanted to change margin size for single slides. I've found a solution on some old mailing list, adapted it a little and it works perfectly, but I have no idea how it works=/
\newenvironment{codemargin}{%
\begin{list}{}{%
\setlength{\leftmargin}{-0.7cm}%
\setlength{\rightmargin}{-0.7cm}%
}%
\item[]}{
\end{list}
}
This creates a new environment that I can use on slides that I want to have smaller margins.
Now to the point – what does \item[]}{ mean? I can't find any other examples using similar syntax.
Best Answer
The rough idea is that the
list
environment (for reasons I don't fully understand) makes various kinds of formatting easier, such as thesetlengths
you have. I believe it also suppresses the initial paragraph indentation, too. However, just as with theitemize
,enumerate
, anddescription
environments—which are all wrappers aroundlist
—the only permitted text must follow an\item
. And since\item
can take an optional argument (something used to great effect in description lists), an empty one is provided so that you can writeOtherwise, the
[This text]
would get swallowed up by the\item
command.