4



I'm trying to create a horizontal table of contents, but have no clue how I should start. My end goal would be something like this:

enter image description here

I have some experience with latex, but unfortunately I am lacking any clue how to automate this process. Therefore I would really appreciate any input how I should or can start this endeavour.

percusse
  • 157,807
betlor5
  • 65
  • 1
    What class of document do you use? I dn't understand the notion of ‘Current Title’ in a table of contents. – Bernard Aug 09 '15 at 10:26
  • I should have mentioned it. It is for a presentation and should be used in the beamer context. – betlor5 Aug 09 '15 at 10:30
  • Do you need to use the toc system, or are you willing to retype the titles? – John Kormylo Aug 09 '15 at 14:24
  • I would really appreciate a command like this \ownhortoc and \ownhortoc[current]. If i manually input the titles, I could ether use lualtex in combination with TikZ or I could automate the generation of an pdf or png with another program. Both actions would lead to a semiautomatic solution, which is prone to errors. At the Moment it would even help, if there is a way to get the tiles / chapter names in lualtex. If anybody knows something in that regard or has another solution, I will appreciate it. – betlor5 Aug 09 '15 at 16:29
  • Okay, the toc system consists of first writing @writefile{toc} commands in the aux file. The toc file is only created if \tableofcontents in used. So you need to modify @writefile to either extract the info needed of go ahead and write the toc file without \tableofcontents. – John Kormylo Aug 09 '15 at 23:44
  • Actually, if you are only doing chapter names you might want to just modify the \chapter macro to write your own commands to the aux file. – John Kormylo Aug 09 '15 at 23:54

1 Answers1

5

Beamer has its own mechanism to create TOC.

Basically, every time you call \tableofcontents[options], Beamer includes the same .toc file once. The only difference is that, with different options, Beamer will change the way it applies styles to the content of the .toc file.

After all, Beamer provides you some beamer templates such as subsection in toc and subsection in toc shaded so you can decide the final apparent of normal/shaded [[sub]sub]section.

Let me show you an example. This is how normal TOC looks like

\documentclass{beamer}
\usepackage{multicol,tikz}
\usetikzlibrary{shapes.symbols}
\begin{document}

\section{PGF}
    \subsection{Arrow Keys}
        \subsubsection{Length}
        \subsubsection{Width}
    \subsection{Decoration}
        \subsubsection{Amplitude}
        \subsubsection{Radius}
    \subsection{Text}
        \subsubsection{Left}
        \subsubsection{Right}
\section{TikZ}
    \subsection{CS}
        \subsubsection{Node}
        \subsubsection{Solution}
    \subsection{External}
        \subsubsection{Optimize}
        \subsubsection{Prefix}
    \subsection{Graphs}
        \subsubsection{Quick}
        \subsubsection{Simple}
\section{PGFPLOTS}
    \subsection{Table}
        \subsubsection{Col sep}
        \subsubsection{Row sep}
    \subsection{Group}
        \subsubsection{Group name}
        \subsubsection{Group size}
    \subsection{Mesh}
        \subsubsection{Check}
        \subsubsection{Odering}

\frame{{Normal TOC}
    \begin{multicols}2\tableofcontents\end{multicols}
}
\frame{{Normal TOC}
    \begin{multicols}2\tableofcontents[currentsection]\end{multicols}
}
\frame{{Normal TOC}
    \begin{multicols}2\tableofcontents[hideothersubsections]\end{multicols}
}

And this is how TOC looks like if you build those templates by \tikz[remember picture,overlay]

\tikzset{
    every picture/.style={remember picture,overlay,scale=.3}
}

\defbeamertemplate*{section in toc}{tikz}{
    \tikz\path(temp node)+(0,-1)node(temp node){}+(0,0)node[right]{\inserttocsection};
}
\defbeamertemplate*{section in toc shaded}{tikz}[1][.2]{
    \tikz\path(temp node)+(0,-1)node(temp node){}+(0,0)node[right,opacity=#1]{\inserttocsection};
}

\defbeamertemplate*{subsection in toc}{tikz}{
    \tikz\path(temp node)+(0,-1)node(temp node){}+(6,0)node[right]{\inserttocsubsection};
}
\defbeamertemplate*{subsection in toc shaded}{tikz}[1][.2]{
    \tikz\path(temp node)+(0,-1)node(temp node){}+(6,0)node[right,opacity=#1]{\inserttocsubsection};
}

\defbeamertemplate*{subsubsection in toc}{tikz}{
    \tikz\path(temp node)+(0,-1)node(temp node){}+(12,0)node[right]{\inserttocsubsubsection};
}
\defbeamertemplate*{subsubsection in toc shaded}{tikz}[1][.2]{
    \tikz\path(temp node)+(0,-1)node(temp node){}+(12,0)node[right,opacity=#1]{\inserttocsubsubsection};
}

\frame{{Ti\emph kZ TOC}
    \tikz\path(current page.north west)+(12,-1)node(temp node){};\tableofcontents
}
\frame{{Ti\emph kZ TOC}
    \tikz\path(current page.north west)+(12,-1)node(temp node){};\tableofcontents[currentsection]
}
\frame{{Ti\emph kZ TOC}
    \tikz\path(current page.north west)+(12,-1)node(temp node){};\tableofcontents[hideothersubsections]
}

With even more works, you can achieve

enter image description here

\tikzset{
    every picture/.style={remember picture,overlay,scale=1},
    Signal/.style={fill,signal,signal from=west,minimum width=3cm,minimum height=1cm},
    Secnal/.style={shift={(0,-.5)},right,rotate=-70,opacity=#1},
    Subsecnal/.style={below right,rotate=-60,opacity=#1},
    Subsubsecnal/.style={below right,rotate=-50,opacity=#1},
}

\defbeamertemplate*{section in toc}{fabulous}{
    \tikz\path(temp section)+(3,0)node[Signal,blue](temp section){}node[Secnal= 1](true section){\inserttocsection}(true section.north east)node(temp subsection){};
}
\defbeamertemplate*{section in toc shaded}{fabulous}[1][.5]{
    \tikz\path(temp section)+(3,0)node[Signal,gray](temp section){}node[Secnal=#1](true section){\inserttocsection}(true section.north east)node(temp subsection){};
}

\defbeamertemplate*{subsection in toc}{fabulous}{
    \tikz\path(temp subsection)node[Subsecnal= 1](true subsection){$>$\inserttocsubsection}(true subsection.south west)node(temp subsection){}(true subsection.north east)node(temp subsubsection){};
}
\defbeamertemplate*{subsection in toc shaded}{fabulous}[1][.2]{
    \tikz\path(temp subsection)node[Subsecnal=#1](true subsection){$>$\inserttocsubsection}(true subsection.south west)node(temp subsection){}(true subsection.north east)node(temp subsubsection){};
}

\defbeamertemplate*{subsubsection in toc}{fabulous}{
    \tikz\path(temp subsubsection)node[Subsubsecnal= 1](true subsubsection){$-$\inserttocsubsubsection}(true subsubsection.north east)node(temp subsubsection){};
}
\defbeamertemplate*{subsubsection in toc shaded}{fabulous}[1][.2]{
    \tikz\path(temp subsubsection)node[Subsubsecnal=#1](true subsubsection){$-$\inserttocsubsubsection}(true subsubsection.north east)node(temp subsubsection){};
}

\frame{{Fabulous TOC}
    \tikz\path(current page.north west)+(0,-2)node(temp section){};\tableofcontents
}
\frame{{Fabulous TOC}
    \tikz\path(current page.north west)+(0,-2)node(temp section){};\tableofcontents[currentsection]
}
\frame{{Fabulous TOC}
    \tikz\path(current page.north west)+(0,-2)node(temp section){};\tableofcontents[hideothersubsections]
}


\end{document}
Symbol 1
  • 36,855