summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/timesht/timesht.dtx
blob: fb01c22756a5650075e2b3972032a9c10eadd74f (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
% \iffalse
%
% File timesht.dtx
% Copyright (C) 1996 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 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 Calendar a more powerful,
% friendlier, and altogether more thrilling package, please contact me on
% fb@soas.ac.uk
% 
%<*dtx>
          \ProvidesFile{timesht.dtx}
%</dtx>
%<style>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
%<style>\ProvidesPackage{timesht}
%<style>          [1996/11/09 v0.03 Timesheet generator (Frank Bennett)]
% \fi
%
% \def\fileversion{v0.03}
% \def\filedate{1996/11/27}
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\begin{document}
%\OnlyDescription            % comment out for implementation details
\DocInput{timesht.dtx}
\end{document}
%</driver>
% \fi
%
% \changes{v0.01}{1996/11/10}{Initial Version}
% \changes{v0.02}{1996/11/11}{Minor bug fixes. Initial release.}
% \changes{v0.03}{1996/11/27}{Minor alterations to make the
%   class work with the updated calendar package.}
%
%
% \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.\thanks{The page-formatting code contained in this
%    file is for the most part copied from the \texttt{ltnews.cls}
%    class file version 0.11 by Alan Jeffrey, which forms part of the
%    \LaTeXe{} distribution.  The rest is my own creation.  Enjoy.}}
%
%  \maketitle
% 
% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
% \DoNotIndex{\@flushglue,\@gobble,\@input}
% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle}
% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa}
% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue}
% \DoNotIndex{\@thanks,\@thefnmark,\@topnum}
% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin}
% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces}
% \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup}
% \DoNotIndex{\cal,\csname,\def,\documentstyle,\dospecials,\edef}
% \DoNotIndex{\egroup}
% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist}
% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global}
% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn}
% \DoNotIndex{\ifcase}
% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item}
% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower}
% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing}
% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc}
% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut}
% \DoNotIndex{\strutbox}
% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt}
% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@}
% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim}
% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary}
% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle}
% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode}
% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip}
% \DoNotIndex{\nopagebreak}
% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle}
% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb}
% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar}
% \DoNotIndex{\[,\{,\},\]}
% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode}
% \DoNotIndex{\baselineskip,\begin,\tw@}
% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q}
% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H}
% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z}
% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0}
% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_}
% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother}
% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment}
% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined}
% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc}
% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar}
% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode}
% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting}
% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf}
% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse}
% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault}
% \DoNotIndex{\bfdefault}
% \setcounter{StandardModuleDepth}{1}
% \DeleteShortVerb{\|}
% \MakeShortVerb{\"}
%
% \begin{abstract}
% \noindent This package provides a style that can be used to
% create timesheets, to monitor the amount of time 
% you spend fussing with \LaTeXe.
% \end{abstract}
%
% \changes{v0.01}{1996/11/10}
%    {Created "docstrip" version.}
% \changes{v0.02}{1996/11/11}
%    {Fixed missing 30-40 line, and a few other minor adjustments.}
% \changes{v0.02}{1996/11/11}
%    {Added sample document to distribution.}
%
% \CheckSum{236}
%
% \section{Introduction}
%
% This packages creates a style, "timesheet", and a macro called
% "\timesheets" which
% accepts two arguments.  Both arguments are dates of the form
% \verb+YYYY/MM/DD+.  This will generate a two-page timesheet
% for all dates within the range specified in the arguments,
% inclusive.  To use this package you will also need the
% "calendar" package, which is also available from CTAN.
% 
%
%\StopEventually{\PrintIndex}
%
% \section{The Macros}
% Let's start by switching off some of the article options.
%    \begin{macrocode}
%<*style>
\DeclareOption{a4paper}{\OptionNotUsed}
\DeclareOption{a5paper}{\OptionNotUsed}
\DeclareOption{b5paper}{\OptionNotUsed}
\DeclareOption{letterpaper}{\OptionNotUsed}
\DeclareOption{legalpaper}{\OptionNotUsed}
\DeclareOption{executivepaper}{\OptionNotUsed}
\DeclareOption{landscape}{\OptionNotUsed}
\DeclareOption{twoside}{\OptionNotUsed}
\DeclareOption{titlepage}{\OptionNotUsed}
\DeclareOption{onecolumn}{\OptionNotUsed}
%    \end{macrocode}
% Sizing options should be passed to the article class.
%    \begin{macrocode}
\DeclareOption{10pt}{\PassOptionsToPackage{\CurrentOption}{article}}
\DeclareOption{11pt}{\PassOptionsToPackage{\CurrentOption}{article}}
\DeclareOption{12pt}{\PassOptionsToPackage{\CurrentOption}{article}}
%    \end{macrocode}
% The default action for any option is to pass it to the calendar package.
%    \begin{macrocode} 
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{calendar}}
%    \end{macrocode} 
% Execute the options.
%    \begin{macrocode} 
\ProcessOptions
%    \end{macrocode} 
% Load the article class.
%    \begin{macrocode} 
\LoadClass[oneside]{article}
%    \end{macrocode}
% Specify the page style.
%    \begin{macrocode} 
\pagestyle{empty}
\setlength{\parindent}{1em}
\setlength{\rightskip}{0pt plus \textwidth}
\setlength{\@rightskip}{\rightskip}
\setlength{\parfillskip}{0pt plus 2\textwidth}
\setlength{\columnsep}{2em}
%    \end{macrocode}
% Specify the text size.  This spec tries to work with both A4 and letter paper
% sizes. 
%    \begin{macrocode}
\setlength{\textheight}{230mm}
\setlength{\topmargin}{-10mm}
\setlength{\linewidth}{\textwidth}
 \setlength{\textwidth}{180mm}
\setlength{\oddsidemargin}{-10mm}
%    \end{macrocode}
% Declare some lengths and counters.
%    \begin{macrocode}
\newcounter{timecount}
\newcounter{timecountlimit}
\newlength{\timesheetleft}
\newlength{\timesheetright}
%    \end{macrocode}
% Declare a toggle for turning hash marks on and off.
%    \begin{macrocode}
\newif\if@makehash
%    \end{macrocode}
% Figure out how much space is chewed up by the times and lines
% and stuff.  The remainder will be empty space for handwritten notes.
%    \begin{macrocode}
\settowidth{\timesheetleft}{00:00\ --\ 00:00}
\addtolength{\timesheetleft}{5\arrayrulewidth}
\addtolength{\timesheetleft}{6\tabcolsep}
\addtolength{\timesheetleft}{\doublerulesep}
\setlength{\timesheetright}{\textwidth}
\addtolength{\timesheetright}{-\timesheetleft}
%    \end{macrocode}
% Create a macro that will put down a one one-hour chunk of times
% for use in a tabular environment.  Because we can't have
% anything after the last "\\" (not even a "\relax") if the table
% is not to over-run, we have to start the table off ``by hand''
% in the lead-off macro, defined below, and leave the last "\\"
% out of the definition here, so it can be supplied when the
% iteration dies.
%    \begin{macrocode}
\def\@@maketimes#1{\xdef\timearg{\the\c@timecount}
\addtocounter{timecount}{1}%
\\\hline
\@makehashtrue
\timearg &00& \timearg &10&&\\
\timearg &10& \timearg &20&&\\
\timearg &20& \timearg &30&&\\
\timearg &30& \timearg &40&&\\
\timearg &40& \timearg &50&&\\
\timearg &50&\arabic{timecount}&00&&%
\@makehashfalse}
%    \end{macrocode}
% This performs the iteration.
%    \begin{macrocode}
\def\@maketimes{\@@maketimes{\arabic{timecount}}%
 \ifnum\c@timecount>\c@timecountlimit%
  \let\next\\\else\let\next\@maketimes\fi%
 \next}
%    \end{macrocode}
% This is the lead-off macro used as an interface to the above
% material.  It accepts a range of integers corresponding to
% hours in the day.
%    \begin{macrocode}
\def\maketimes#1#2{%
   \setcounter{timecount}{#1}%
   \setcounter{timecountlimit}{#2}%
\addtocounter{timecount}{1}%
\@makehashtrue
#1 &00& #1 &10&&\\
#1 &10& #1 &20&&\\
#1 &20& #1 &30&&\\
#1 &30& #1 &40&&\\
#1 &40& #1 &50&&\\
#1 &50&\arabic{timecount}&00&&
\@makehashfalse
\@maketimes}
%    \end{macrocode}
% We need to have a bunch of tools loaded for all of this to
% work.
%    \begin{macrocode}
\RequirePackage{longtable}[1996/05/24]
\RequirePackage{array}[1996/06/14]
\RequirePackage{calendar}
%    \end{macrocode}
% A little flash is nice.  The "mygoth" package is my personal hackery.
% Send a message to "fb@soas.ac.uk" if you'd like a copy.
%    \begin{macrocode}
\IfFileExists{mygoth.sty}{\RequirePackage{mygoth}}{\let\textgoth\relax}
%    \end{macrocode}
% We also need to quelch the left and right margin offsets, so that the
% table can fill the whole page.
%    \begin{macrocode}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
%    \end{macrocode}
% Define a new environment, which is essentially just a
% particular instance of the "longtable" environment.
%    \begin{macrocode}
\newenvironment{timesheet}
   {\begin{longtable}{%
     |r%
      @{:}%
      l%
      @{\ --\ }%
      r%
      @{:}%
      l%
     |p{0.33\timesheetright}%
     ||p{0.67\timesheetright}|%
}%
   \multicolumn{4}{l}{}&%
     \multicolumn{2}{l}{\large\bf\theweekday\hfill%
     {\Huge\textgoth{Timesheet}}\hfill%
     \theday{} %
     \themonth{} %
     \theyear}\\
   \multicolumn{6}{l}{}\\
     \multicolumn{4}{c}{\small Time}&%
     \multicolumn{1}{c}{\small Plan}&%
     \multicolumn{1}{c}{\small Action}\\
   \hline
   \endhead
   \hline
    \endfoot}
   {\end{longtable}}
%    \end{macrocode}
% Define a high-level macro that invokes the above environment,
% making things very clean and straightforward in the document.
%    \begin{macrocode}
\def\timesheets#1#2{%
  \everyday
   {#1}
   {#2}
   {\begin{timesheet}\maketimes{7}{22}\end{timesheet}}
}
%</style>
%    \end{macrocode}
% \section{A Demonstration Document}
% The following document will produce a single
% timesheet.  Adjust dates to taste.
%    \begin{macrocode}
%<*demo>
\documentclass[10pt]{timesht}
\begin{document}
\timesheets{1996/11/24}{1996/11/24}
\end{document}
%</demo>
%    \end{macrocode}
% \section{The Installation File}
%    \begin{macrocode}
%<*installer>
\def\batchfile{timesht.ins}
\input docstrip.tex

\keepsilent

\preamble

This file is part of the Timesheet package.
Copyright (C) 1996 Frank Bennett, Jr.
All rights reserved.
------------------------------------------
This is a generated file.

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(s) 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 Timesheet a more powerful,
friendlier, and better package, please contact me on
`fb' at soas.ac.uk

\endpreamble

\generateFile{timesht.cls}   {n}{\from{timesht.dtx}{style}}

\preamble

This file is part of the Timesheet package.
Copyright (C) 1996 Frank Bennett, Jr.
All rights reserved.
------------------------------------------
This is a generated file.

You are welcome to modify this file in any way you wish.

For error reports, or offers to help make Timesheet a more powerful,
friendlier, and better package, please contact me on
`fb' at soas.ac.uk

\endpreamble

\generateFile{timesheet.tex} {n}{\from{timesht.dtx}{demo}}

\Msg{***********************************************************}
\Msg{*}
\Msg{* To finish the installation, you have to move the following}
\Msg{* file into a directory searched by TeX:}
\Msg{*}
\Msg{* \space\space timesht.cls}
\Msg{*}
\Msg{***********************************************************}
}
%</installer>
%    \end{macrocode}
% \Finale \PrintChanges