[Tex/LaTex] Beamer: Custom numbers enumeration

#enumeratebeamernumbering

I want to allow custom numbering of examples in Beamer. In particular, I want to be able to have lists like the following (and I want to be able to use prime superscripts potentially for any number on a list):

  1. Example 1.
  2. Example 2.
    2’. Example 2.

I’m using a suggestion made by timothymctim here: `LaTeX Beamer: Enumerate with manual numbers', namely:

\documentclass{beamer}

    \newcommand{\labelname}[1]{
    \def\insertenumlabel{#1}%
\usebeamertemplate{enumerate item}%
 }

\begin{document}

\begin{frame}
\begin{enumerate}
    \item first
    \item[\labelname{1'}] prime
    \item second
\end{enumerate}
\end{frame}

\end{document}

Unlike timothymctim, I want to use the default theme, not Warsaw. However, when I use default theme, the custom numbered bullet point is not properly indented; it is misaligned relative to other numbers on the list. How can I control for this?

Best Answer

The label is properly aligned but on the right side and not on the left. A compromise could be to align it on both sides by moving the prime on top of the period.

\documentclass{beamer}

\newlength{\primewidth}
\settowidth{\primewidth}{'}

\begin{document}

\begin{frame}
\begin{enumerate}
    \item first
    \item[1'\hskip-\primewidth .] prime
    \item second
\end{enumerate}
\end{frame}

\end{document}

enter image description here