-
Notifications
You must be signed in to change notification settings - Fork 2
/
mh-slides.cls
92 lines (70 loc) · 3.47 KB
/
mh-slides.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mh-slides}[2012/08/24 Slides Class]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Class %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\LoadClassWithOptions{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Packages %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{environ}
\RequirePackage{ifthen}
\RequirePackage{etoolbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title Information at Beginning of Document %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\AfterEndPreamble{%
\begin{frame}%
\maketitle%
\end{frame}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Semisection (see mh-summary-sheets.cls) %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\semisection}[1]{\section[]{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Summary Environment (see mh-summary-sheets.cls) %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The summary environment has a title only on the summary sheets, but
% is not indexed, numbered, or represented on the slides.
\NewEnviron{summary}[1][]{}
\newcommand{\showThisSlide}[1][1]{}
\newcommand{\showPreviousSlide}[1][1]{}
\newcommand{\showPreviousPreviousSlide}[1][1]{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Slide Environment (see mh-summary-sheets.cls) %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO: Move this to a more appropriate place?
\newcount\level
\makeatletter
\let\Part@=\part\def\part{\global\level=0\Part@}
\let\Chapter@=\chapter\def\chapter{\global\level=1\Chapter@}
\let\Section@=\section\def\section{\global\level=2\Section@}
\let\Subsection@=\subsection\def\subsection{\global\level=3\Subsection@}
\let\Subsubsection@=\subsubsection\def\subsubsection{\global\level=4\Subsubsection@}
\makeatother
\newcommand{\insubsection}[1]{\ifthenelse{\level = 3}{#1}{}}
\newcounter{SlideNumber}
\xdef\SlideLabel{NO SLIDES YET}
\newenvironment{slide}[1][automaticLabelName]{
\ifthenelse{\equal{#1}{automaticLabelName}}{
\global\edef\SlideLabel{slide\arabic{SlideNumber}}
}{
\global\edef\SlideLabel{#1}
}
\stepcounter{SlideNumber}
\begin{frame}[label=\SlideLabel]
\frametitle{\insertsection}
\insubsection{\framesubtitle{\insertsubsection}}
}{ % BODY
\end{frame}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Slide Repetition Commands %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\repeatslide}[2][1]{\againframe<#1>{#2}}
\newcommand{\repeatoverlay}[1]{\againframe<#1>{\SlideLabel}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Horizontal Centering on Slides %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\centering