summaryrefslogtreecommitdiff
path: root/language/hebrew/hebclass/iitsmnr.cls
blob: 48a7d8c666452ae7e0cbb65f498f02b34dae7eab (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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
%latex2e declaration
\NeedsTeXFormat{LaTeX2e}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  
% Options parsing
%

% The options for calling the class seminar (with LoadClass)
\newcommand{\iitsmnr@seminar@options}{article}
% A This macro is used just before every slide
\newcommand{\handouts@pagebreak}{\pagebreak}% For the option 'handouts'
% The following condition will be true only on a slides-only printout
\newif\ifiitsmnrslidesonly \iitsmnrslidesonlyfalse
% The following condition will be true only on a notes-only printout (not used
% currently)
\newif\ifiitsmnrnotesonly  \iitsmnrnotesonlyfalse
%
% The different options (and their effects):
%
\DeclareOption{notes}{%
  \renewcommand{\iitsmnr@seminar@options}{notesonly,article}%
  \iitsmnrnotesonlytrue%
}
\DeclareOption{handouts}{%
  \renewcommand{\iitsmnr@seminar@options}{article}}%
  \renewcommand{\handouts@pagebreak}{\pagebreak}%
  \iitsmnrslidesonlyfalse%
\DeclareOption{slides}{%
  \renewcommand{\iitsmnr@seminar@options}{slidesonly}%
  \iitsmnrslidesonlytrue%
}
% encoding-related options:
\DeclareOption{enccp862}{\providecommand{\iitcsw@inputenc}{cp862}}%
\DeclareOption{enc8859-8}{\providecommand{\iitcsw@inputenc}{8859-8}}%
\DeclareOption{enccp1255}{\providecommand{\iitcsw@inputenc}{cp1255}}%
\DeclareOption{encsi960}{\providecommand{\iitcsw@inputenc}{si960}}%
\ProcessOptions

\ProvidesClass{iitsmnr}[2001/09/01 homework class]
\LoadClass[%
  \iitsmnr@seminar@options,%
  a4,                      % note that we force an a4 paper
]{seminar}

%\RequirePackage[cp862]{inputenc}
\RequirePackage[english,hebrew]{babel}
%\RequirePackage{amsfonts}
%\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{slidesec}
\RequirePackage{calc}
% I add this for hyperlinks in the DVI file. Nothing important.
% It may cause problems with hebrew
\RequirePackage{hyperref}
\HeblatexRedefineL % hyperref has its own definition for \L

% bug-fixes for the seminar class
\input{seminar.bug}
\input{seminar.bg2}



%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%
%
% The following code should eventually be added to rlbabel:
% TODO: this code is problematic. Get the slightly better code from my thesis
% seminar

% 
\@ifclassloaded{seminar}{%
  \raggedslides[0pt]%
  \def\slidelabel{\bf \if@rl\R{\hebshin\hebqof\hebfinalpe{} \theslide}%
                      \else\L{Slide \theslide}%
                      \fi}%
}{}


%%%%%%%%%%%%%%%
%
% The following define:
%
%   \printtime{counter}: counter is number in seconds. 
%                        Prints it as minutes:seconds
%
% calc operations can be used with '\setcounter', but not with '\arabic'
\newcounter{printtime@minutes}
\newcounter{printtime@seconds}
\newcommand{\printtime}[1]{%
  \setcounter{printtime@minutes}{\value{#1}/60}%
  \setcounter{printtime@seconds}{\value{#1}-\value{printtime@minutes}*60}
  \theprinttime@minutes:\theprinttime@seconds%
}
% The progress timer
%
% \timerReset
% \timerSet{time-in-seconds}
% \timerAdvance{time-in-seconds}
\newcommand{\timerCurrenttimename}{æîï ðåëçé}
\newcommand{\timerThisslidename}{äù÷ó äæä}
\newcounter{@progresstime}
\newcommand{\timerSet}[1]{\setcounter{@progresstime}{#1}}
\newcommand{\timerReset}{\timerSet{0}}
\timerReset
\newcommand{\timerAdvance}[1]{\addtocounter{@progresstime}{#1}}
\newcommand{\timerPrint}{\printtime{@progresstime}}
\newcommand{\timerPrintStatusAdvance}[1]{%
  \begin{center}
    \framebox{\parbox{0.5\textwidth}{%
        \timerCurrenttimename: \L{\timerPrint}\hfill%
        \timerThisslidename: \L{\printtime{#1}}%
        \timerAdvance{\value{#1}}%
    %    \addtocounter{@progresstime}{\value{#1}}%
      }%
    }%
  \end{center}
}
%%%%%%%%%%%%%%%

\newcounter{Slide@time}
\newcommand{\iitsmnr@headskip}{10ex}
\newcommand{\iitsmnr@footskip}{10ex}

% Slide:
%
% The slide environment has two mandatory arguments
%  #1: the slide title
%  #2: the slide time (in seconds)
\newenvironment{Slide}[2]{%
  \ifiitsmnrnotesonly\else\handouts@pagebreak\fi%
  \ifiitsmnrslidesonly\else\vspace*{-\iitsmnr@headskip}

  \begin{slide}
  \slideheading{#1}
  \setcounter{Slide@time}{#2}
}{%
  \end{slide} 
  \ifiitsmnrslidesonly\else\vspace{-\iitsmnr@footskip}
  
  \ifiitsmnrslidesonly%
    \timerAdvance{\value{Slide@time}}%
  \else%
    \ifiitsmnrnotesonly%
      \timerAdvance{\value{Slide@time}}%
    \else%
      %\vspace*{-4ex}\\
      \timerPrintStatusAdvance{Slide@time}%\\
    \fi%
  \fi%
}

% Declare that the 'Slide' environment is also to be considered as "not slide"
\def\slide@list{slide,slide*,allversions,allversions*,Slide}


% This prints a double arrow in the current direction:
% [if A is a result of B]:
% A \hence B works both in LTR and in RTL
\newcommand{\hence}{%
  \if@rl%
    \ensuremath{\Leftarrow}%
  \else%
    \ensuremath{\Rightarrow}%
  \fi%
}

\newcommand{\theenumi@prefixsav}{}
\newcommand{\enumprefix}[1]{%
  \let\theenumi@sav{\theenumi}%
  \renewcommand{\theenumi}{#1\theenumi@prefixsav}%
}
\newcommand{\restoreenum}{\let\theenumi{\theenumi@prefixsav}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The \maketitleslide macro: The contents of a title slide.
% TODO: this needs improvememtns
%

% Some extra text in the title slide:
\newcommand{\iitsmnrTitleExtra}{}

\newcommand{\titleextra}[1]{% 
  \renewcommand{\iitsmnrTitleExtra}{#1}%
}

% The macro itself:
% \@author is defined in the command \author. \@title is defined in \title
\newcommand{\maketitleslide}{%
    \slidepagestyle{empty}

    \begin{center}
      {\huge\sc \@title}

      \vspace{4ex}

      {\Large \@author}
    \end{center}
    
    \vspace{6ex}
    
    \iitsmnrTitleExtra
}