Ian Jauslin
summaryrefslogtreecommitdiff
blob: 635680f64ca5985cbc6a8921ff98c1384ec3f9ad (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
%%
%% Ian's presentation class
%%

%% TeX format
\NeedsTeXFormat{LaTeX2e}[1995/12/01]

%% class name
\ProvidesClass{ian-presentation}[2017/09/29]

\def\ian@defaultoptions{
  \pagestyle{plain}
  \RequirePackage{color}
  \RequirePackage{amssymb}
}

%% paper dimensions
\setlength\paperheight{243pt}
\setlength\paperwidth{432pt}

%% fonts
\input{size11.clo}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}

%% text dimensions
\textheight=208pt
\textwidth=367.2pt
\hoffset=-1in
\voffset=-1in
\oddsidemargin=24pt
\evensidemargin=24pt
\topmargin=8pt
\headheight=0pt
\headsep=0pt
\marginparsep=0pt
\marginparwidth=0pt
\footskip=16pt


%% remove default skips
\parindent=0pt
\parskip=0pt
\baselineskip=0pt

%% something is wrong with \thepage, redefine it
\gdef\thepage{\the\c@page}

%% correct vertical alignment at the end of a document
\AtEndDocument{
  % save total slide count
  \immediate\write\@auxout{\noexpand\gdef\noexpand\slidecount{\thepage}}
  \vfill
  \eject
}


%% footer
\def\ps@plain{
  \def\@oddhead{}
  \def\@evenhead{\@oddhead}
  \def\@oddfoot{\tiny\hfill\thepage/\safe\slidecount\hfill}
  \def\@evenfoot{\@oddfoot}
}
\def\ps@empty{
  \def\@oddhead{}
  \def\@evenhead{\@oddhead}
  \def\@oddfoot{}
  \def\@evenfoot{\@oddfoot}
}


%% title of slide
\def\title#1{
  \hfil{\bf\large #1}\par
  \hfil\vrule width0.75\textwidth height0.3pt\par
  \vskip5pt
}


%% hyperlinks
% hyperlinkcounter
\newcounter{lncount}
% hyperref anchor
\def\hrefanchor{%
\stepcounter{lncount}%
\hypertarget{ln.\thelncount}{}%
}

%% define a command and write it to aux file
\def\outdef#1#2{%
  % define command%
  \expandafter\xdef\csname #1\endcsname{#2}%
  % hyperlink number%
  \expandafter\xdef\csname #1@hl\endcsname{\thelncount}%
  % write command to aux%
  \immediate\write\@auxout{\noexpand\expandafter\noexpand\gdef\noexpand\csname #1\endcsname{\csname #1\endcsname}}%
  \immediate\write\@auxout{\noexpand\expandafter\noexpand\gdef\noexpand\csname #1@hl\endcsname{\thelncount}}%
}

%% can call commands even when they are not defined
\def\safe#1{%
  \ifdefined#1%
    #1%
  \else%
    {\color{red}\bf?}%
  \fi%
}


%% itemize
\newlength\itemizeskip
% left margin for items
\setlength\itemizeskip{20pt}
\newlength\itemizeseparator
% space between the item symbol and the text
\setlength\itemizeseparator{5pt}
% penalty preceding an itemize
\def\itemizepenalty{0}
% counter counting the itemize level
\newcounter{itemizecount}

% item symbol
\def\itemizept#1{
  \ifnum#1=1
    \textbullet
  \else
    $\scriptstyle\blacktriangleright$
  \fi
}

\newlength\current@itemizeskip
\setlength\current@itemizeskip{0pt}
\def\itemize{
  \par\penalty\itemizepenalty\medskip\penalty\itemizepenalty
  \addtocounter{itemizecount}{1}
  \addtolength\current@itemizeskip{\itemizeskip}
  \leftskip\current@itemizeskip
}
\def\enditemize{
  \addtocounter{itemizecount}{-1}
  \addtolength\current@itemizeskip{-\itemizeskip}
  \par\leftskip\current@itemizeskip
  \medskip
}
\newlength\itempt@total
\def\item{
  \settowidth\itempt@total{\itemizept\theitemizecount}
  \addtolength\itempt@total{\itemizeseparator}
  \par
  \medskip
  \hskip-\itempt@total\itemizept\theitemizecount\hskip\itemizeseparator
}

%% enumerate
\newcounter{enumerate@count}
\def\enumerate{
  \setcounter{enumerate@count}0
  \let\olditem\item
  \let\olditemizept\itemizept
  \def\item{
    % counter
    \stepcounter{enumerate@count}
    % set header
    \def\itemizept{\theenumerate@count.}
    % hyperref anchor
    \hrefanchor
    % define tag (for \label)
    \xdef\tag{\theenumerate@count}
    \olditem
  }
  \itemize
}
\def\endenumerate{
  \enditemize
  \let\item\olditem
  \let\itemizept\olditemizept
}


%% end
\ian@defaultoptions

\endinput