1

I am using the enumitem package in order to customise enumeration by setting a custom set of characters for enumerate item labels.

When I normally make article-type documents, I use the following code.

\usepackage{enumitem}
\makeatletter
\newcommand{\xslalph}[1]{\expandafter\@xslalph\csname c@#1\endcsname}
\newcommand{\@xslalph}[1]{%
    \ifcase#1\or a\or b\or c\or \v{c}\or d\or e\or f\or g\or h\or i%
    \or j\or k\or l\or m\or n\or o\or p\or r\or s\or \v{s}%
    \or t\or u\or v\or z\or \v{z}%
    \else\@ctrerr\fi%
}
\AddEnumerateCounter{\xslalph}{\@xslalph}{m}
\makeatother

(I got this code from my previous question --- enumerate with custom alphabet for items)

I am now working on a beamer presentation. beamer uses a special internal script for handling enumeration that is incompatible with enumitem, so enumitem cannot be used in a beamer documentclass.

How do I use AddEnumerateCounter in beamer slides? I want to have items alphabetically labeled with Slovenian letters (abcčdefghijklmnoprsštuvzž).

jg6
  • 175
  • 5

1 Answers1

2

SOLUTION n°1

As beamer uses the enumerate package and according to the documentation of this package, you can provide customized counter styles. See section 2 of the documentation about \@enhook.

pgffor and muticol are here just for the sake of the example.

This is if you only want such a numbering locally.

\documentclass{beamer}
\usepackage{multicol}
\usepackage{pgffor}
\makeatletter
% Same definition of \xsalph than what you provided
\newcommand{\xslalph}[1]{\expandafter\@xslalph\csname c@#1\endcsname}
\newcommand{\@xslalph}[1]{%
    \ifcase#1\or a\or b\or c\or \v{c}\or d\or e\or f\or g\or h\or i%
    \or j\or k\or l\or m\or n\or o\or p\or r\or s\or \v{s}%
    \or t\or u\or v\or z\or \v{z}%
    \else\@ctrerr\fi%
}
% Extention of enumerate package according to documentation section 2. about "\@enhook"
% Makes * trigger \xslalph enumeration style
\providecommand\@enhook{}
\g@addto@macro\@enhook{%
\ifx *\@entemp\def\@tempa{\@enLabel\xslalph}%
\fi}
\makeatother


\begin{document}

\begin{frame}
\begin{multicols}{2}
\begin{enumerate}[*]
    \foreach \nitem in {1,...,25}{
\item \nitem.
    }
\end{enumerate}
\end{multicols}
\end{frame}

\end{document}

enter image description here

SOLUTION n°2

You can modify the enumerate item style globally with

\setbeamertemplate{enumerate item}{\xslalph{enumi}.}

the output is the same but does not require an option to the enumerate environment.

\documentclass{beamer}
\usepackage{multicol}
\usepackage{pgffor}
\makeatletter
% Same definition of \xsalph than what you provided
\newcommand{\xslalph}[1]{\expandafter\@xslalph\csname c@#1\endcsname}
\newcommand{\@xslalph}[1]{%
    \ifcase#1\or a\or b\or c\or \v{c}\or d\or e\or f\or g\or h\or i%
    \or j\or k\or l\or m\or n\or o\or p\or r\or s\or \v{s}%
    \or t\or u\or v\or z\or \v{z}%
    \else\@ctrerr\fi%
}
\makeatother
\setbeamertemplate{enumerate item}{\xslalph{enumi}.}

\begin{document}

\begin{frame}
\begin{multicols}{2}
\begin{enumerate}
    \foreach \nitem in {1,...,25}{
    \item \nitem.
    }
\end{enumerate}
\end{multicols}
\end{frame}

\end{document}
BambOo
  • 8,801
  • 2
  • 20
  • 47