Mike Gerwitz

Activist for User Freedom

summaryrefslogtreecommitdiffstats
blob: 28a83d0bffd3f5daeabb2f282b4dd495f3714197 (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
% LoVullo rater specification rate tables
%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{raterspec/rates}
\ProcessOptions\relax


\def\var#1{{\tt#1}}%
\def\locvar#1{\var{#1}_\loc}
\def\tlookup#1#2{\ArgSty{#2 from} \tref{#1}}%
\def\tlookupf#1#2{\tlookup{#1}{#2} \ArgSty{or fail in error}}%


\newenvironment{ratetable*}[5][]%
  {%
    \def\@@lotcaption{#1}
    \def\@@label{#2}
    \def\@@caption{#3}
    \ifx\@@lotcaption\empty
      \let\@@lotcaption\@@caption
    \fi
    \begin{table}[#5]
      \caption[\@@lotcaption]{\@@caption}
      \label{t:\@@label}
      \centering\footnotesize\sf
      \hspace*{-\marginparwidth}%
      \begin{tabular}{#4}
        \toprule
  }
  {%
        \bottomrule
      \end{tabular}
      \hspace*{-\marginparwidth}%
      \medskip
    \end{table}
  }


% simplified syntax where a rate table should always appear on a page of floats
% (which is often the case, since many rate tables tend to be within close
% proximity to one-another)
\newenvironment{ratetable}[4][]%
  {%
    \begin{ratetable*}[#1]{#2}{#3}{#4}{p}%
  }%
  {%
    \end{ratetable*}%
  }