-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathagd-rubric.sty
76 lines (62 loc) · 2.11 KB
/
agd-rubric.sty
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
\ProvidesPackage{agd-rubric}
% Copyright (C) 2013 Andrew Gainer-Dewar <[email protected]>
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.2 of this license or (at your option) any later
% version. The latest version of this license is in:
% http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of
% LaTeX version 1999/12/01 or later.j
\usepackage{csquotes}
\usepackage{hyperref}
\usepackage[margin=1in,letterpaper]{geometry}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{microtype}
\usepackage{booktabs}
\usepackage{forloop}
\usepackage{calc}
\tightlists
\newcounter{totalcolnum}
\newcounter{colnum}
\newlength{\colwidth}
\newlength{\firstcolwidth}
\setlength{\firstcolwidth}{2cm}
% Set up \therubric to access parameters of \rubric
\newcommand{\therubric}[1]{\csname rubric@#1\endcsname}
\newcommand{\rubriccourse}[1]{\gdef\rubric@course{#1}}
\newcommand{\rubricterm}[1]{\gdef\rubric@term{#1}}
\newcommand{\rubricthing}[1]{\gdef\rubric@thing{#1}}
\newcommand{\rubrictopprompt}[1]{\gdef\rubric@topprompt{#1}}
\setlength{\droptitle}{-5eX}
\renewcommand*{\@maketitle}{
\newpage
\null
\vspace{\droptitle}
\begin{center}
\textsc{\textbf{\large \therubric{topprompt}:}} \hrulefill \\[\baselineskip]
\textbf{\Huge Grading rubric: \therubric{thing}} \\[\baselineskip]
\textsc{\normalsize \therubric{course} (\therubric{term})}
\end{center}
}
\newenvironment{rubrictable}[1]{
\setcounter{totalcolnum}{#1}
\setlength{\colwidth}{\textwidth - \firstcolwidth*\real{2}}
\setlength{\colwidth}{\colwidth / \real{\value{totalcolnum}}}
\begin{center}
\begin{tabular}{p{\firstcolwidth} | *{\value{totalcolnum}}{p{\colwidth}}}
\toprule
\forloop{colnum}{0}{\value{colnum} < \value{totalcolnum}}{
& \textbf{\Large \arabic{colnum}}
} \\ \midrule
}
{
\bottomrule
\end{tabular}
\end{center}
}
\newcommand{\rubriccat}[2]{
\textbf{\Large #1} #2 \\[2eX]
}
\newcommand{\rubricdesc}[2]{& \textbf{#1} {\raggedright #2}}