51 lines
1.1 KiB
TeX
51 lines
1.1 KiB
TeX
% 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*}%
|
|
}
|
|
|