.gitignore: Also ignore Metapost output.
[dnd] / tables.cls
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 \newcount\sectcount
20 \sectcount = 0
21 \def\thepagemax{\pageref{pgn:\the\sectcount}}
22 \def\sect#1{%
23 \label{pgn:\the\sectcount}%
24 \newpage\section{#1}%
25 \gdef\sectname{#1}%
26 \global\advance\sectcount\@ne%
27 \global\count0\@ne%
28 }
29
30 \def\subsect#1{%
31 \goodbreak\medskip%
32 {\normalsize\bfseries\sffamily#1}\par%
33 \nobreak\@nobreaktrue%
34 }
35
36 \AtEndDocument{\label{pgn:\the\sectcount}}
37
38 %%% tables
39 \tabcolsep = 0.5em
40
41 %%% orders of events
42 \newcount\itemcount \newcount\levelcount
43
44 \newenvironment{order}[1]{%
45 \global\itemcount=0%
46 \def\item{\global\advance\itemcount by1\relax\the\itemcount.&}
47 \begin{tabular}{rl} \hlx*{hv}
48 \tt{#1} \\ \hlx{vhv}
49 }{%
50 \hlx*{vh} \end{tabular}%
51 }
52
53 \newenvironment{order*}[1]{%
54 \def\item{$\bullet$&}
55 \begin{tabular}{rl} \hlx*{hv}
56 \tt{#1} \\ \hlx{vhv}
57 }{%
58 \hlx*{vh} \end{tabular}%
59 }
60
61 \def\swimming{\unskip\penalty100/\ignorespaces}
62 \def\flying{\unskip\penalty100/$\!\!\!$/\ignorespaces}
63
64 %%% table sets
65 \def\col{\vbox\bgroup\halign\bgroup\hfil\ignorespaces##\unskip\hfil\cr}
66 \def\endcol{\crcr\egroup\egroup}
67 \def\row{\hbox to\hsize\bgroup\valign\bgroup\vskip\topglue@\centering\hbox{##}\vskip\botglue@\cr\noalign{\hfil}\col}
68 \def\endrow{\endcol\cr\noalign{\hfil}\egroup\egroup}
69 \def\rowgap{\endcol\cr\noalign{\hskip1em plus1fil}\col}
70 \def\colgap{\cr\noalign{\medskip}}
71 \def\line{\endrow\medskip\row}
72 \def\set{\@ifnextchar[\set@{\set@[c]}}
73 \newskip\topglue@
74 \newskip\botglue@
75 \def\set@[#1]{\topglue@0ptplus1fil\botglue@0ptplus1fil\ifx
76 b#1\botglue@\z@\else\ifx t#1\topglue@\z@\fi\fi\vspace\bigskipamount\vbox\bgroup\row}
77 \def\endset{\endrow\egroup}
78