0

My question: How to customize the summary/table of contents in order to have section sided on the right and subsection on the left ?

The expected result is close to the below image

section left side and framtitle on right side

Moreover, I would like to use animate itemize in order to get shaded subsection.

Currently to do it, I do this:

\def\singleletter#1{\rotatebox[origin=B]{90}{#1}}
\makeatletter
\def\parseletters#1{\@tfor \@tempa := #1 \do {\kern2pt\singleletter{\@tempa}}}
\makeatother
\def\verticaltext#1{\rotatebox[origin=c]{-90}{\parseletters{#1}}}

\definecolor{LightGray}{gray}{0.95}

\begin{frame}{Summary}
\setlength\arrayrulewidth{2pt}
\begin{table}[]
    \begin{tabularx}{\textwidth}{l|l}
        \multirow{4}{*}{\colorbox{LightGray}{\verticaltext{section 1}}}  & subsection 1 \\
                                                                         & subsection 2 \\
                                                                         & subsection 3 \\
                                                                         & subsection 4
    \end{tabularx}
\end{table}
\end{frame}

A MWE is available here

AlexG
  • 54,894
  • Please can you add a full MWE and not a fragment of your code? – Sebastiano Feb 15 '19 at 10:47
  • Thanks Sebastiano, I edited in order to put a MWE . but I think that the way to do it is not carried by the use of tabular env. but maybe by the use of a framed env with a sided bar and inside an enumeration... – bioinfornatics Feb 15 '19 at 11:03
  • 2
    That's unfortunately not quite an MWE. An MWE starts with \documentclass and ends with \end{document} and can be compiled. –  Feb 15 '19 at 15:38
  • ok following your recommendation I updated it – bioinfornatics Feb 15 '19 at 16:11
  • @bioinfornatics Thank you very much for your collaboration. It is very important a full MWE also to understand the best way to solve a question and fix the errors. – Sebastiano Feb 15 '19 at 21:24

1 Answers1

1

Based on Manually creating a basic beamer toc the following could be some starting point:

\documentclass[table]{beamer}

\usepackage{tabularx}
%\usepackage{graphicx}
%\usepackage{xcolor}
\usepackage{tikz}
\usepackage{multirow}

\definecolor{LightGray}{gray}{0.95}

\setbeamercolor{subsection in toc}{fg=black}

% total number of sections %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{totcount}
\newcounter{totalsection}
\regtotcounter{totalsection}
\AtBeginDocument{%
  \pretocmd{\section}{\refstepcounter{totalsection}}{}{}%
}%

% number of subsections per section %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xcntperchap}
\RegisterCounters{section}{subsection}
\newcounter{totalsubsection}
\setcounter{totalsubsection}{0}

% creating automatic label %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% based on https://tex.stackexchange.com/a/386557/36296
\AtBeginSection[]{\label{sec:\thesection}}
\AtBeginSubsection[]{\label{subsec:\thesection:\thesubsection}}
\newcounter{currentsub}
\newcounter{totsection}

% custom toc
\newcommand{\mytoc}{%
    \begingroup%
        \usebeamerfont{section in toc}%
      \usebeamercolor[fg]{section in toc}%
    \setcounter{totsection}{\number\totvalue{totalsection}}%
    \foreach \i in {1,...,\thetotsection}{%
        \begin{minipage}{1cm}%
                \rotatebox{90}{\underline{\colorbox{LightGray}{\hyperlink{sec:\thesection}{\nameref{sec:\i}}}}}
        \end{minipage}%
            \setcounter{currentsub}{\ObtainTrackedValueExp[\i]{section}{subsection}}%
      \setcounter{currentsub}{\ObtainTrackedValueExp[\i]{section}{subsection}}% 
        \begin{minipage}{7cm}%
        \usebeamerfont{subsection in toc}%
        \usebeamercolor[fg]{subsection in toc}%
        \ifnum\thecurrentsub>0%
            \foreach \j in {1,...,\thecurrentsub}{%
                \hyperlink{subsec:\i:\j}{\nameref{subsec:\i:\j}}%
                \par%
            }%
        \fi%
        \end{minipage}           
      \vfill
    }% loop over i
    \endgroup
}

\title{Some Title}

\begin{document}

\begin{frame}
    \mytoc
\end{frame}

\section{Section 1}
\subsection{Subsection 1a}
\frame{}
\subsection{Subsection 1b}
\frame{}
\subsection{Subsection 1c}
\frame{}

\section{Section 2}
\subsection{Subsection 2a}
\frame{}
\subsection{Subsection 2b}
\frame{}
\subsection{Subsection 2c}
\frame{}

\end{document}

enter image description here

  • 1
    @bioinfornatics I had some trouble to combine your \verticaltext macro with the link to the section, so I simply rotated it. If you need the text in vertical, maybe ask a new question about it – samcarter_is_at_topanswers.xyz Mar 08 '19 at 20:26