The schedule package^{∗}

Jason Alexander^{†}

1997/10/28

Abstract

A new environment, schedule, is defined. Primarily intended for constructing charts of recurring weekly appointments, the environment may also be used to create a schedule of events and sign-up sheets (for example, scheduling mandatory office visits with students for discussing paper topics, etc.)

This package requires the packages calc and color.

1 Introduction

schedule provides a simple interface for creating graphical charts displaying weekly appointments. Many respects of the overall layout can be customized to suit the user’s desires. Unless these default settings are changed, the created schedule will run from Monday to Friday, 8:00am to 5:00pm, and the only predefined command to insert appointments will be \class, which draws the appointment using black text on a medium-gray background.

The main feature of the schedule package is its accuracy in diagramming the length of appointments. Unlike some professionally available schedule creation programs, the representation of the length of appointments in the schedule package is accurate to the minute. In other words, if you have two appointments, one running from 2:00pm to 3:30pm on Tuesday and another running from 2:00pm to 3:31pm on Wednesday, there is a visible difference between the two representations. Unfortunately, unless you have a high-resolution printer (by which I mean more than 600 dpi) these differences will likely only be noticeable by a on-screen previewing program like ghostview.

2 Examples

The following schedule is typeset using the commands:

∗This file has version number v1.00, last revised 1997/10/28.

†Please send bug reports to: jalex@ea.oac.uci.edu

\CellHeight{.4in}
\CellWidth{1in}
\TimeRange{12:00-15:00}
\SubUnits{30}
\BeginOn{Monday}
\TextSize{\tiny}
\FiveDay
\NewAppointment{meeting}{red}{white}
\NewAppointment{workshop}{green}{blue}
\begin{schedule}[Fall Quarter, 1997]
\class{Moral Philosophy}{HOB2 233}{M}{14:00-16:50}
\class{Math Logic}{EIC 128}{T,Th}{11:00-12:20}
\class{Critical Reasoning}{SSL 290}{M,W,F}{13:00-13:50}
\meeting{Departmental Meeting}{HOB2 233}{W}{12:00-12:50}
\workshop{Crit. Reas. Workshop}{HOB2 233}{T}{13:00-13:50}
\class{Office Hours}{HOB2 210}{W,F}{14:00-14:50}
\end{schedule}

The result is:

Monday Tuesday Wednesday Thursday Friday

Fall Quarter, 1997

12:00 am

12:30 am

1:00 pm

1:30 pm

2:00 pm

2:30 pm

3:00 pm

Moral Philosophy HOB2 233 Math Logic

Math Logic

Critical Reasoning SSL 290 Critical Reasoning SSL 290 Critical Reasoning SSL 290 Departmental Meeting HOB2 233

Crit. Reas. Workshop HOB2 233

Office Hours HOB2 210 Office Hours HOB2 210

This example demonstrates all of the user-customizable options. Note several “features” of the package:

1. Appointments falling outside of the specified time range for the schedule are automatically truncated to fit. If the appointment falls entirely outside of the time range, it is not printed at all.

2. The command \class is predefined to chart appointments pertaining to class attendence. New appointment types may be defined by the user via the \NewAppointment command. The new appointments may use any predefined color for the text or background. Note that the color package allows one to define new colors.

3. The boxes created to represent appointments are sized to be accurate to the minute. In other words, if you have two appointments, one 52 minutes long and the other 53 minutes long, the box representing the second appointment will be slightly longer.

4. The schedule is typeset in a centered displayed environment.

3 User Commands

\CellHeight Including \CellHeight⟨length⟩ before the schedule environment tells L^{A}TEX 2ε what height to make the cells in the schedule (all cells have the same height). Since a cell corresponds to an hour in the schedule, this command allows the user to specify how much vertical space a single hour ought to take up.

\CellWidth Including \CellWidth⟨width⟩ before the schedule environment tells L^{A}TEX 2ε how wide to make every cell in the schedule. The overall width of the schedule is determined by multiplying this value by the number of days (set by the \FiveDay or \SevenDay command), plus the width of the time labels on the left-hand side.

\TimeRange This command must appear before the schedule environment, otherwise L^{A}TEX 2ε will not know how deep to make the grid. It is important to note that the time range is specified using a 24-hour format, with a single hyphen between the two times. Deviating from this format will generate an error.

\SubUnits The \SubUnits⟨number⟩ tells the package how to subdivide the hour. If one does not want any subdivisions, simply use \SubUnits{60}. The value of ⟨number⟩ can be any number than evenly divides 60. It is assumed that, in specifying this value, you know what you are doing: i.e., if you tell L^{A}TEX 2ε to use a \CellHeight of 1in, but then set \SubUnits{3}, you will get 20 subdivisions (with times) in a cell only 1in high. In other words, the text on the left-hand side of the schedule will be typeset as a horrible mess. The solution is simple: if you want a large number of subdivisions, simply set \CellHeight to a greater value.

\BeginOn Including \BeginOn⟨day⟩ tells L^{A}TEX what day of the week to start the schedule on. The possible values are ‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, or ‘Saturday’. My apologies for non-English speaking users of L^{A}TEX. If there is a demand for it, I will fix this in future releases.

\TextSize With the \TextSize⟨font-size⟩ command, the user tells L^{A}TEX what size font to use when typesetting the text inside the boxes. This command ought to be one of the standard L^{A}TEX font-size commands, e.g., \tiny, \scriptsize, etc. Using two large of a font will almost always result in bad line breaks inside the boxes, though, due to the narrow width of a cell.

\FiveDay Tells L^{A}TEX to typeset a five-day schedule.

\SevenDay Tells L^{A}TEX to typeset a seven-day schedule.

\NewAppointment By using the \NewAppointment command, the user can customize the appearance of the schedule by changing the color of the text or the background color. The syntax is \NewAppointment⟨appointment-name⟩⟨background-color⟩⟨text-color⟩.

4 The Macros

1 ⟨∗header⟩

 2 \ProvidesFile{schedule.dtx}
 3 \NeedsTeXFormat{LaTeX2e}
 4 \ProvidesPackage{schedule}
 5 \RequirePackage{calc}
 6 \RequirePackage{color}

7 ⟨/header⟩

8 ⟨∗package⟩

 9 \definecolor{dark}{gray}{.75}

10 %

11 % CONSTANTS FOR THE WEEK

12 %

13 \def\@sunday{Su}
14 \def\@Sunday{Sunday}
15 \def\@monday{M}
16 \def\@Monday{Monday}
17 \def\@tuesday{T}
18 \def\@Tuesday{Tuesday}
19 \def\@wednesday{W}
20 \def\@Wednesday{Wednesday}
21 \def\@thursday{Th}
22 \def\@Thursday{Thursday}
23 \def\@friday{F}
24 \def\@Friday{Friday}
25 \def\@saturday{Sa}
26 \def\@Saturday{Saturday}

27 %

28 % COUNTERS, LENGTHS, ETC.

29 %

30 \newlength{\cell@height}
31 \setlength{\cell@height}{1in}
32 \newlength{\cell@width}
33 \setlength{\cell@width}{1in}
34 \newlength{\box@depth}
35 \newcounter{sch@col@width} \setcounter{sch@col@width}{60}
36 \newlength{\box@width}
37 \setlength{\box@width}{1in*(\value{sch@col@width}/60)}
38 \newlength{\col@width}
39 \setlength{\col@width}{1in*(\value{sch@col@width}/60)}
40 \newlength{\sch@depth} \setlength{\sch@depth}{9in}
41 \newlength{\fill@length}
42 \newlength{\@temp@length}
43 \newlength{\@@temp@length}
44 \newlength{\line@thickness} % The thickness of the lines in the drawing
45 \setlength{\line@thickness}{.4pt}
46 \newlength{\adjusted@cell@width}
47 \newlength{\adjusted@cell@height}

49 \newcounter{picture@units@wide}
50 \newcounter{xcoords}
51 \newcounter{ycoords}
52 \newcounter{timea}
53 \newcounter{timeb}
54 \newcounter{grid@width}
55 \newcounter{grid@height}
56 \newcounter{number@of@cells} % The number of VERTICAL cells
57 \newcounter{number@of@subcells}
58 \newcounter{number@of@days} % The number of days in the grid
59 \newcounter{dp@vlines} % The number of vertical lines actually needed is
60  % \value{number@of@days} + 1 ...
61 \newcounter{dp@hlines} % The number of horizontal lines actually needed is
62  % \value{number@of@cells} + 1 ...
63 \newcounter{dp@hcell@lines} % The number of horizontal lines that are
64  % either (1) associated with an hour, or
65  %        (2) on the top or bottom of the grid.
66 \newcounter{pu@cell@width}
67 \newcounter{pu@cell@height}
68 \setcounter{pu@cell@height}{60}
69 \newcounter{pu@grid@top}
70 \newcounter{pu@grid@width}
71 \newcounter{pu@subticks}
72 \newcounter{start@time}
73 \newcounter{end@time}
74 \newcounter{x@coord} % Temporary x-coordinate
75 \newcounter{y@coord} % Temporary y-coordinate
76 \newcounter{@tempc}
77 \newcounter{@tempd}
78 \newcounter{label@sep}  % distance from label to gride
79 \setcounter{label@sep}{5} %initialized to 5 picture units

80

81 \newcounter{x@Sunday}
82 \newcounter{x@Monday}
83 \newcounter{x@Tuesday}
84 \newcounter{x@Wednesday}
85 \newcounter{x@Thursday}
86 \newcounter{x@Friday}
87 \newcounter{x@Saturday}

88

89 \newsavebox{\temp@box}
90 \newif\ifweekends
91 \newcount\@i
92 \newcount\@j

93

94 \def\TimeRange#1{\compute@number@of@cells #1\end@compute}
95 \def\compute@number@of@cells#1:#2-#3:#4\end@compute{%
96 \setcounter{number@of@cells}{#3-#1}%
97 \setcounter{start@time}{#1}%

 98 \setcounter{end@time}{#3}}

99

100 \def\TextSize#1{\def\appt@textsize{#1}}
101 \TextSize{\scriptsize}

102

103 \def\IncludeWeekends{\weekendstrue}
104 \def\NoWeekends{\weekendsfalse}

105

106 \def\SevenDay{\weekendstrue}
107 \def\FiveDay{\weekendsfalse}

108

109 \def\CellHeight#1{\setlength{\cell@height}{#1}%
110  \setlength{\unitlength}{\cell@height*\ratio{1pt}{60pt}}}
111 \def\CellWidth#1{\setlength{\cell@width}{#1}%
112  \setcounter{pu@cell@width}{1*\ratio{\cell@width}{\unitlength}}}
113 \def\SubUnits#1{\setcounter{pu@subticks}{#1}%
114  \setcounter{number@of@subcells}{60/\value{pu@subticks}}}

115

116 \def\calculate@grid@dimensions{%
117 \ifweekends \setcounter{number@of@days}{7}
118 \else \setcounter{number@of@days}{5}%
119  \fi%
120 \setcounter{dp@hcell@lines}{\value{number@of@cells}+1}
121 \setcounter{grid@width}{\value{number@of@days}*\value{pu@cell@width}}%
122 \setcounter{grid@height}{\value{number@of@cells}*60}
123 \setcounter{dp@vlines}{\value{number@of@days}+1}
124 \setcounter{dp@hlines}{\value{number@of@cells}*(60/\value{pu@subticks}) + 1}}

125 126

127 \def\draw@grid{%\calculate@grid@dimensions
128 \linethickness{.2pt}%
129 \multiput(0,0)(0,\value{pu@subticks}){\value{dp@hlines}}{\line(1,0){\value{grid@width}}}%
130 \thicklines
131 \multiput(0,0)(0,60){\value{dp@hcell@lines}}{\line(1,0){\value{grid@width}}}
132 \thinlines}

133

134 \def\LineThickness#1{\setlength{\line@thickness}{#1}%
135  \linethickness{\line@thickness}%
136  \setlength{\adjusted@cell@width}{\cell@width - 1\line@thickness}
137  \setlength{\adjusted@cell@height}{\cell@height - 1\line@thickness}}

138 139

140 \def\@Su@week{{Sunday} {Monday} {Tuesday} {Wednesday} {Thursday} {Friday} {Saturday}}
141 \def\@M@week{{Monday} {Tuesday} {Wednesday} {Thursday} {Friday} {Saturday} {Sunday}}
142 \def\@T@week{{Tuesday} {Wednesday} {Thursday} {Friday} {Saturday} {Sunday} {Monday}}
143 \def\@W@week{{Wednesday} {Thursday} {Friday} {Saturday} {Sunday} {Monday} {Tuesday}}
144 \def\@Th@week{{Thursday} {Friday} {Saturday} {Sunday} {Monday} {Tuesday} {Wednesday}}
145 \def\@F@week{{Friday} {Saturday} {Sunday} {Monday} {Tuesday} {Wednesday} {Thursday}}
146 \def\@Sa@week{{Saturday} {Sunday} {Monday} {Tuesday} {Wednesday} {Thursday} {Friday}}

148 \def\BeginOn#1{\def\start@day{#1}}

149

150 \def\add@labels{%
151 \ifx\start@day\@Sunday \expandafter\do@days\@Su@week \relax
152 \else\ifx\start@day\@Monday \expandafter\do@days\@M@week \relax
153 \else\ifx\start@day\@Tuesday \expandafter\do@days\@T@week \relax
154  \else\ifx\start@day\@Wednesday \expandafter\do@days\@W@week \relax
155  \else\ifx\start@day\@Thursday \expandafter\do@days\@Th@week \relax
156  \else\ifx\start@day\@Friday \expandafter\do@days\@F@week \relax
157  \else\expandafter\do@days\@Sa@week \relax
158  \fi\fi\fi\fi\fi\fi}

159 160

161 \def\@sfor #1:=#2 \upto #3 \step #4 \do #5{%
162 #1=#2\relax%
163 \@whilenum #1<#3 \do {#5 \advance#1 by #4}#5}

164

165 \def\add@times{%
166 \setcounter{@tempc}{\value{start@time}}%
167 \@sfor \@i :=0 \upto \value{number@of@cells} \step 1 \do%
168  {\setcounter{x@coord}{0}%                               Set the x-coord right
169  \setcounter{y@coord}{\value{grid@height}-60*\@i}%      adjust for the right hour cell
170  \ifnum\value{@tempc}>12%
171  \setcounter{@tempd}{\value{@tempc}-12}%
172  \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[r]{\the@tempd:00 pm\ }}%
173  \else\put(\value{x@coord},\value{y@coord}){\makebox(0,0)[r]{\the@tempc:00 am\ }}%
174  \fi\relax%
175  \@sfor \@j := \value{pu@subticks} \upto 59 \step \value{pu@subticks} \do%
176  {\ifnum\@i=\value{number@of@cells}%  Test to see if this should be the last label
177  \relax%
178  \else%
179  \ifnum\@j=60%
180  \relax%
181  \else%
182  \ifnum\@j<10%
183  \def\the@minutes{0\the\@j}%
184  \else\def\the@minutes{\the\@j}%
185  \fi%
186  \setcounter{y@coord}{\value{y@coord}-\@j}%
187  \ifnum\value{@tempc}>12%
188  \setcounter{@tempd}{\value{@tempc}-12}%
189  \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[r]{\tiny\the@tempd:\the@minutes\ pm\ }}% ...write the time (using pm)...
190  \else\put(\value{x@coord},\value{y@coord}){\makebox(0,0)[r]{\tiny\the@tempc:\the@minutes\ am\ }}% ...write the time (using am).
191  \fi%
192  \fi%
193  \fi%
194  \setcounter{y@coord}{\value{y@coord}+\@j}}
195  \addtocounter{@tempc}{1}}}%

196

197 \def\do@days#1#2#3#4#5#6#7{%

198 \setcounter{x@coord}{1*\ratio{\value{pu@cell@width} pt}{2 pt}}%
199 \setcounter{y@coord}{\value{grid@height}+\value{label@sep}}%
200 \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[b]{\large #1}}%
201 \setcounter{x@coord}{\value{x@coord}+\value{pu@cell@width}}%
202 \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[b]{\large #2}}%
203 \setcounter{x@coord}{\value{x@coord}+\value{pu@cell@width}}%
204 \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[b]{\large #3}}%
205 \setcounter{x@coord}{\value{x@coord}+\value{pu@cell@width}}%
206 \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[b]{\large #4}}%
207 \setcounter{x@coord}{\value{x@coord}+\value{pu@cell@width}}%
208 \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[b]{\large #5}}%
209 \setcounter{x@coord}{\value{x@coord}+\value{pu@cell@width}}%
210 \ifweekends
211 \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[b]{\large #6}}%
212 \setcounter{x@coord}{\value{x@coord}+\value{pu@cell@width}}%
213 \put(\value{x@coord},\value{y@coord}){\makebox(0,0)[b]{\large #7}}\fi}

214 215

216 \def\set@x@coords@for@days{%
217 \ifx\start@day\@Sunday%
218  \@i=0\relax%
219  \@tfor \@temp := {Sunday} {Monday} {Tuesday} {Wednesday} {Thursday} {Friday} {Saturday} \do%
220  {\setcounter{x@\@temp}{\@i*\value{pu@cell@width}}%
221  \advance\@i by 1}
222  \def\skipday@i{F}
223  \def\skipday@ii{Sa}\fi
224 \ifx\start@day\@Monday
225  \@i=0\relax%
226  \@tfor \@temp := {Monday} {Tuesday} {Wednesday} {Thursday} {Friday} {Saturday} {Sunday} \do%
227  {\setcounter{x@\@temp}{\@i*\value{pu@cell@width}}%
228  \advance\@i by 1}
229  \def\skipday@i{Sa}
230  \def\skipday@ii{Su}\fi
231 \ifx\start@day\@Tuesday
232  \@i=0\relax%
233  \@tfor \@temp := {Tuesday} {Wednesday} {Thursday} {Friday} {Saturday} {Sunday} {Monday} \do%
234  {\setcounter{x@\@temp}{\@i*\value{pu@cell@width}}%
235  \advance\@i by 1}
236  \def\skipday@i{Su}
237  \def\skipday@ii{M}\fi
238 \ifx\start@day\@Wednesday
239  \@i=0\relax%
240  \@tfor \@temp := {Wednesday} {Thursday} {Friday} {Saturday} {Sunday} {Monday} {Tuesday} \do%
241  {\setcounter{x@\@temp}{\@i*\value{pu@cell@width}}%
242  \advance\@i by 1}
243  \def\skipday@i{M}
244  \def\skipday@ii{T}\fi
245 \ifx\start@day\@Thursday
246  \@i=0\relax%
247  \@tfor \@temp := {Thursday} {Friday} {Saturday} {Sunday} {Monday} {Tuesday} {Wednesday} \do%

248  {\setcounter{x@\@temp}{\@i*\value{pu@cell@width}}%
249  \advance\@i by 1}
250  \def\skipday@i{T}
251  \def\skipday@ii{W}\fi
252 \ifx\start@day\@Friday
253  \@i=0\relax%
254  \@tfor \@temp := {Friday} {Saturday} {Sunday} {Monday} {Tuesday} {Wednesday} {Thursday} \do%
255  {\setcounter{x@\@temp}{\@i*\value{pu@cell@width}}%
256  \advance\@i by 1}
257  \def\skipday@i{W}
258  \def\skipday@ii{Th}\fi
259 \ifx\start@day\@Saturday
260  \@i=0\relax%
261  \@tfor \@temp := {Saturday} {Sunday} {Monday} {Tuesday} {Wednesday} {Thursday} {Friday} \do%
262  {\setcounter{x@\@temp}{\@i*\value{pu@cell@width}}%
263  \advance\@i by 1}
264  \def\skipday@i{Th}
265  \def\skipday@ii{F}\fi

266 }

267

268 % ------------------------------------------------------------------------
269 % Commands to insert info about an appointment
270 % ------------------------------------------------------------------------
271 \newif\ifset@start@time
272 \newif\ifset@end@time
273 \newif\ifsetboxdepth
274 \newif\ifinrange

275

276 \def\NewAppointment#1#2#3{% #1 = name, #2 = background color, #3 = textcolor
277 \expandafter\def\csname #1\endcsname##1##2##3##4{%
278  \setboxdepthtrue% assume we want to calculate the box depth
279  \inrangetrue% assume the appt is in range
280  \set@start@timetrue% assume we want to calculate the start time
281  \set@end@timetrue% assume we want to calculate the end time
282  \@includetrue% assume we will include it
283  \edef\appt@name{#1}% save the appt name
284  \edef\appt@color{#2}% save the background color
285  \edef\appt@textcolor{#3}% save the save color
286  \expandafter\def\csname #1@name\endcsname{##1}% save the name
287  \expandafter\def\csname #1@location\endcsname{##2}% save the loc.
288  \expandafter\def\csname #1@days\endcsname{##3}% save the days
289  \expandafter\def\csname #1@time\endcsname{##4}% save the time
290  \place@appt@box##3,\stop}}

291

292 \NewAppointment{class}{dark}{black}

293

294 \def\place@appt@box#1{%
295 \ifx#1\stop \let\@next=\@gobble%
296 \else \let\@next=\set@x@coords\fi\@next#1}

298 \def\set@x@coords#1,{\def\the@day{#1}%
299 \ifx\the@day\@sunday\setcounter{xcoords}{\value{x@Sunday}}%
300 \else\ifx\the@day\@monday\setcounter{xcoords}{\value{x@Monday}}%
301 \else\ifx\the@day\@tuesday\setcounter{xcoords}{\value{x@Tuesday}}%
302  \else\ifx\the@day\@wednesday\setcounter{xcoords}{\value{x@Wednesday}}%
303  \else\ifx\the@day\@thursday\setcounter{xcoords}{\value{x@Thursday}}%
304  \else\ifx\the@day\@friday\setcounter{xcoords}{\value{x@Friday}}%
305  \else\setcounter{xcoords}{\value{x@Saturday}}%
306  \fi\fi\fi\fi\fi\fi%
307  \edef\@@temp{\csname \appt@name @time\endcsname}%
308  \expandafter\set@y@coords\@@temp\stop}

309

310 \def\set@y@coords#1:#2-#3:#4\stop{%
311 \def\@starthour{#1}%
312 \def\@startminutes{#2}
313 \def\@endhour{#3}%
314 \def\@endminutes{#4}%
315 \ifnum#1<\value{start@time} \setcounter{ycoords}{\value{grid@height}}%
316  \edef\@starthour{\value{start@time}}
317  \def\@startminutes{0}
318  \set@start@timefalse%
319  \fi%
320 \ifnum#3<\value{end@time} \relax%
321  \else \edef\@endhour{\value{end@time}}
322  \def\@endminutes{0}%
323  \setcounter{ycoords@bot}{0}
324  \set@end@timefalse
325 \fi %
326 \ifset@start@time%
327 \setcounter{ycoords}{\value{grid@height}-(60*(#1-\value{start@time})+#2)}\fi%
328 \ifset@end@time%
329  \setcounter{ycoords@bot}{\value{grid@height}-(60*(#3-\value{start@time})+#4)}\fi%
330 \setlength{\box@depth}{\@endhour\cell@height + (\cell@height*\ratio{\@endminutes pt}{60pt}) %
331  - \@starthour\cell@height - (\cell@height*\ratio{\@startminutes pt}{60pt})}%
332 \ifnum#1<\value{end@time} \relax\else \inrangefalse \fi%
333 \draw@appt@box\place@appt@box}

334

335 \newif\if@include

336

337 \def\draw@appt@box{%
338 \ifweekends \relax % if we use 7-days, this won't change
339 \else \ifx \the@day\skipday@i \@includefalse \fi % first condition for change
340  \ifx \the@day\skipday@ii \@includefalse \fi\fi % second condition for change
341 \ifinrange \relax\else \@includefalse \fi %
342 \if@include %
343 \put(\value{xcoords},\value{ycoords}){\colorbox{\appt@color}{\parbox[t]{\cell@width}{\ %
344  \vspace{\box@depth}}}}
345 \thinlines
346 \put(\value{xcoords},\value{ycoords}){\line(1,0){\value{pu@cell@width}}}
347 \put(\value{xcoords},\value{ycoords@bot}){\line(1,0){\value{pu@cell@width}}}

348 \put(\value{xcoords},\value{ycoords}){%
349  \  \parbox[t]{\cell@width-8pt}{\mbox{}\\ \appt@textsize %
350  \ifdim\box@depth>\baselineskip
351  \textcolor{\appt@textcolor}{\csname \appt@name @name\endcsname} \\ %
352  \ifdim\box@depth>2\baselineskip
353  \textcolor{\appt@textcolor}{\csname \appt@name
354  @location\endcsname}\fi\fi }}\fi}

355

356 \def\convert@class@time#1:#2-#3:#4\end@time{%
357 {\count1=#1\relax%
358 \count3=#3\relax%
359 \ifnum#1>12 \advance\count1 by -12\fi\relax%
360 \ifnum#3>12 \advance\count3 by -12\fi\relax%
361 \ifnum#1<12\relax%
362  \ifnum#3<12\relax \mbox{\the\count1:#2am--\the\count3:#4am}\relax%
363  \else \mbox{\the\count1:#2am--\the\count3:#4pm}\fi\relax%
364  \else \mbox{\the\count1:#2pm--\the\count3:#4pm}\fi\relax}}

365

366 \def\compute@box@depth#1:#2-#3:#4\end@bx{%
367 \setlength{\box@depth}{#3\cell@height + (\cell@height*\ratio{#4pt}{60pt}) %
368  - #1\cell@height - (\cell@height*\ratio{#2pt}{60pt})}}

369

370 \newcounter{ycoords@bot}

371

372 \newcounter{x@tempa}
373 \newcounter{x@tempb}
374 \newcounter{y@tempa}
375 \newcounter{y@tempb}
376 \newcounter{temp@cnt@a}

377

378 \newlength{\title@height}
379 \newlength{\label@height}
380 \settoheight{\label@height}{Wednesday}

381

382 \newcounter{pu@label@width}
383 \newlength{\center@hack}

384

385 \newenvironment{schedule}[1][:]%
386 {\bigskip
387 \calculate@grid@dimensions%
388 \setcounter{pu@grid@width}{\value{pu@cell@width}*\value{number@of@days}}%
389 \settowidth{\@temp@length}{\normalsize 12:00\ pm\ }%
390 \setcounter{pu@label@width}{1*\ratio{\@temp@length}{\unitlength}}%
391 \setcounter{pu@grid@top}{\value{grid@height}+(1*\ratio{\label@height}{\unitlength}) + %
392  (1*\ratio{.25in}{\unitlength})}%
393 \if#1:\relax \else%
394 \settoheight{\title@height}{\large #1}%
395 \addtocounter{pu@grid@top}{1*\ratio{\title@height}{\unitlength}}%
396 \fi%
397 \setlength{\center@hack}{(.5\linewidth-.5\unitlength*\value{pu@grid@width}+%

398 .5\unitlength*\value{pu@label@width})}%
399 \noindent\hspace*{\center@hack}%
400 \begin{picture}(\value{pu@grid@width},\value{pu@grid@top})%
401 \draw@grid
402 \add@labels
403 \if#1:\relax \else
404 \setcounter{ycoords}{\value{grid@height}+(1*\ratio{\label@height}{\unitlength}) + %
405  (1*\ratio{.25in}{\unitlength})}
406 \setcounter{xcoords}{1*\ratio{\value{pu@grid@width} pt}{2 pt}}
407 \put(\value{xcoords},\value{ycoords}){\makebox(0,0)[b]{\Large #1}}
408 \fi
409 \add@times
410 \set@x@coords@for@days}
411 {\multiput(0,0)(\value{pu@cell@width},0){\value{dp@vlines}}{\line(0,1){\value{grid@height}}}
412 \end{picture}\bigskip}

413

414 \setlength{\fboxsep}{0in}
415 %\pagestyle{empty}

416 ⟨/package⟩

Change History

v1.00 General: Initial version. . . . . . . . . 1

Index

Numbers written in italic refer to the page where the corresponding entry is described, the ones underlined to the code line of the definition, the rest to the code lines where the entry is used.

Symbols

\@@temp . . . . . . 307, 308

 \@@temp@length . . . . 43

\@F@week . . . . . 145, 156 \@Friday . . 24, 156, 252 \@M@week . . . . . 141, 152 \@Monday . . 16, 152, 224 \@Sa@week …. 146, 157

 \@Saturday . . . . 26, 259

\@Su@week …. 140, 151 \@Sunday . . 14, 151, 217 \@T@week . . . . . 142, 153 \@Th@week …. 144, 155

 \@Thursday 22, 155, 245

\@Tuesday . 18, 153, 231 \@W@week . . . . . 143, 154

                           \@Wednesday 20, 154, 238

\@endhour . 313, 321, 330

                           \@endminutes . . . . . .

…. 314, 322, 330 \@friday . . . . . . 23, 304 \@gobble . . . . . . . . . 295 \@i … 91, 167, 169,

176, 218, 220, 221, 225, 227, 228, 232, 234, 235, 239, 241, 242, 246, 248, 249, 253, 255, 256, 260, 262, 263

                                                    \@includefalse 339–341
                                                    \@includetrue . . . . . 282

\@j … 92, 175, 179,

182–184, 186, 194 \@monday . . . . . . 15, 300 \@next . . . . . . . 295, 296

                                                    \@saturday . . . . . . . 25

\@sfor …. 161, 167, 175

                                                    \@starthour 311, 316, 331
                                                    \@startminutes . . . .

…. 312, 317, 331 \@sunday . . . . . . 13, 299 \@temp . . . . . . . 219,

220, 226, 227, 233, 234, 240, 241, 247, 248, 254, 255, 261, 262

\@temp@length . . . . .

. . . . . 42, 389, 390 \@tfor 219, 226, 233,

240, 247, 254, 261

\@thursday . . . . 21, 303

\@tuesday . . . . . 17, 301

\@wednesday . . . . 19, 302
\@whilenum . . . . . . . 163

\\ . . . . . . . . . . 349, 351

\␣ … 172, 173, 189, 190, 343, 349, 389

A

\add@labels . . . 150, 402
\add@times . . . 165, 409
\adjusted@cell@height

. . . . . . . . 47, 137

\adjusted@cell@width

. . . . . . . . 46, 136

\appt@color . . . 284, 343
\appt@name . . . . . . .

. 283, 307, 351, 353

\appt@textcolor . . .

…. 285, 351, 353

\appt@textsize 100, 349

B

\baselineskip . 350, 352

\BeginOn . . . . . . . \underline{1}, 148 \bigskip . . . . . 386, 412

\box@depth . 34, 330,

344, 350, 352, 367

\box@width . . . . . 36, 37

C

\calculate@grid@dimensions

…. 116, 127, 387

\cell@height . 30, 31,

109, 110, 137, 330, 331, 367, 368

\cell@width . . . . . . .

… 32, 33, 111, 112, 136, 343, 349

\CellHeight . . . . . \underline{1}, 109
\CellWidth . . . . . \underline{1}, 111

\center@hack . . . . . .

…. 383, 397, 399

\col@width . . . . . 38, 39

\colorbox . . . . . . . . 343

\compute@box@depth . 366
\compute@number@of@cells

. . . . . . . . . 94, 95

\convert@class@time 356

\count 357–360, 362–364

D

\definecolor . . . . . . . 9

\do@days . . 151–157, 197

\draw@appt@box 333, 337
\draw@grid . . . 127, 401

E

\end@bx . . . . . . . . . . 366

\end@compute . . . . 94, 95

\end@time . . . . . . . . 356

F

\fboxsep . . . . . . . . . 414

\fill@length . . . . . . 41

\FiveDay . . . . . . . \underline{1}, 107

H

\hspace . . . . . . . . . . 399

I

\if@include . . . 335, 342

\ifdim . . . . . . . 350, 352

\ifinrange . . . 274, 341
\ifset@end@time 272, 328
\ifset@start@time .

. . . . . . . . 271, 326

\ifsetboxdepth . . . . 273
\ifweekends . . . . . . .

. 90, 117, 210, 338

\IncludeWeekends . . 103
\inrangefalse . . . . . 332
\inrangetrue . . . . . . 279

L

\label@height . . . . .

. 379, 380, 391, 404 \Large . . . . . . . . . . . 407 \let . . . . . . . . . 295, 296 \line . . . . . . . . 129,

131, 346, 347, 411

                          \line@thickness . . .

. . 44, 45, 134–137

                          \LineThickness . . . . 134
                          \linethickness 128, 135
                          \linewidth . . . . . . . 397

M \makebox . . 172, 173,

189, 190, 200, 202, 204, 206, 208, 211, 213, 407

\multiput . 129, 131, 411

N

                          \NeedsTeXFormat . . . . 3
                          \NewAppointment . . .

. . . . . . \underline{1}, 276, 292 \newcount . . . . . . 91, 92

                          \newcounter 35, 49–59,

61, 63, 66, 67, 69–78, 81–87, 370, 372–376, 382

                          \newenvironment . . . 385

\newif . 90, 271–274, 335

                          \newlength 30, 32, 34,

36, 38, 40–44, 46, 47, 378, 379, 383

                          \newsavebox . . . . . . . 89
                          \NoWeekends . . . . . . . 104

P

                          \pagestyle . . . . . . . 415

\parbox . . . . . . 343, 349

                          \place@appt@box . . .

…. 290, 294, 333

                          \ProvidesFile . . . . . . 2
                          \ProvidesPackage . . . 4

\put . . . . . . 172, 173, 189, 190, 200, 202, 204, 206, 208, 211, 213, 343, 346–348, 407

R \ratio …. 110, 112,

198, 330, 331, 367, 368, 390– 392, 395, 404–406

                          \RequirePackage . . 5, 6

S

\sch@depth . . . . . . . 40
\scriptsize . . . . . . . 101
\set@end@timefalse . 324
\set@end@timetrue . 281
\set@start@timefalse

. . . . . . . . . . . 318

\set@start@timetrue 280
\set@x@coords . 296, 298
\set@x@coords@for@days

. . . . . . . . 216, 410

\set@y@coords . 308, 310
\setboxdepthtrue . . 278
\settoheight . . 380, 394
\settowidth . . . . . . . 389

\SevenDay . . . . . . \underline{1}, 106

\skipday@i . . . 222,

229, 236, 243, 250, 257, 264, 339

                          \skipday@ii . . . 223,

230, 237, 244, 251, 258, 265, 340

                          \start@day . . . . . . .

. 148, 151–156, 217, 224, 231, 238, 245, 252, 259

\step . . . . . 161, 167, 175 \stop . 290, 295, 308, 310 \SubUnits . . . . . . \underline{1}, 113

T \temp@box . . . . . . . . 89

                          \textcolor . . . 351, 353

\TextSize . . \underline{1}, 100, 101 \the@day . . . . . . . . .

. 298–304, 339, 340

                          \the@minutes . . . . . .

. 183, 184, 189, 190

                                                   \the@tempc . . . 173, 190
                                                   \the@tempd . . . 172, 189
                                                   \thicklines . . . . . . . 130
                                                   \thinlines . . . 132, 345
                                                   \TimeRange . . . . . . \underline{1}, 94

\tiny . . . . . . . . 189, 190

                                                   \title@height . . . . .

…. 378, 394, 395

U

                                                   \unitlength 110, 112,

390–392, 395, 397, 398, 404, 405

\upto . . . . . 161, 167, 175

W

                                                   \weekendsfalse 104, 107
                                                   \weekendstrue . 103, 106