2

I have some problems with vertical alignment of toc in beamer class related to this question.

The answer works for me, but i would like to center the toc and decrease the horizontal space between these two columns. All items should be on the same height.

\documentclass[12pt,handout,]{beamer}
\usepackage{luacode}
\usepackage{luatextra}
\usepackage[utf8]{luainputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\begin{document}

\begin{frame}[t,plain]
\titlepage
\addtocounter{framenumber}{-1}
\end{frame}

\begin{frame}[fragile]\frametitle{Inhalt des Kurses}

\setcounter{tocdepth}{1}
\begin{columns}[t]
\begin{column}{.33\textwidth}
    \tableofcontents[sections={1-5}]
\end{column}
\begin{column}{.33\textwidth}
    \tableofcontents[sections={6-10}]
\end{column}
\end{columns}

\end{frame}

\section{section 1}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 2}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 3}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 4}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 5}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 6}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 7}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 8}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 9}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}
\section{section 10}
\subsection{section 1}
\begin{frame}test\end{frame}
\subsection{section 1}
\begin{frame}test\end{frame}

\end{document}

Edit: If I increase the column width, it works. The distance between the columns is too large and it is not centered.

  • I cannot see that with your code fragment. Make a complete example which shows that behaviour. – user2478 Jun 5 '14 at 19:58
  • I've edited my answer. – SLx64 Jun 5 '14 at 20:08
  • Please provide a minimal working example (MWE) that replicates your problem. We want to copy-and-paste your code and see what the problem is. That doesn't happen with the above code snippet, as we don't have the full document you \input. – Werner Jun 5 '14 at 20:17
  • @SLx64 That is useless because we cannot run the example. – user2478 Jun 5 '14 at 20:31
  • There are so many files, i hope it works now. – SLx64 Jun 5 '14 at 20:39
1

Although not automatically, you can adjust the value [totalwidth=.6\textwidth] to get your desired space between the columns. In case you want change the horizontal positioning on the page, you can play around with \hspace*{2.5cm}.

\documentclass{beamer}
\usepackage{luacode}
\usepackage{luatextra}
\usepackage[utf8]{luainputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{pgffor} %to use \foreach

\begin{document}

    \begin{frame}
        \frametitle{Inhalt des Kurses}
        \setcounter{tocdepth}{1}
        \begin{columns}[totalwidth=.6\textwidth] %change size to adjust space 
            \hspace*{2.5cm} % change here for horizontal positioning
            \begin{column}{.35\textwidth}
          \tableofcontents[sections={1-5}]
            \end{column}
            \begin{column}{.35\textwidth}
            \tableofcontents[sections={6-10}]
            \end{column}
        \end{columns}
    \end{frame}

  \foreach \n in {1,...,10}{
    \section{section 1}
        \subsection{section 1}
        \begin{frame}test\end{frame}
    }

\end{document}

enter image description here

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.