In relation with this example: New command without brackets inside new environment, I have to pass the current font size to the environment, but I prefer it takes it by itself?
To make it clear, I would like to store the selectfont
parameters and reuse them later.
There is an obvious bracket solution, but the OP of the related question doesn't want to use brackets.
\documentclass{article}
\pagestyle{empty}
\begin{document}
\begin{itemize}
\item Bla
\item{\small Small is small}
\item Bla is not small, but the OP of the related question doesn't want to use brackets.
\end{itemize}
\end{document}
I then try to make a switch system inside the \item
macro and for this I have to know what are the fontsize parameters, to store and restore them.
\documentclass{article}
\pagestyle{empty}
\usepackage{paralist,xparse}
\newcommand{\Com}[1][\hspace{1cm}]{\item[#1\aftergroup\footnotesize]}
\NewDocumentEnvironment{Itemize}
{O{} % item caracter ex $\bullet$
D<>{\normalsize}}{%
\begin{list}{#2#1\aftergroup#2}{%
\setlength{\labelwidth}{0em} % adapt as you want
\setlength{\leftmargin}{0pt}
\setlength{\itemindent}{5pt}%
}}{%
\end{list}}
\begin{document}
\large
\begin{Itemize}[$\bullet$]<\large>
\item One
\item Two
\Com This is my comment
\item Three
\Com This is my comment
\end{Itemize}
Back to current font size !
\end{document}
Best Answer
Output: