Ausgehend von der Beantwortung dieser Frage durch @Henri hat sich ein weiteres Problem ergeben.

Open in Online-Editor
\documentclass[t]{beamer}
\usetheme{AnnArbor}

\makeatletter

\def\beamer@sectionintoc#1#2#3#4#5{%
  \ifnum\c@tocdepth>0%
  \ifnum#4=\beamer@showpartnumber%
  {
  \beamer@saveanother%
  \gdef\beamer@todo{}%
  \beamer@slideinframe=#1\relax%
  \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
      \beamer@tempcount=#5\relax%
      \advance\beamer@tempcount by\beamer@sectionadjust%
      \ifnum\beamer@tempcount>0
        \edef\inserttocsectionnumber{\the\beamer@tempcount}%
      \else
        \def\inserttocsectionnumber{}%
      \fi%
      \def\inserttocsection{\hyperlink{Navigation#3}{#2}}%
      \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}%
      {
        \ifbeamer@pausesections\pause\fi%
        \usebeamertemplate{toc section itemsep}%
        {%
          \hbox{\vbox{%
              \def\beamer@breakhere{\\}%
              \beamer@tocact{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}{section in toc}}}%
         \par%
        }%
      }%
    }
  }%
  \beamer@restoreanother%
  }
  \beamer@todo%
  \fi\fi%
}

\long\def\beamer@subsectionintoc#1#2#3#4#5#6{%
  \ifnum\c@tocdepth>1%
  \ifnum#5=\beamer@showpartnumber%
  {%
    \beamer@saveanother%
    \gdef\beamer@todo{}%
    \beamer@slideinframe=#1\relax%
    \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
      \ifbeamer@pausesubsections\pause\fi%
      \beamer@tempcount=#6%
      \advance\beamer@tempcount by\beamer@sectionadjust%
      \edef\inserttocsectionnumber{\the\beamer@tempcount}%
      \def\inserttocsubsectionnumber{#2}%
      \def\inserttocsubsection{\hyperlink{Navigation#4}{#3}}%
      \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@css\else\beamer@toc@oss\fi}%
      {%
        \usebeamertemplate{toc subsection itemsep}%
        \def\beamer@breakhere{\\}%
        \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\beamer@toc@css\else\beamer@toc@oss\fi\else\beamer@toc@ooss\fi}
        {subsection in toc}%
      }%
    }}%
    \beamer@restoreanother%
  }
  \beamer@todo%
  \fi\fi%
}

\long\def\beamer@subsubsectionintoc#1#2#3#4#5#6#7{%
  \ifnum\c@tocdepth>2%
  \ifnum#6=\beamer@showpartnumber%
  {
    \beamer@saveanother%
    \gdef\beamer@todo{}%
    \beamer@slideinframe=#1\relax%
    \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
      \ifbeamer@pausesubsections\pause\fi%
      \beamer@tempcount=#7%
      \advance\beamer@tempcount by\beamer@sectionadjust%
      \edef\inserttocsectionnumber{\the\beamer@tempcount}%
      \def\inserttocsubsectionnumber{#2}%
      \def\inserttocsubsubsectionnumber{#3}%
      \def\inserttocsubsubsection{\hyperlink{Navigation#5}{#4}}%
      \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@csss\else\beamer@toc@osss\fi}%
      {%
        % <<<<<
        \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\ifnum\c@subsubsection=#3\beamer@toc@csss\else\beamer@toc@osss\fi\else\beamer@toc@oosss\fi\else\beamer@toc@ooosss\fi}
        {toc subsubsection itemsep}%
        % =====
        %\usebeamertemplate{toc subsubsection itemsep}
        % >>>>>
        \def\beamer@breakhere{\\}%
        \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\ifnum\c@subsubsection=#3\beamer@toc@csss\else\beamer@toc@osss\fi\else\beamer@toc@oosss\fi\else\beamer@toc@ooosss\fi}
        {subsubsection in toc}%
      }%
    }}%
    \beamer@restoreanother%
  }
  \beamer@todo%
  \fi\fi%
}

\makeatother

\setbeamertemplate{toc section itemsep}{\vskip1.5\baselineskip}
\setbeamertemplate{toc subsection itemsep}{\vskip1\baselineskip}
\setbeamertemplate{toc subsubsection itemsep}{\vskip0.5\baselineskip}

\begin{document}
\begin{frame}
\tableofcontents[hideallsubsections]
\end{frame}
\section{A}
\begin{frame}
\tableofcontents[hideothersubsections,sectionstyle=hide]
\end{frame}
\subsection{A1}
\begin{frame}
\tableofcontents[subsubsectionstyle=show/show/hide/hide,subsectionstyle=show/shaded/hide,sectionstyle=hide]
\end{frame}
\subsubsection{A1a}
\begin{frame}
\end{frame}
\subsubsection{A1b}
\begin{frame}
\end{frame}
\subsection{A2}
\begin{frame}
\end{frame}
\subsection{A3}
\begin{frame}
\end{frame}
\section{B}
\begin{frame}
\tableofcontents[hideothersubsections,sectionstyle=hide]
\end{frame}
\subsection{B1}
\begin{frame}
\tableofcontents[subsubsectionstyle=show/show/hide/hide,subsectionstyle=show/shaded/hide,sectionstyle=hide]
\end{frame}
\subsubsection{B1a}
\begin{frame}
\end{frame}
\subsubsection{B1b}
\begin{frame}
\end{frame}
\subsection{B2}
\begin{frame}
\end{frame}
\subsection{B3}
\begin{frame}
\end{frame}

\end{document}

Im Gegensatz zur vorigen Frage wird der tableofcontents in der zweiten section nochmals angezeigt. Folie 8 und 9 zeigen, dass das Inhaltsverzeichnis immer weiter nach unten rückt, obwohl die Option [t] an die Klasse übergeben wurde und das Inhaltsverzeichnis immer oben ausgerichtet sein sollte.

Bei jedem weiteren Aufruf von \tableofcontents rutscht dieser auf den Folien weiter nach unten.

gefragt 13 Sep '16, 23:17

tom75's gravatar image

tom75
2.2k277984
Akzeptiert-Rate: 57%


Da haben noch ein paar Checks gefehlt. Der vertikale Abstand in toc ... itemsep darf natürlich nur dann platziert werden, wenn das entsprechende Element abgezeigt wird.

Open in Online-Editor
\documentclass[t]{beamer}
\usetheme{AnnArbor}

\makeatletter

\def\beamer@sectionintoc#1#2#3#4#5{%
  \ifnum\c@tocdepth>0%
  \ifnum#4=\beamer@showpartnumber%
  {
  \beamer@saveanother%
  \gdef\beamer@todo{}%
  \beamer@slideinframe=#1\relax%
  \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
      \beamer@tempcount=#5\relax%
      \advance\beamer@tempcount by\beamer@sectionadjust%
      \ifnum\beamer@tempcount>0
        \edef\inserttocsectionnumber{\the\beamer@tempcount}%
      \else
        \def\inserttocsectionnumber{}%
      \fi%
      \def\inserttocsection{\hyperlink{Navigation#3}{#2}}%
      \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}%
      {
        \ifbeamer@pausesections\pause\fi%
        \beamer@tocact{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}{toc section itemsep}%
        {%
          \hbox{\vbox{%
              \def\beamer@breakhere{\\}%
              \beamer@tocact{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}{section in toc}}}%
         \par%
        }%
      }%
    }
  }%
  \beamer@restoreanother%
  }
  \beamer@todo%
  \fi\fi%
}

\long\def\beamer@subsectionintoc#1#2#3#4#5#6{%
  \ifnum\c@tocdepth>1%
  \ifnum#5=\beamer@showpartnumber%
  {%
    \beamer@saveanother%
    \gdef\beamer@todo{}%
    \beamer@slideinframe=#1\relax%
    \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
      \ifbeamer@pausesubsections\pause\fi%
      \beamer@tempcount=#6%
      \advance\beamer@tempcount by\beamer@sectionadjust%
      \edef\inserttocsectionnumber{\the\beamer@tempcount}%
      \def\inserttocsubsectionnumber{#2}%
      \def\inserttocsubsection{\hyperlink{Navigation#4}{#3}}%
      \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@css\else\beamer@toc@oss\fi}%
      {%
        %% Das hier sollte eigentlich funktionieren, tut es aber nicht
        %\beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\beamer@toc@css\else\beamer@toc@oss\fi\else\beamer@toc@ooss\fi}
        %{toc subsection itemsep}%
        \beamer@tocact{\ifnum\c@section=#1\beamer@toc@css\else\beamer@toc@ooss\fi}
        {toc subsection itemsep}%
        \def\beamer@breakhere{\\}%
        \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\beamer@toc@css\else\beamer@toc@oss\fi\else\beamer@toc@ooss\fi}
        {subsection in toc}%
      }%
    }}%
    \beamer@restoreanother%
  }
  \beamer@todo%
  \fi\fi%
}

\long\def\beamer@subsubsectionintoc#1#2#3#4#5#6#7{%
  \ifnum\c@tocdepth>2%
  \ifnum#6=\beamer@showpartnumber%
  {
    \beamer@saveanother%
    \gdef\beamer@todo{}%
    \beamer@slideinframe=#1\relax%
    \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
      \ifbeamer@pausesubsections\pause\fi%
      \beamer@tempcount=#7%
      \advance\beamer@tempcount by\beamer@sectionadjust%
      \edef\inserttocsectionnumber{\the\beamer@tempcount}%
      \def\inserttocsubsectionnumber{#2}%
      \def\inserttocsubsubsectionnumber{#3}%
      \def\inserttocsubsubsection{\hyperlink{Navigation#5}{#4}}%
      \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@csss\else\beamer@toc@osss\fi}%
      {%
        \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\ifnum\c@subsubsection=#3\beamer@toc@csss\else\beamer@toc@osss\fi\else\beamer@toc@oosss\fi\else\beamer@toc@ooosss\fi}
        {toc subsubsection itemsep}%
        \def\beamer@breakhere{\\}%
        \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\ifnum\c@subsubsection=#3\beamer@toc@csss\else\beamer@toc@osss\fi\else\beamer@toc@oosss\fi\else\beamer@toc@ooosss\fi}
        {subsubsection in toc}%
      }%
    }}%
    \beamer@restoreanother%
  }
  \beamer@todo%
  \fi\fi%
}

\makeatother

\setbeamertemplate{toc section itemsep}{\vskip1.5\baselineskip}
\setbeamertemplate{toc subsection itemsep}{\vskip1\baselineskip}
\setbeamertemplate{toc subsubsection itemsep}{\vskip0.5\baselineskip}

\begin{document}
\begin{frame}
\tableofcontents[hideallsubsections]
\end{frame}
\section{A}
\begin{frame}
\tableofcontents[hideothersubsections,sectionstyle=hide]
\end{frame}
\subsection{A1}
\begin{frame}
\tableofcontents[subsubsectionstyle=show/show/hide/hide,subsectionstyle=show/shaded/hide,sectionstyle=hide]
\end{frame}
\subsubsection{A1a}
\begin{frame}
\end{frame}
\subsubsection{A1b}
\begin{frame}
\end{frame}
\subsection{A2}
\begin{frame}
\end{frame}
\subsection{A3}
\begin{frame}
\end{frame}
\section{B}
\begin{frame}
\tableofcontents[hideothersubsections,sectionstyle=hide]
\end{frame}
\subsection{B1}
\begin{frame}
\tableofcontents[subsubsectionstyle=show/show/hide/hide,subsectionstyle=show/shaded/hide,sectionstyle=hide]
\end{frame}
\subsubsection{B1a}
\begin{frame}
\end{frame}
\subsubsection{B1b}
\begin{frame}
\end{frame}
\subsection{B2}
\begin{frame}
\end{frame}
\subsection{B3}
\begin{frame}
\end{frame}

\end{document}
Permanenter link

beantwortet 14 Sep '16, 10:05

Henri's gravatar image

Henri
15.7k133943
Akzeptiert-Rate: 46%

1

@saputello Ich war mir nicht sicher ob ich das Problem lösen kann. Daher hielt ich es für besser es als neue Frage stellen zu lassen, sodass eventuell jemand anders hätte antworten können.

(14 Sep '16, 10:39) Henri

@saputello Ich mach einen hierher Link rein.

(14 Sep '16, 10:49) Henri

@Henri Herzlichen Dank! Jetzt passt es.

(16 Sep '16, 13:28) tom75
Deine Antwort
Vorschau umschalten

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Markdown-Grundlagen

  • *kursiv* oder _kursiv_
  • **Fett** oder __Fett__
  • Link:[Text](http://url.com/ "Titel")
  • Bild?![alt Text](/path/img.jpg "Titel")
  • nummerierte Liste: 1. Foo 2. Bar
  • zum Hinzufügen ein Zeilenumbruchs fügen Sie einfach zwei Leerzeichen an die Stelle an der die neue Linie sein soll.
  • grundlegende HTML-Tags werden ebenfalls unterstützt

Frage-Themen:

×141
×12

gestellte Frage: 13 Sep '16, 23:17

Frage wurde gesehen: 7,561 Mal

zuletzt geändert: 16 Sep '16, 13:28