3 \NeedsTeXFormat{LaTeX2e}
4 \ProvidesClass{exsheet2}
6 \DeclareOption{10pt}{\PassOptionsToClass{\CurrentOption}{article}}
7 \DeclareOption{12pt}{\PassOptionsToClass{\CurrentOption}{article}}
8 \DeclareOption{twoside}{\PassOptionsToClass{\CurrentOption}{article}}
10 \DeclareOption{german}{\def \exsheetgerman{}}
11 \DeclareOption{ngerman}{\def \exsheetgerman{}}
12 \DeclareOption{austrian}{\def \exsheetgerman{}}
13 \DeclareOption{naustrian}{\def \exsheetgerman{}}
14 \DeclareOption{showanswers}{\def \exsheetshowanswers{}}
15 \DeclareOption{exam}{\def \exsheetexam{}}
18 \PassOptionsToClass{a4paper}{article}
24 \@ifundefined{exsheetgerman}{
25 \usepackage[american]{babel}
26 \usepackage[american]{isodate}
27 \newcommand{\theexercise}{Exercise}
28 \newcommand{\thepoint}{Point}
29 \newcommand{\thepoints}{Points}
30 \newcommand{\thename}{Name}
31 \newcommand{\thestudnumber}{Number}
32 \newcommand{\theanswer}{Answer}
33 \newcommand{\theduration}{Duration}
34 \newcommand{\thegrade}{Grade}
35 \newcommand{\theof}{of}
37 \usepackage[ngerman]{babel}
38 \usepackage[german]{isodate}
39 \newcommand{\theexercise}{Aufgabe}
40 \newcommand{\thepoint}{Punkt}
41 \newcommand{\thepoints}{Punkte}
42 \newcommand{\thename}{Name}
43 \newcommand{\thestudnumber}{Personenkennzeichen}
44 \newcommand{\theanswer}{Antwort}
45 \newcommand{\theduration}{Prüfungsdauer}
46 \newcommand{\thegrade}{Note}
47 \newcommand{\theof}{von}
50 \RequirePackage{xifthen,geometry,fancyhdr,enumitem,comment,amssymb}
52 \newcounter{exsheet2@pointsum}
53 \def\droptotalpoints{unknown}
54 \AtBeginDocument{\AtEndDocument{%
55 \immediate\write\@mainaux{%
56 \string\gdef\string\droptotalpoints{\number\value{exsheet2@pointsum}}%
60 \newcounter{exsheet2@excounter}
61 \setcounter{exsheet2@excounter}{1}
62 \newenvironment{exercise}[1][]{%
64 \textbf{\theexercise~\arabic{exsheet2@excounter}}
65 \ifthenelse{\isempty{#1}}{}{%
66 \addtocounter{exsheet2@pointsum}{#1}
70 \hfill[#1 \thepoints]%
74 {\addtocounter{exsheet2@excounter}{1}}
76 \@ifundefined{exsheetshowanswers}{
77 \excludecomment{answer}
79 \newenvironment{answer}{\vspace*{0.5em}\textit{\theanswer:} \hspace*{0.5em} }{}
82 \newenvironment{choices}{%
83 \begin{itemize}[label=$\square$, labelsep=2ex]
88 \newcommand{\course}[1]{\def\@course{#1}}
91 \newcommand{\curriculum}[1]{\def\@curriculum{#1}}
94 \newcommand{\semester}[1]{\def\@semester{#1}}
97 \renewcommand{\author}[1]{\def\@auth{#1}\def\@author{#1}}
100 \newcommand{\institute}[1]{\def\@institute{#1}}
103 \newcommand{\school}[1]{\def\@school{#1}}
106 \newcommand{\duration}[1]{\def\@duration{#1}}
108 \def\@instructions{\ }
109 \newcommand{\instructions}[1]{\def\@instructions{#1}}
112 \geometry{a4paper,textwidth=16cm,textheight=23cm}
116 \reinitrand[first=10000,last=99999,counter=examnonce,quiet]
119 \fancypagestyle{exsheet}
133 \@ifundefined{exsheetexam}{}{%
135 \tiny nounce: \arabic{examnonce}
140 \setlength{\headheight}{2.5em}
141 \renewcommand{\headrulewidth}{1pt}
143 \setlength{\parindent}{0em}
146 \newcommand{\makestudentinfo}{%
148 \thename: \underline{\hspace{5cm}}
150 \thestudnumber: \underline{\hspace{4cm}}
154 \newcommand{\makegradeinfo}{%
156 \thegrade: \underline{\hspace{5cm}}
158 \thepoints: \underline{\hspace{2cm}} \theof\ \droptotalpoints
163 \let\oldmaketitle\maketitle
166 \@ifundefined{exsheetexam}{
167 \PassOptionsToClass{notitlepage}{article}
168 \renewcommand{\@maketitle}{%
176 \renewcommand{\@maketitle}{%
186 {\large \bf \@course\ (\@semester)}
205 \theduration: \@duration
220 \renewcommand{\maketitle}{%
222 \thispagestyle{exsheet}