%%
%% TimeTab Style by Tobias Oetiker  Created 1993-4-19
%% >>>>>>>>>>BETA VERSION <<<<<<<<<<<<<<<<<<<<<<<<<<<
%%
%% Works Best with NFSS installed ... (but works anyway)
%%	
%% Comments to oetiker@stud.ee.ethz.ch please
%% 
%% This Style implements a new environment to create
%% timetables as in the example below. 
%%
%% 
%% Environment: timetab{Unitlength}%
%%			{Horizontal Boxes}{Vetical Boxes}%
%%			{X Box Size}{Y Box Size}
%% Commands:    \Lek{X Location}{Y Location}{Vertical Size in Boxes}{Text}
%%              \BLek similar to \Lek but with bold and larger Font.
%%
%% Example:     to create a Time Table like This:
%%               _______ ________ ________
%%              | Time  |        |        |
%%              |_______| Other  |________|
%%              |       | Field  |        |
%%              | Cente |________|        |
%%              |  TxT  |        |        |
%%              |_______|        | 4.Fie  |
%%              |       |        |        |
%%              |       |________|        |
%%              |       |        |        |
%%              |_______|________|________|
%%             
%%              Enter:
%%		\documentstyle[timetab]{article}
%%		\begin{document}
%%              \begin{timetab}{0.8cm}{3}{5}{3}{1}
%%               \BLek{0}{0}{1}{Time}
%%               \Lek{1}{0}{2}{Other\\Filed}
%%               \Lek{0}{1}{2}{Cente\\TxT}
%%               \Lek{1}{2}{2}{}
%%               \Lek{2}{1}{4}{4.Fie}
%%              \end{timetab}
%%		\end{document}
%%
%%
%% 1993-4-19   Version 0.1 Initial Creation of this Style
%%
\newcount\tmfx 
\newcount\tmfy
\newcount\tmfh
\newcount\XNR 
\newcount\YNR
\newcount\Breite
\newcount\Hoehe
\newcount\THoehe
\newcount\TBreite

\newenvironment{timetab}[5]{%
\setlength{\unitlength}{#1}
\XNR=#2       % Number of Boxes Horizontal
\YNR=#3       % Number of Boxes Vertical
\Breite=#4    % X Size of a Box
\Hoehe=#5     % Y Size of a Box
\THoehe=\Hoehe  
\multiply \THoehe by \YNR
\TBreite=\Breite
\multiply \TBreite by \XNR
\begin{picture}(\TBreite,\THoehe)(0,-\THoehe)
\put(0,0){\line(1,0){\TBreite}}
\put(0,-\THoehe){\line(1,0){\TBreite}}

\put(0,0){\line(0,-1){\THoehe}}
\multiput(\Breite,0)(\Breite,0){#2}{\line(0,-1){\THoehe}}%
}{\end{picture}}

\newcommand{\Lek}[4]{%
  \tmfh=#3
  \multiply \tmfh by \Hoehe
  \tmfx=#1
  \multiply \tmfx by \Breite
  \tmfy=#2
  \advance \tmfy by #3
  \multiply \tmfy by \Hoehe
  \put(\tmfx,-\tmfy){%
    \begin{picture}(\Breite,\tmfh)(0,0)
    \put(0,0){\makebox(\Breite,\tmfh){%
       \parbox{\Breite\unitlength}{\centering\footnotesize\sf #4}}}
    \multiput(0,0)(0,\tmfh){2}{\line(1,0){\Breite}}
    \end{picture}
  }
}

\newcommand{\BLek}[4]{\Lek{#1}{#2}{#3}{\small\sf\bf #4}}
\endinput
