Initial versions of things.
[dnd] / tables.cls
CommitLineData
46d528a4
MW
1\ProvidesClass{tables}
2
3\PassOptionsToClass
4 {8pt, a4paper, article, nonumbering, nooffsetpages}
5 {strayman}
6\LoadClass{strayman}
7\RequirePackage{dnd}
8
9%%% page layout
10\textheight = \paperheight \advance\textheight by -2in
11\headsep = 0pt \headheight = 0pt
12\footskip = 20pt
13\fancypagestyle{foots}{%
14 \fancyhf{}%
15 \fancyfoot[RE, RO]{\itshape\small \sectname\ \thepage/\thepagemax}%
16}
17\pagestyle{foots}
18
19\count1 = 0
20\def\thepagemax{\pageref{pgn:\the\count1}}
21\def\sect#1{%
22 \label{pgn:\the\count1}%
23 \newpage\section{#1}%
24 \gdef\sectname{#1}%
25 \global\advance\count1by1%
26 \global\count0=1%
27}
28\AtEndDocument{\label{pgn:\the\count1}}
29
30%%% tables
31\tabcolsep = 0.5em
32
33%%% orders of events
34\newcount\itemcount \newcount\levelcount
35
36\newenvironment{order}[1]{%
37 \global\itemcount=0%
38 \def\item{\global\advance\itemcount by1\relax\the\itemcount.&}
39 \begin{tabular}{rl} \hlx*{hv}
40 \tt{#1} \\ \hlx{vhv}
41}{%
42 \hlx*{vh} \end{tabular}%
43}
44
45\newenvironment{order*}[1]{%
46 \def\item{$\bullet$&}
47 \begin{tabular}{rl} \hlx*{hv}
48 \tt{#1} \\ \hlx{vhv}
49}{%
50 \hlx*{vh} \end{tabular}%
51}
52
53%%% table sets
54\def\col{\vbox\bgroup\halign\bgroup\hfil\ignorespaces##\unskip\hfil\cr}
55\def\endcol{\crcr\egroup\egroup}
56\def\row{\hbox to\hsize\bgroup\valign\bgroup\vskip\topglue@\centering\hbox{##}\vskip\botglue@\cr\noalign{\hfil}\col}
57\def\endrow{\endcol\cr\noalign{\hfil}\egroup\egroup}
58\def\rowgap{\endcol\cr\noalign{\hskip1em plus1fil}\col}
59\def\colgap{\cr\noalign{\medskip}}
60\def\line{\endrow\medskip\row}
61\def\set{\@ifnextchar[\set@{\set@[c]}}
62\newskip\topglue@ \newskip\botglue@
63\def\set@[#1]{\topglue@0ptplus1fil\botglue@0ptplus1fil\ifx
64 b#1\botglue@\z@\else\ifx t#1\topglue@\z@\fi\fi\vspace\bigskipamount\vbox\bgroup\row}
65\def\endset{\endrow\egroup}
66