3

I've just started using LaTeX, and trying to figure out beamer. I would want a TOC with each depth indented, basically the subsection tabulated! This is what I've got so fare !

\documentclass{beamer}
\usepackage[frenchb]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{lastpage}
\usepackage{alltt}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{atbegshi}
\usepackage{tikz}
%Theme------------------------------------------------------------------
\useoutertheme{shadow}
\useinnertheme{rounded}
\usecolortheme{beaver}
%Custum Footline--------------------------------------------------------
\setbeamertemplate{footline}        %found this on the forum and tweaked it a bit, from here
{
  \leavevmode%
  \hbox{%
   \begin{beamercolorbox}[wd=.25\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertinstitute
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\inserttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.25\paperwidth,ht=2.25ex,dp=1ex,center]{date in head/foot}%
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother                    %to here
%Title frame info-------------------------------------------------------
\title{Conception et fabrication d'une imprimante 3D}
\subtitle{Soutenance de Projet Tuteur\'e semestre deux}
\author{W, Y \\X, Z}
\institute{My Uni}
\date{29 Mai 2017}
%Filigrane--------------------------------------------------------------
\newcommand{\filigrane}{\begin{tikzpicture}[remember picture,overlay]
\node [rotate=0,scale=1,text opacity=0.08]
at (current page.center) {\includegraphics[height=7cm]{FiligranePic.jpg}};
\end{tikzpicture}}[![enter image description here][1]][1]
%Numbered TOC-----------------------------------------------------------
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]
%Document---------------------------------------------------------------
\begin{document}                                                        
\maketitle
\setbeamertemplate{background canvas}{\filigrane}
\begin{frame}\frametitle{Sommaire}
    \tableofcontents
\end{frame}
...
\end{document}

The hideous result

7

Per default the definition of numbered subsections contains \leftskip=2em, so to indent the numbered subsection, increase this value:

\documentclass{beamer}

\useoutertheme{shadow}
\useinnertheme{rounded}
\usecolortheme{beaver}

\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}{\leavevmode\leftskip=3.2em\rlap{\hskip-2em\inserttocsectionnumber.\inserttocsubsectionnumber}\inserttocsubsection\par}

\begin{document}                                                        

\begin{frame}
    \frametitle{Sommaire}
    \tableofcontents
\end{frame}

\section{sec}
\subsection{sub}
\section{sec}

\begin{frame}
    abc
\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.