summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/calendar/timesht.dtx
blob: 407b20ab4544308dba02512f8d02c9b666b1f31e (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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
%\iffalse
%
% file: timesht.dtx
% Copyright (C) 1996-1997 by Frank Bennett.  All rights reserved.
%
% IMPORTANT NOTICE:
% 
% You are not allowed to change this file.  You may however copy
% this file to a file with a different name and then change the
% copy if (a) you do not charge for the modified code, (b) you
% acknowledge the author of this file in the new file, if it
% is distributed to others, and (c) you attach these same
% conditions to the new file.
% 
% You are not allowed to distribute this file alone.  You are not
% allowed to take money for the distribution or use of this file
% (or a changed version) except for a nominal charge for copying
% etc.
% 
% You are allowed to distribute this file under the condition that
% it is distributed with all of its contents, intact.
% 
% For error reports, or offers to help make this a more powerful,
% friendlier, and altogether more thrilling package, please contact me on
% fb@soas.ac.uk.  Better yet, make a contribution to
% my pension.  Account details available on request.
%
%\fi
%
% \def\fileversion{3.1.1.1}
% \def\filedate{1998/01/17 18:15:23}
%
% \iffalse
%
%<*driver>
\documentclass{ltxdoc}
%\CodelineIndex
%\EnableCrossrefs
\begin{document}
\OnlyDescription    % Comment out for implementation details
\DocInput{timesht.dtx}
\end{document}
%</driver>
%\fi
%
% \changes{v1.1}{1997/02/26}{Redraft of original Timesheets
%   package, using Timetable package as a model.}
% \changes{v1.2}{1997/10/18}{New public release of all styles
%  and modules incorporating global bug-fixes.}
%
%\iffalse
% Source tree moved under RCS
% ---------------------------
% timesht.dtx,v
% Revision 3.1.1.1  1998/01/17 18:15:23  root
% Release code, checksum verified
%
% Revision 3.1  1998/01/17 17:15:05  root
% Release code
%
% Revision 2.15  1998/01/17 11:54:43  root
% *** empty log message ***
%
% Revision 2.14  1998/01/17 11:48:41  root
% *** empty log message ***
%
% Revision 2.13  1998/01/17 10:27:17  root
% *** empty log message ***
%
% Revision 2.12  1998/01/17 10:25:29  root
% *** empty log message ***
%
% Revision 2.11  1998/01/17 04:42:57  root
% *** empty log message ***
%
% Revision 2.10  1998/01/16 20:42:51  root
% *** empty log message ***
%
% Revision 2.9  1998/01/16 17:10:16  root
% *** empty log message ***
%
% Revision 2.8  1997/12/06 09:04:25  root
% Finished elimination of landscape code, eliminated superfluous brace.
%
% Revision 2.7  1997/12/06 09:01:41  root
% Initialized tms@blocklist to empty macro.
%
% Revision 2.6  1997/12/06 08:54:55  root
% Changed docstrip label from class to package.
%
% Revision 2.5  1997/12/06 08:32:41  root
% Disable paragraph indenting inside calendar environment.
%
% Revision 2.4  1997/12/06 08:27:43  root
% Converted to style from class.
%
% Revision 2.3  1997/12/04 19:32:22  bennett
% Added typeface variables for appointments having only a
% single time.
%
% Revision 2.2  1997/11/07 10:44:05  root
% Release code.
%
% Revision 2.1.1.3  1997/11/05 06:21:56  root
% Superfluous brace in new definition.
%
% Revision 2.1.1.2  1997/11/05 06:17:14  root
% Hooked up title parameter following report fro,
%
% from Edward Czilli.
%
% Revision 2.1.1.1  1997/11/04 05:06:07  root
% Development branch
%
% Revision 2.1  1997/11/01 14:47:16  bennett
% Release code.
%
% Revision 1.7  1997/10/30 20:25:58  root
% Moved \extrarowheight so that it is only invoked once, when
% the table is first opened.
%
% Revision 1.6  1997/10/30 13:46:59  root
% Moved reset of counter, in the code for the group-closing
% footer, above the closing \\\hline to avoid leftovers on
% the following line.
%
% Revision 1.5  1997/10/30 12:38:13  root
% Changed use of \@newline to \par, to avoid weird errors arising
% from LaTeX for reasons I do not fully understand.
%
% Revision 1.4  1997/10/30 12:31:50  root
% Put \relax after the option text setting blockminutes.
%
% Revision 1.3  1997/10/29 20:13:36  bennett
% *** empty log message ***
%
% Revision 1.2  1997/10/29 17:18:39  root
% Added reset of block counter on end of subgroup, to make
% underlining between blocks position correctly on second
% and subsequent pages.
%
% Revision 1.1  1997/10/29 08:17:52  root
% Initial revision
%
%\fi
%
% \title{User's Guide to the Timesheet
%    package\thanks{This file is version number
%    \fileversion{}.  It was last revised on
%    \filedate{}.}}
%
% \author{Frank G. Bennett, Jr.}
%
% \maketitle
%
% \setcounter{StandardModuleDepth}{1}
% \DeleteShortVerb{\|}
% \MakeShortVerb{\"}
%
% \CheckSum{598}
%
% \section{Note}
%
% Documentation for this package is contained in the file
% \texttt{calguide.tex}.
%
%\StopEventually{\PrintIndex}
%
% \section{The Class File}
%
% Preliminaries.
%
%    \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{timesht}
          [1998/01/17 18:15:23 3.1.1.1 Timesheet (Frank Bennett)]
%    \end{macrocode}
%
% Initialize all registers and if statements to be
% used by this class.
%
%    \begin{macrocode}
\newif\iftms@usetimes
\tms@usetimestrue
\newlength\tms@tablewidth
\newlength{\tms@hw}
\newlength{\tms@templen}
\newlength{\tms@widthlessboxes}
\newlength{\tms@timetextlen}
\newtoks\tms@tempreg@a
\newtoks\tms@tempreg@b
\newcount\tms@tempcount
\newcount\tms@start
\newcount\tms@end
\newcount\tms@minuteblocks
\newcount\tms@boxes
\newcount\tms@days
\newcount\tms@blocks
\newcount\tms@time@start
\newcount\tms@time@end
\newcount\tms@hours@start
\newcount\tms@minutes@start
\newcount\tms@hours@end
\newcount\tms@minutes@end
\newcount\tms@minute@base
\newlength{\tms@numlen}
\newcount\tms@rightprop
\newcount\tms@leftprop
\newcount\tms@groupblocks
\newcount\tms@groupblockcount
\tms@groupblockcount=1%
\newlength{\tms@colonlen}
\newlength{\tms@dashlen}
\newlength{\tms@leftlen}
\newlength{\tms@rightlen}
\tms@leftprop=1%
\tms@rightprop=1%
%    \end{macrocode}
% Language setup.
%    \begin{macrocode}
\input calopts.cfg
\InputIfFileExists{dates.cfg}{}{}
\ProcessOptions
%    \end{macrocode}
%
% Load a bunch of useful packages.
%
%    \begin{macrocode}
\RequirePackage{longtable}
\RequirePackage{array}[1996/06/14]
\RequirePackage{calendar}
\RequirePackage{keyval}
%    \end{macrocode}
%
% Turn off the listing of days in the Calendar style.
% It only works well for monthly calendars.
%
%    \begin{macrocode}
\tracingdates=0%
%    \end{macrocode}
%
% Set up a list of options for the Calendar style engine
% to use with the "keyval" parser.
%
%    \begin{macrocode}
\define@key{opt}{leftspace}{\setlength{\LTleft}{#1}}
\define@key{opt}{rightspace}{\setlength{\LTright}{#1}}
\define@key{opt}{width}{\setlength{\tms@tablewidth}{#1}}
\define@key{opt}{title}{\def\tms@title{#1}}
\define@key{opt}{start}{\@settime\tms@start#1{}}
\define@key{opt}{end}{\@settime\tms@end#1{}}
\define@key{opt}{blockminutes}{\tms@minuteblocks=#1\relax}
\define@key{opt}{blockgroup}{\tms@groupblocks=#1\relax}
\define@key{opt}{leftright}{\tms@extractprops#1{}}
\define@key{opt}{titletype}{\def\tms@titletype##1{{#1{##1}}}}
\define@key{opt}{labeltype}{\def\tms@labeltype##1{{#1{##1}}}}
\define@key{opt}{timelabeltype}{\def\tms@timelabeltype##1{{#1{##1}}}}
\define@key{opt}{timeitemtype}{\def\tms@timeitemtype##1{{#1{##1}}}}
\define@key{opt}{itemtype}{\def\tms@itemtype##1{{#1{##1}}}}
\define@key{opt}{notimes}[f]{\tms@usetimesfalse}
%    \end{macrocode}
%
% Before setting default values, 
% provide a set of parsing macros for use in scanning
% some of the options fed to the "keyval" parser.
% Doing this here allows us to specify the defaults in a
% human readable syntax.
%
%    \begin{macrocode}
\def\tms@extractprops#1/#2#{%
  \tms@leftprop=#1\tms@rightprop=#2}
\def\@settime#1#2:#3#{%
  \tms@tempcount=#2%
  \multiply\tms@tempcount by60%
  \advance\tms@tempcount by#3%
  \global#1\tms@tempcount}
\def\@splitblocks#1-#2#{%
  \def\@blockstarttext{#1}%
  \def\@blockendtext{#2}}
\def\@setblocks#1,#2#{%
  \ifcat$#1$%
    \let\next\@gobble%
  \else%
    \let\next\@setblocks%
    \global\advance\tms@blocks by 1%
    \@splitblocks#1{}%
    \expandafter\@settime%
      \expandafter\tms@time@start\@blockstarttext{}%
    \expandafter\@settime%
      \expandafter\tms@time@end\@blockendtext{}%
    \let\tms@tempmac\tms@blocklist%
    \edef\tms@blocklist{%
      \tms@tempmac\the\tms@time@start-\the\tms@time@end,}%
  \fi%
    \next#2{}}
\def\tms@chopblock#1-#2,#3#{%
  \global\tms@time@start=#1%
  \global\tms@time@end=#2%
  \gdef\tms@blocklist{#3}}%
\def\tms@labellist{}%
\def\@extractlabels#1,#2#{%
  \ifcat$#1$%
    \tms@tempreg@a=\expandafter{\tms@labellist}%
    \edef\tms@label##1{%
      \noexpand\ifcase##1\the\tms@tempreg@a\noexpand\fi}%
    \let\next\@gobble%
  \else%
    \let\next\@extractlabels%
    \let\tms@tempmac\tms@labellist%
    \expandafter\def%
      \expandafter\tms@labellist%
      \expandafter{%
      \tms@tempmac\or #1}%
  \fi%
    \next#2{}}
%    \end{macrocode}
%
% Set up default values for the "keyval" options.
%
%    \begin{macrocode}
\def\tms@titletype#1{{\Large\bfseries#1}}%
\def\tms@labeltype#1{{\large\bfseries#1}}%
\def\tms@timelabeltype#1{{\bfseries#1}}
\def\tms@timeitemtype#1{{\large#1}}
\def\tms@itemtype#1{{\small#1}}
\def\tms@title{\themonth\space\theday,\space\theyear}
\@settime\tms@start8:00{}
\@settime\tms@end17:00{}
\tms@minuteblocks=15\relax%
\def\tms@blocklist{}%
\def\tms@label#1{\themonth\space\theday}%
\tms@groupblocks=4\relax%
\tms@extractprops4/5{}
%    \end{macrocode}
%
%
% Define the calendar.  As for all Calendar styles,
% this is done using "\newcalendar" with 17 arguments.
%
%    \begin{macrocode}
\newcalendar%
%    \end{macrocode}
%
% Name the new calendar environment.
%
%    \begin{macrocode}
{timesheet}
%    \end{macrocode}
%
% Select an off-the-shelf macro for printing
% that will dump printable
% items on DVI.
%
%    \begin{macrocode}
{\cal@insert}
%    \end{macrocode}
%
% Be indifferent to the starting day of the week.
% ("0" through "6" specify Sunday through Saturday).
%
%    \begin{macrocode}
{7}
%    \end{macrocode}
%
% Set the number of items in a group (time blocks)
%
%    \begin{macrocode}
{\tms@blocks}
%    \end{macrocode}
%
% Set the number of items in a subgroup (one block).
%
%    \begin{macrocode}
{1}
%    \end{macrocode}
%
% Use ampersand table separator before all items
% but the first in a subgroup (never used, b/c only one item).
%
%    \begin{macrocode}
{&}
%    \end{macrocode}
%
% Increment the date at the end of every group, and sneak
% in a post-increment recalculation for the time labels.
%
%    \begin{macrocode}
{G\tms@gettimes}
%    \end{macrocode}
%
% Specify the header.  This has to be built on the fly
% in the Timesheet style, to give control over width
% to the user.   So just give the
% name of the macro here.
%    \begin{macrocode}
{\tms@header}
%    \end{macrocode}
%
% Specify the tail of the table.
%
%    \begin{macrocode}
{&%
 \global\tms@groupblockcount=1\relax%
 \\\hline%
 \end{longtable}}%
%    \end{macrocode}
%
% How to end a group.
%
%    \begin{macrocode}
{\cal@footer\newpage\cal@header}
%    \end{macrocode}
%
% Specify how to break the end of a subgroup.
% In this case, we end the table line and add
% a time block that must be generated on the fly.
%
% The new "\\*" form in "longtable" seems to have no
% impact here.  Rats.
%
%    \begin{macrocode}
{&%
 \ifnum\tms@groupblockcount<\tms@groupblocks%
  \\*\cline{1-4}%
  \global\advance\tms@groupblockcount by1\relax%
 \else%
  \\\hline%
  \global\tms@groupblockcount=1\relax%
 \fi%
 \tms@timecoltext}
%    \end{macrocode}
% Next is code to be run before the calendar options
% are digested and the controlling date is read.
%
% \textit{Set a couple of Calendar toggles before
% scanning the date contained in the "timesheet"
% environment.}
%    \begin{macrocode}
{\dates@requiremonthtrue\dates@requiredaytrue
%    \end{macrocode}
% \textit{Set default width of table.}
%    \begin{macrocode}
  \setlength{\tms@tablewidth}{\textwidth}
%    \end{macrocode}
% \textit{Initialize \cs{tms@blocklist} to \texttt{nil}.}
%    \begin{macrocode}
  \def\tms@blocklist{}}
%    \end{macrocode}
%
% "\cal@range@start", "\cal@range@end" and "\dates@date"
% are all set internally, so we just provide information
% here.  Remember to adjust human-readable dates with
% "\caldate" when changing "\dates@date", and
% long dates with "\dates@fix" when adjusting
% the human readable stuff.
%
%    \begin{macrocode}
{\message{^^JStart: \theshortweekday\space%
    \theday\space\theshortmonth\space\theyear}%
  \dates@date\cal@range@end%
  \caldate%
  \message{^^JEnd: \theshortweekday\space%
    \theday\space\theshortmonth\space\theyear}%
  \dates@date\cal@range@start%
  \caldate%
%    \end{macrocode}
%
% \textit{Set the number of blocks and the number of blocks in a group.}
%
%    \begin{macrocode}
\relax%
\tms@blocks\tms@end%
\advance\tms@blocks by-\tms@start%
\divide\tms@blocks by\tms@minuteblocks%
%    \end{macrocode}
%
% \textit{Prepare an algorithm to derive the start and
% end time of a block from the value of the
% counter \texttt{cal@group@count} and set values in
% \texttt{tms@time@start}, \texttt{tms@time@end}
% and \texttt{tms@timecoltext}.}
%
%    \begin{macrocode}
  \def\tms@gettimes{%
    \ifcat$\tms@blocklist$%
      \tms@time@start\cal@group@count%
      \multiply\tms@time@start by\tms@minuteblocks%
      \global\advance\tms@time@start by\tms@start%
      \tms@time@end\tms@time@start%
      \global\advance\tms@time@end by\tms@minuteblocks%
    \else%
      \expandafter\tms@chopblock\tms@blocklist-,{}%
    \fi%
      \mod{60}\tms@time@start\tms@minutes@start%
      \tms@hours@start\dates@three%
      \divide\tms@hours@start by60%
      \mod{60}\tms@time@end\tms@minutes@end%
      \tms@hours@end\dates@three%
      \divide\tms@hours@end by60%
      \ifnum\tms@minutes@start<10%
        \edef\tms@minutes@start@mac{0\the\tms@minutes@start}%
      \else%
        \edef\tms@minutes@start@mac{\the\tms@minutes@start}%
      \fi%
      \ifnum\tms@minutes@end<10%
        \edef\tms@minutes@end@mac{0\the\tms@minutes@end}%
      \else%
        \edef\tms@minutes@end@mac{\the\tms@minutes@end}%
      \fi%
      \xdef\tms@timecoltext{%
        \noexpand\tms@timelabeltype{\the\tms@hours@start}&%
        \noexpand\tms@timelabeltype{\tms@minutes@start@mac}&%
        \noexpand\tms@timelabeltype{\the\tms@hours@end}&%
        \noexpand\tms@timelabeltype{\tms@minutes@end@mac}&}}%
%    \end{macrocode}
%
% \textit{Set the dimensions of the table.  We don't have
% to worry about the vertical dimensions; we leave that
% to longtable.}
%
% \textit{First let the user know what we're planning to do.}
%
%    \begin{macrocode}
\message{Package Timesheet: %
  setting table \the\tms@tablewidth\space in width.^^J}%
%    \end{macrocode}
%
% \textit{The rules surrounding the first (time) column.}
%
%    \begin{macrocode}
  \setlength{\tms@widthlessboxes}{2\arrayrulewidth}%
%    \end{macrocode}
%
% \textit{The rules at the end of the text columns.}
%
%    \begin{macrocode}
  \addtolength{\tms@widthlessboxes}{3\arrayrulewidth}%
  \addtolength{\tms@widthlessboxes}{\doublerulesep}%
%    \end{macrocode}
%
% \textit{The space between the rules and the neighbouring text.}
%
%    \begin{macrocode}
  \addtolength{\tms@widthlessboxes}{6\tabcolsep}%
%    \end{macrocode}
%
% \textit{The width of the time text.}
%
%    \begin{macrocode}
  \settowidth{\tms@numlen}{\tms@timelabeltype{99}}%
  \settowidth{\tms@colonlen}{\tms@timelabeltype{:}}%
  \settowidth{\tms@dashlen}{\tms@timelabeltype{\ --\ }}%
  \addtolength{\tms@widthlessboxes}{4\tms@numlen}%
  \addtolength{\tms@widthlessboxes}{2\tms@colonlen}%
  \addtolength{\tms@widthlessboxes}{\tms@dashlen}%
%    \end{macrocode}
%
% \textit{Everything else is for the text columns.}
%
%    \begin{macrocode}
  \tms@tempcount\tms@leftprop%
  \advance\tms@tempcount by\tms@rightprop%
%
  \setlength{\tms@templen}{\tms@tablewidth}%
  \addtolength{\tms@templen}{-\tms@widthlessboxes}%
%
  \tms@leftlen\tms@templen%
  \divide\tms@leftlen by\tms@tempcount%
  \global\multiply\tms@leftlen by\tms@leftprop%
%
  \tms@rightlen\tms@templen%
  \divide\tms@rightlen by\tms@tempcount%
  \global\multiply\tms@rightlen by\tms@rightprop%
%    \end{macrocode}
%
% \textit{Prepare the macro that will generate a table
% header with an appropriate number of columns
% in appropriate sizes.}
%
%    \begin{macrocode}
  \tms@tempcount\tms@days%
  \advance\tms@tempcount by1%
  \protected@edef\tms@header{%
    \noexpand\begin{longtable}{%
      |>{\hfill}%
       m{\the\tms@numlen}%
       @{\tms@timelabeltype{:}}%
       m{\the\tms@numlen}%
      @{\tms@timelabeltype{\ --\ }}%
      >{\hfill}%
      m{\the\tms@numlen}%
      @{\tms@timelabeltype{:}}%
      m{\the\tms@numlen}%
      |%
      m{\the\tms@leftlen}||%
      m{\the\tms@rightlen}|}%
     \noexpand\multicolumn{6}{c}%
      {\tms@titletype{\noexpand\tms@title}}%
     \\%
     \noexpand\multicolumn{4}{l}{}%
     &%
     \noexpand\multicolumn{1}{c}{\textbf{Plan}}&%
     \noexpand\multicolumn{1}{c}{\textbf{Action}}%
     \noexpand\\\noexpand\hline%
     \noexpand\endhead%
     \noexpand\tms@timecoltext}%
   \extrarowheight=3pt}
%    \end{macrocode}
%
% Specify the divider to be placed between entries
% within a timesheet box.
%
%    \begin{macrocode}
{\par\smallskip}%
%    \end{macrocode}
%
% Use the standard Calendar item-fetching macros to
% grab classes of items.  We only need appointments
% (things with a time associated with them) in this case,
% and we specify the range of the current box to
% limit the entries that are grabbed for current use.
%
%    \begin{macrocode}
{\cal@get@appointments[\tms@time@start/\tms@time@end]}%
%    \end{macrocode}
%
% Prepare macro text that will set the text to
% "\longtext" on the first entry, and "\shorttext"
% with braces thereafter.
%
%    \begin{macrocode}
{\relax%
  \ifnum\dates@time@start>0\relax%
%    \end{macrocode}
%
%  \textit{We print a short entry for anything that starts
% outside the slot we are dealing with.}
%
%    \begin{macrocode}
    \ifnum\dates@time@start<\tms@time@start%
      \protected@edef\cal@entry@text{%
        \noexpand\parbox{\the\tms@leftlen}{\noexpand\raggedright%
        \noexpand\tms@itemtype{%
          \noexpand$\noexpand<\noexpand$%
        \theshorttext, to \cal@appt@end@text%
        \noexpand$\noexpand>\noexpand$}}}%
%    \end{macrocode}
%
% \textit{All other conforming entries get the long text.}
%
%    \begin{macrocode}
    \else%
      \ifnum\dates@time@start<\dates@time@end%
        \protected@edef\cal@entry@text{%
          \noexpand\parbox{\the\tms@leftlen}{\noexpand\raggedright%
          \iftms@usetimes%
          \noexpand\tms@timeitemtype{%
            \cal@appt@start@text%
            --%
            \cal@appt@end@text}%
          \space%
          \fi%
          \noexpand\tms@itemtype{%
            \thelongtext}}}%
      \else%
        \protected@edef\cal@entry@text{%
         \noexpand\parbox{\the\tms@leftlen}{\noexpand\raggedright%
         \iftms@usetimes%
         \noexpand\tms@timeitemtype{%
         \cal@appt@start@text}%
          \space%
          \fi%
          \tms@itemtype{\thelongtext}}}%
      \fi%
    \fi%
  \fi}%
%    \end{macrocode}
%
% Chuck the assembled stack of appointments into
% the box.
%
%    \begin{macrocode}
{\theappointments}
\message{Done loading style}
%    \end{macrocode}
%</package>
% \Finale \PrintChanges