0

I am using rectangles innertheme in beamer. I want to print the subsection numbers in alphabets in ToC. For example, with the following snippet:

\documentclass{beamer}
\useinnertheme{rectangles}
%%%\setbeamertemplate{subsection in toc}[subsections numbered] %doesn't work

\begin{document}
\begin{frame}{ToC}
\tableofcontents
\end{frame}

\section{Test 1}
\subsection{Test 11}
\begin{frame}
page 1
\end{frame}
\subsection{Test 12}
\begin{frame}
page 2
\end{frame}


\section{Test 2}
\subsection{Test 21}
\begin{frame}
page 3
\end{frame}

\end{document}

I get

What I wanted is the rectangle before Test 11 will contain a, ... Like:

Any help?!

2

You can redefine the subsection template to include the subsection number:

\documentclass{beamer}
\useinnertheme{rectangles}

\newcounter{mynumber}

\makeatletter
\setbeamertemplate{subsection in toc}{
    \leavevmode\leftskip=5ex%
  \llap{%
    \usebeamerfont*{section number projected}%
    \usebeamercolor[bg]{section number projected}%
    \vrule width2.25ex height1.85ex depth.4ex%
    \hskip-2.25ex%
    \setcounter{mynumber}{\inserttocsubsectionnumber}%
    \hbox to2.25ex{\hfil\color{fg}\alph{mynumber}\hfil}}%
  \kern1.25ex\inserttocsubsection\par}
\makeatother 

\begin{document}
\begin{frame}{ToC}
\tableofcontents
\end{frame}

\section{Test 1}
\subsection{Test 11}
\begin{frame}
page 1
\end{frame}
\subsection{Test 12}
\begin{frame}
page 2
\end{frame}


\section{Test 2}
\subsection{Test 21}
\begin{frame}
page 3
\end{frame}

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.