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
|
%%
%% This is file `hmonth.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% htmlstuf.dtx (with options: `htmlmonth')
%% This file is part of the Calendar package,
%% Copyright (C) 1996, 1997 Frank Bennett, Jr.
%% 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.
%% ------------------------------------------
%%
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{hmonth}
[1998/01/17 18:15:02 3.1.1.1 HTML calendar (Frank Bennett)]
\RequirePackage{calendar}
\input calopts.cfg
\InputIfFileExists{dates.cfg}{}{}
\ProcessOptions
\define@key{opt}{title}{%
\def\yrly@title{#1}}
\define@key{opt}{labels}{%
\@storelabels#1,,{}}
\define@key{opt}{firstday}{%
\yrly@firstday=#1}
\define@key{opt}{outputfile}{%
\@ifundefined{html@outputfile}
{\newwrite\html@output
\gdef\html@outputfile{#1}%
\immediate\openout\html@output=\html@outputfile}
{\gdef\hm@temp{#1}%
\ifx\html@outputfile\hm@temp%
\relax%
\else%
\immediate\closeout\html@output%
\gdef\html@outputfile{#1}%
\immediate\openout\html@output=\html@outputfile\relax
\fi}}
\def\yrly@title{\themonth}
\newcount\yrly@firstday
\yrly@firstday=3\relax
\newtoks\yrly@tempreg@a
\newcount\yrly@tempcount
\def\@storelabels{%
\def\yrly@labeltext{}%
\@@storelabels}
\def\@@storelabels#1,#2#{%
\ifcat$#1$%
\yrly@tempreg@a=\expandafter{\yrly@labeltext}%
\edef\yrly@labeltext{\the\yrly@tempreg@a}%
\let\next\@gobble%
\else%
\let\next\@@storelabels%
\yrly@tempreg@a=\expandafter{\yrly@labeltext}%
\protected@edef\yrly@labeltext{\the\yrly@tempreg@a\space#1}%
\fi%
\next#2{}}
\newcount\thumbnails%
\newtoks\hm@line@a%
\def\hm@line{}
\def\hm@writeout#1{%
\edef\hm@temp{#1}%
\immediate\write\html@output{\hm@line\hm@temp}%
\def\hm@line{}}
\def\hm@spaces{\ifcase\hm@spacenum\or\space\or\space\space\or\space\space\space%
\or\space\space\space\space\fi}
\newcount\hm@spacenum
\newcalendar%
{htmlmonth}
{\el@output}
{\yrly@firstday}
{\dates@days}
{7}
{\hm@spaces}
{I}
{<pre><B>\themonth</B>^^J\yrly@labeltext^^J}%
{^^J^^J</pre>}
{\cal@footer%
\cal@header}
{^^J}
{}
{\global\dates@day=1%
\dates@fix%
\cal@range@start\dates@date%
\message{^^JStart: \theshortweekday\space%
\theday\space\theshortmonth\space\theyear}%
\global\dates@date\cal@range@end%
\caldate%
\global\dates@day\dates@days%
\dates@fix%
\cal@range@end\dates@date%
\message{^^JEnd: \theshortweekday\space%
\theday\space\theshortmonth\space\theyear}%
\global\dates@date=\cal@range@start%
\caldate%
\@ifundefined{yrly@labeltext}{%
\def\yrly@defaultlabels{}%
\yrly@tempcount=1%
\global\advance\dates@date by-\dates@weekd%
\global\advance\dates@date by\yrly@firstday%
\caldate%
\loop%
\yrly@tempreg@a=\expandafter{\yrly@defaultlabels}%
\edef\yrly@defaultlabels{\the\yrly@tempreg@a\theshortweekday,}%
\ifnum\yrly@tempcount<7%
\global\advance\dates@date by1%
\caldate%
\advance\yrly@tempcount by 1\relax%
\repeat%
\expandafter\@storelabels\yrly@defaultlabels,,{}%
\dates@date\cal@range@start%
\caldate}%
{}%
\def\el@output##1{%
\def\hm@temp{##1}%
\def\hm@temptwo{\cal@groupbreak}%
\ifx\hm@temp\hm@temptwo%
\hm@spacenum=4\relax%
\fi%
\ifnum\cal@subgroup@count>6\relax%
\hm@writeout{##1}%
\else%
\def\hm@temptwo{\cal@footer}%
\ifx\hm@temp\hm@temptwo%
\hm@writeout{##1}%
\else%
\hm@line@a=\expandafter{\hm@line}%
\edef\hm@line{\the\hm@line@a\hm@temp}%
\fi%
\fi}%
\hm@spacenum=4\relax}%
{}%
{\ifnum\dates@day<9\hm@spacenum=3\else\hm@spacenum=2\fi%
\cal@get@appointments\cal@get@events}%
{\protected@edef\cal@entry@text{X}}%
{\ifnum\dates@weekd=\yrly@firstday%
\hm@spaces%
\ifnum\theday=9%
\space\space%
\fi%
\else%
\ifnum\dates@day=1%
\space\hm@spaces%
\fi%
\fi%
\ifcat$\theappointments\theevents$%
\else%
<A HREF="\expandafter\@gobble\string\#\the\dates@date">%
\fi%
\theday%
\ifcat$\theappointments\theevents$%
\else%
</A>%
\fi}
\endinput
%%
%% End of file `hmonth.sty'.
|