3
  • I have a beamer presentation with more than 9 sections.
  • I want to use the square symbol for the TOC.
  • When I have numbers larger than 9 the square is too small.
  • How can I increase the size of all square?

*I use a bigger font in my actual document and the effect is more severe than shown in the MWE below.


\documentclass{beamer}
\usepackage{tikz} % for \foreach

\setbeamertemplate{sections/subsections in toc}[square]

\begin{document}

\section{Overview}
\begin{frame}[plain]
    \frametitle{\contentsname}
    %https://tex.stackexchange.com/questions/109748/
    \begin{columns}[t]
        \begin{column}{.5\textwidth}
            \tableofcontents[sections={1-6}]
        \end{column}
        \begin{column}{.5\textwidth}
            \tableofcontents[sections={7-12}]
        \end{column}
    \end{columns}
\end{frame}

\foreach \x in {1,...,11}{
    \section{Section \x}
    \begin{frame}
    \frametitle{\insertsection}
        Test
    \end{frame}
}

\end{document}

enter image description here

Update after the answer

  • This is for others with a similar problem.
  • The square size is hardcoded as explained in the answer.
  • The code can be found in the file beamerbaseauxtemplates.sty on your system (as explained in a comment of the answer).
  • I added the original code to better understand the code in the answer.

% (sub-)section in toc: square

\defbeamertemplate{section in toc}{square}
{\leavevmode\leftskip=1.75ex%
  \llap{%
    \usebeamerfont*{section number projected}%
    \usebeamercolor[bg]{section number projected}%
    \vrule width2.25ex height1.85ex depth.4ex%
    \hskip-2.25ex%
    \hbox to2.25ex{\hfil\color{fg}\inserttocsectionnumber\hfil}}%
  \kern1.25ex\inserttocsection\par}

1 Answers1

4

The size of the square is hard coded in the definition of the template, hoewever you can create your own template:

\documentclass{beamer}
\usepackage{pgffor}

\defbeamertemplate{section in toc}{muhhh}
{\leavevmode\leftskip=1.75ex%
  \llap{%
    \usebeamerfont*{section number projected}%
    \usebeamercolor[bg]{section number projected}%
    \vrule width2.7ex height2.12ex depth.58ex%
    \hskip-2.7ex%
    \hbox to2.7ex{\hfil\color{fg}\inserttocsectionnumber\hfil}}%
  \kern1.5ex\inserttocsection\par}

\setbeamertemplate{section in toc}[muhhh]


\begin{document}

\section{Overview}
\begin{frame}[plain]
    \frametitle{\contentsname}
    %https://tex.stackexchange.com/questions/109748/
    \begin{columns}[t]
        \begin{column}{.5\textwidth}
            \tableofcontents[sections={1-6}]
        \end{column}
        \begin{column}{.5\textwidth}
            \tableofcontents[sections={7-12}]
        \end{column}
    \end{columns}
\end{frame}

\foreach \x in {1,...,11}{
    \section{Section \x}
    \begin{frame}
    \frametitle{\insertsection}
        Test
    \end{frame}
}

\end{document}

enter image description here