# How to typeset a text like a beamer enumerate item, rectangle style

I would like to format a text so that it looks like an enumerate item.

In the example below, you can see that I would like a list that consists of the items 1,2,n. I would like the "n" to be typeset like the 1 and the 2, i.e. with a blue background.

\documentclass{beamer}

\useinnertheme{rectangles}
\setbeamertemplate{blocks}[default]

\begin{document}
\begin{frame}
\begin{enumerate}
\item Item one
\item Item two
\item[n] Item n
\end{enumerate}
\end{frame}
\end{document}


Thanks!

\documentclass{beamer}

\useinnertheme{rectangles}
\setbeamertemplate{blocks}[default]

\newcommand{\mysquare}[1]{
\hbox{%
\usebeamerfont*{item projected}%
\usebeamercolor[bg]{item projected}%
\vrule width2.25ex height1.85ex depth.4ex%
\hskip-2.25ex%
\hbox to2.25ex{%
\hfil%
\color{fg}#1%
\hfil}%
}%
}

\begin{document}
\begin{frame}
\begin{enumerate}
\item Item one
\item Item two
\item[\mysquare{n}] Item n
\end{enumerate}
\end{frame}
\end{document}


• A little followup: How did you figure that out? Did you look into the beamer sourcecode, or is there another way to find out the formatting of a special piece of text? – Jan Feb 1 '19 at 16:22
• @Jan Source code. The original template for the enumeration with squares can be found in github.com/josephwright/beamer/blob/master/base/… – samcarter_is_at_topanswers.xyz Feb 1 '19 at 16:25
• OK, so there is no easy way... Guess I'll have to come back here the next time I have a similar question ;-) – Jan Feb 5 '19 at 16:24