summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/timetab.sty
blob: 8e6969532f09bbef4006f29d2cd56dec5a4da62a (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
%%
%% 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