ozanj / rclass

4 stars 3 forks source link

Possible to specify placement of TOC from within contents of .Rmd file? #6

Closed ozanj closed 5 years ago

ozanj commented 5 years ago

Currently, TOC slide is first slide right after title slide.

usually I have a level 1 section called "introduction"

would like the TOC to appear as a slide within the introduction section [and I could specify title for this TOC slide] rather than TOC slide appearing before the introduction section.

@cyouh95

ozanj commented 5 years ago

Seems like I can add a slide with TOC just by putting this in contents of .Rmd file:

\tableofcontents

would like the level 2 headings to be indented. also, would like to be able to specify from .Rmd file whether to show level 2 headings or not.

@cyouh95

cyouh95 commented 5 years ago

Modifying this to be the following should add the indent:

\setbeamertemplate{subsection in toc}{%
  \leavevmode\leftskip=3.2em\color{gray}\rlap{\hskip-2em\inserttocsectionnumber.\inserttocsubsectionnumber}\inserttocsubsection\par
}

And specifying the subsectionstyle option in the .Rmd can hide the level 2 headings (#5):

\tableofcontents[subsectionstyle=hide/hide/hide]
cyouh95 commented 5 years ago

And I think for preventing the level 1 "Introduction" heading from showing up in the TOC, you could add these options:

### Table of Contents
\tableofcontents[sections={1-}, firstsection=2]

And also set count to start at 0 in beamer_header.tex:

\setcounter{section}{-1}

as well as skip the numbering in the "Introduction" title slide by modifying:

\setbeamertemplate{section page}{%
    \begingroup
        \begin{beamercolorbox}[sep=10pt,center,rounded=true,shadow=true]{section title}
        \usebeamerfont{section title}\ifnum\thesection>0 {\thesection~}\fi\insertsection\par
        \end{beamercolorbox}
    \endgroup
}