summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/calendar/yearly.sty
blob: f224e80c0debe7b5a6f66c99c1ca27afdd37bc53 (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
%%
%% This is file `yearly.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% yearly.dtx  (with options: `style')
%% 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{yearly}
          [1997/11/06 07:33:21 2.1.1.6 Trivial yearly calendar (Frank Bennett)]
\input calopts.cfg
\InputIfFileExists{dates.cfg}{}{}
\ProcessOptions
\RequirePackage{calendar}
\define@key{opt}{title}{%
  \def\yrly@title{#1}}
\define@key{opt}{labels}{%
  \@storelabels#1,,{}}
\define@key{opt}{firstday}{%
  \yrly@firstday=#1}
\def\yrly@title{\theyear}
\newcount\yrly@firstday
\yrly@firstday=0\relax
\newtoks\yrly@tempreg@a
\newcount\yrly@tempcount
\def\@storelabels{%
  \def\yrly@labeltext{}%
  \@@storelabels}
\def\@@storelabels#1,#2#{%
  \ifcat$#1$%
    \yrly@tempreg@a=\expandafter\expandafter\expandafter{%
      \expandafter\@gobble\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&#1}%
  \fi%
    \next#2{}}
\newcalendar%
 {yearly}
 {\cal@insert}
 {\yrly@firstday}
 {\dates@days}
 {7}
 {&}
 {I}
 {\begin{tabular}[t]{ccccccc}%
    \multicolumn{7}{c}{\textbf{\themonth}}\\\hline%
    \yrly@labeltext\\\hline}%
 {\end{tabular}}
 {\cal@footer%
  \ifodd\thumbnails%
    \\%
  \else%
    \rule{0.25in}{0pt}%
  \fi%
  \advance\thumbnails by 1%
  \cal@header}
 {\\}
 {}
 {\global\dates@month=1%
  \global\dates@day=1%
  \dates@fix%
  \cal@range@start\dates@date%
  \message{^^JStart: \theshortweekday\space%
    \theday\space\theshortmonth\space\theyear}%
  \global\dates@month=12%
  \global\dates@day=31%
  \dates@fix%
  \caldate%
  \cal@range@end\dates@date%
  \message{^^JEnd: \theshortweekday\space%
    \theday\space\theshortmonth\space\theyear}%
  \global\dates@date=\cal@range@start%
  \caldate%
  \addtolength{\tabcolsep}{-0.5\tabcolsep}%
  \newcount\thumbnails%
  \@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}%
    {}%
  \yrly@title\par\bigskip}%
 {}%
  {\getanycolor}%
  {}%
 {\cal@textcolor{\calcolor}{\theday}}
\endinput
%%
%% End of file `yearly.sty'.