%%% The  following TeX input will produce a one page calendar.  Each  %%%
%%% date is in a shadow box  with  a  (possibly  nul)  message.  The  %%%
%%% counters \blankdays and \daysinmonth must be set initially.  The  %%%
%%% value of \message should be set before \daybox is called.         %%%

%%%%%%%%%%%%% dimensions for the box containing the date %%%%%%%%%%%%%
\newdimen\dayht     \dayht=70pt %%% height of the box containing each date
\newdimen\daywidth    \daywidth=60pt %%% width of the box containing each date
\newdimen\rulewidth \rulewidth=1pt %%% width of rules around date box
\newdimen\padwid    \padwid=6pt  %%% width of shadow boxing
\newdimen\interrowspace \interrowspace=8pt  %%% space between weeks

\newdimen\shortwid  \shortwid=\daywidth   \advance\shortwid by -\padwid
\newdimen\longwid   \longwid=\daywidth    \advance\longwid by 2\padwid 
\advance \longwid by 2\rulewidth

%%%%%%%%%%%% set counters for numbering days %%%%%%%%%%%%%%%%%%%%
%% \blankdays is the number of blank positions before the first of the month
%% \blankdays=0 ... \blankdays=6 for the first on Sunday ... Saturday
   \newcount\blankdays  \blankdays=4

\newcount\daynumber  \daynumber=-\blankdays
\newcount\daysinmonth \daysinmonth=30   %%%% 31, 30, 29, or 28
\advance \daysinmonth by 1

%%%% macro that prints a box containing \the\daynumber and \message %%%%
\def\daybox{%
   \global\advance\daynumber by 1
   \ifnum \daynumber < \daysinmonth
   \ifnum \daynumber > 0
   \offinterlineskip%
   \hbox{%
      \hskip\padwid \vrule height\dayht width\padwid
      \vbox{%
         \hbox{%
            \vrule height\dayht width\rulewidth
            \vbox to \dayht{%
               \hrule width\daywidth height\rulewidth
               \vskip\padwid
               \hbox to \daywidth{%
                  \hfil\the\daynumber\hskip\padwid}
               \vfil
               \hbox to \daywidth{\hfil \message \hfil}
               \vfil
               \hrule width\daywidth height\rulewidth}%
            \vrule height\dayht width\rulewidth}%
         \moveleft \padwid \vbox{\hrule height\padwid width\daywidth}}}%
   \else \hskip \longwid
   \fi \fi
   }

\nopagenumbers \parindent=0pt
\hoffset=-.75in \hsize=7.5in
\hsize = 7\longwid

%%%%% ready to go -- print a title banner %%%%
\centerline{\bf November 1990}
\vskip .5in

%%%%% here comes a line with the days of the week %%%%%
\leftline{
\hbox to \longwid{\hfil Sunday \hfil}%
\hbox to \longwid{\hfil Monday \hfil}%
\hbox to \longwid{\hfil Tuesday \hfil}%
\hbox to \longwid{\hfil Wednesday \hfil}%
\hbox to \longwid{\hfil Thursday \hfil}%
\hbox to \longwid{\hfil Friday \hfil}%
\hbox to \longwid{\hfil Saturday \hfil}%
}
\vskip 2\interrowspace

\def\message{} %inserted message is initially nul
%% week 1 %%
\hbox{%
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
}
\vskip \interrowspace

%% week 2 %%
\hbox{%
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
}
\vskip \interrowspace

%% week 3 %%
\hbox{%
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
}
\vskip \interrowspace

%% week 4 %%
\hbox{%
\daybox
\daybox
%\def\message{\vbox{\hbox{\TeX hax}\vskip 3pt\hbox{arrives!}}}%
\daybox
\def\message{}%
\daybox
\daybox
\daybox
\daybox
}
\vskip \interrowspace

%% week 5 %%
\hbox{%
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
}
\vskip \interrowspace

%% week 6 %%
\hbox{%
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
\daybox
}

\bye
