4

This is a follow-up question to Splitting TOC into two columns on single frame in beamer.

I have the following:

\begin{frame}{Questions}
  \begin{multicols}{2}
    \tableofcontents
  \end{multicols}
\end{frame}

which is giving me

output

I'd really like to avoid splitting between subsections. Can this be done?

MWE

\documentclass{beamer}
\usepackage{multicol}
\usetheme{default}

\begin{document}
\section{Problem Definition}
\subsection{Terminology}
\subsection{Naive Workflow}
\subsection{Fatal Problem}
\section{Current Solution}
\subsection{What we have}
\subsection{How we use it}
\section{How it Works}
\section{How to Build}
\section{Troubleshooting}
\subsection{No defaulting}
\subsection{Inconsistent defaulting}
\subsection{Most other problems}

\begin{frame}{Questions}
  \begin{multicols}{2}
    \tableofcontents
  \end{multicols}
\end{frame}
\end{document}
Sean Allred
  • 27,421

2 Answers2

4

multicols doesn't allow for using the starred version of the environment which would remove balancing.

You can decide the splitting manually by placing markers inside your document structure.

Below I define two \if-conditions: \iffirsthalf and \ifsecondhalf, knowing that you want to split it into two halves. Then, you can set \firsthalftrue and \secondhalffalse if you just want the first marked set of the ToC, or \firsthalffalse and \secondhalftrue if you want the second marked set:

enter image description here

\documentclass{beamer}

\let\Tiny\tiny% https://tex.stackexchange.com/a/94159/5764

\usetheme{default}

\newif\iffirsthalf
\newif\ifsecondhalf

\begin{document}

\addtocontents{toc}{\protect\iffirsthalf}% Start of first half...
\section{Problem Definition}
\subsection{Terminology}
\subsection{Naive Workflow}
\subsection{Fatal Problem}
\section{Current Solution}
\subsection{What we have}
\subsection{How we use it}
\addtocontents{toc}{\protect\fi% ...end of first half
                    \protect\ifsecondhalf}% Start of second half...
\section{How it Works}
\section{How to Build}
\section{Troubleshooting}
\subsection{No defaulting}
\subsection{Inconsistent defaulting}
\subsection{Most other problems}
\addtocontents{toc}{\protect\fi}% ...end of second half

\begin{frame}{Questions}
  \begin{columns}[T]
    \begin{column}{.4\linewidth}
    \firsthalftrue\secondhalffalse
    \tableofcontents
    \end{column}

    \begin{column}{.4\linewidth}
    \firsthalffalse\secondhalftrue
    \tableofcontents
    \end{column}
  \end{columns}
\end{frame}

\end{document}
Werner
  • 603,163
4

You could split the toc manually:

\documentclass{beamer}
\usepackage{multicol}
\usetheme{default}

\begin{document}
\section{Problem Definition}
\subsection{Terminology}
\subsection{Naive Workflow}
\subsection{Fatal Problem}
\section{Current Solution}
\subsection{What we have}
\subsection{How we use it}
\section{How it Works}
\section{How to Build}
\section{Troubleshooting}
\subsection{No defaulting}
\subsection{Inconsistent defaulting}
\subsection{Most other problems}

\begin{frame}{Questions}
    \begin{columns}[onlytextwidth,T]
        \begin{column}{.45\textwidth}
            \tableofcontents[sections=1-2]
        \end{column}
        \begin{column}{.45\textwidth}
            \tableofcontents[sections=3-5]
        \end{column}
    \end{columns}
\end{frame}
\end{document}

enter image description here