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}
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

  • This is stealing the tick since it's a solution that's more easily changeable and seems to be how Beamer was designed to work – but here's a follow-up question: using the same patch to visually group sections, I'm getting some very strange spacing. Any idea what's causing it? I may indeed ultimately use the second answer because of this, hacky/clever as it is. – Sean Allred Oct 13 '16 at 10:55
  • @SeanAllred Thanks for the tick! I had a look at the other question, not really sure why your solution does not work with the code from this answer. – user36296 Oct 13 '16 at 11:10
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}

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.