Sometimes in beamer I like to use itemize as follows (code largely from https://topanswers.xyz/tex?q=1334):
\documentclass{beamer}
\setbeamersize{text margin left=10mm,text margin right=5mm}
\setbeamertemplate{frametitle}[default][center]
\newenvironment{grayenv}{\only{\setbeamercolor{local structure}{fg=black!15}}}{}
\begin{document}
\begin{frame}{Frame Title}
\setbeamertemplate{itemize items}[circle]
\addtolength{\leftmargini}{-0.7cm}
\begin{itemize}[<+-|gray@+(1)->]
\setlength\itemsep{5pt plus 1fill}
\item line one
\item line two
\item<+-> line three
\end{itemize}
\end{frame}
\end{document}
This has the effect of fading out bullet point markers for old bullet points as well as a few other features I find helpful. Notice that the final \item has to have <+-> so we don't get a new slide with all the markers gray.
Is there way to make a new environment `myitemize` that would capture all the features of my bespoke itemize environment?
Top Answer
samcarter
The problem with the last item is actually trivial to avoid if one thinks a bit outside the box (by just modifying three lines :) ). Instead of changing the colour of previous items, the trick is to change the colour of the current one:
```
\documentclass{beamer}
\setbeamersize{text margin left=10mm,text margin right=5mm}
\setbeamertemplate{frametitle}[default][center]
\newenvironment{grayenv}{\only{\setbeamercolor{item}{fg=structure.fg}}}{}
\begin{document}
\begin{frame}{Frame Title}
\setbeamertemplate{itemize items}[circle]
\addtolength{\leftmargini}{-0.7cm}
\setbeamercolor{item}{fg=black!15}
\begin{itemize}[<+-|gray@+>]
\setlength\itemsep{5pt plus 1fill}
\item line one
\item line two
\item line three
\end{itemize}
\end{frame}
\end{document}
```
To make this into a custom environment:
```
\documentclass{beamer}
\setbeamersize{text margin left=10mm,text margin right=5mm}
\setbeamertemplate{frametitle}[default][center]
\makeatletter
\newenvironment{grayenv}{\only{\setbeamercolor{item}{fg=beamer@blendedblue}}}{}
\makeatother
\newenvironment{myitem}[1][]{%
\setbeamertemplate{itemize items}[circle]
\addtolength{\leftmargini}{-0.7cm}
\beamerdefaultoverlayspecification{<+-|gray@+>}
\setbeamercolor{item}{fg=black!15}
\begin{itemize}[#1]
\setlength\itemsep{5pt plus 1fill}
}{
\end{itemize}
}
\begin{document}
\begin{frame}{Frame Title}
\begin{myitem}
\item line one
\item line two
\item line three
\end{myitem}
\end{frame}
\end{document}
```
![document2.gif](/image?hash=84a38b5ec03358ee0826ccf52ea8225817ab01ab2ff5a3063d0196edb55c9ac8)