[Tex/LaTex] Alignment of toc in beamer class

beamerhorizontal alignmenttable of contentsvertical alignment

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.

Best Answer

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