1 % Stefan Huber, 2010-02
2 % Stefan Huber, 2019-09-23
3 % Stefan Huber, 2020-06-23
4 % Stefan Huber, 2021-06-21
6 \NeedsTeXFormat{LaTeX2e}
7 \ProvidesClass{exsheet}
10 \DeclareOption{10pt}{\PassOptionsToClass{\CurrentOption}{article}}
11 \DeclareOption{12pt}{\PassOptionsToClass{\CurrentOption}{article}}
13 \DeclareOption{german}{\def \exsheetgerman{}}
14 \DeclareOption{ngerman}{\def \exsheetgerman{}}
15 \DeclareOption{austrian}{\def \exsheetgerman{}}
16 \DeclareOption{naustrian}{\def \exsheetgerman{}}
17 \DeclareOption{showanswers}{\def \exsheetshowanswers{}}
20 \PassOptionsToClass{a4paper,notitlepage,twoside}{article}
23 %-------------------- This is based on the article class ----------------
26 \RequirePackage{xifthen,geometry,fancyhdr,enumitem,comment}
29 %------------------ Defining the most common environments ---------------
31 \@ifundefined{exsheetgerman}{
32 \newcommand{\theexercise}{Exercise}
33 \newcommand{\thepoint}{Point}
34 \newcommand{\thepoints}{Points}
35 \newcommand{\thestudnumber}{Number}
36 \newcommand{\theanswer}{Answer}
38 \newcommand{\theexercise}{Aufgabe}
39 \newcommand{\thepoint}{Punkt}
40 \newcommand{\thepoints}{Punkte}
41 \newcommand{\thestudnumber}{Personenkennzeichen}
42 \newcommand{\theanswer}{Antwort}
45 %Check whether we should show the answers
46 \@ifundefined{exsheetshowanswers}{
47 \excludecomment{answer}
49 \newenvironment{answer}{\vspace*{0.5em}\textit{\theanswer:} \hspace*{0.5em} }{}
52 \newcounter{excounter}
53 \setcounter{excounter}{1}
54 \newenvironment{exercise}[1][]{%
56 \textbf{\theexercise~\arabic{excounter}}:
57 \ifthenelse{\isempty{#1}}{}{%
61 \hfill[#1 \thepoints]%
65 {\addtocounter{excounter}{1}}
69 \newcommand{\semester}[1]{\def\@semester{#1}}
72 \newcommand{\lva}[1]{\def\@lva{#1}}
75 \renewcommand{\author}[1]{\def\@auth{#1}\def\@author{#1}}
78 \newcommand{\institute}[1]{\def\@institute{#1}}
80 \newcommand{\studentinfo}{%
82 Name: \underline{\hspace{6cm}}
84 \thestudnumber: \underline{\hspace{4cm}}
92 %------------------ Basic layout ----------------------------------------
94 \geometry{verbose,a4paper,width=16cm,height=23cm}
96 \fancypagestyle{exsheet}
100 \begin{minipage}{70mm}
107 \begin{minipage}{70mm}
116 \setlength{\headheight}{2.5em}
117 \renewcommand{\headrulewidth}{1pt}
119 \setlength{\parindent}{0em}
122 %------------------ Common command ---------------------------------------
124 \let\oldmaketitle\maketitle
126 \renewcommand{\@maketitle}{%
136 \renewcommand{\maketitle}{%
138 \thispagestyle{exsheet}
143 \renewcommand\abstract{\it\noindent}
145 %------------------ Defining specific commands environments ---------------
147 \newenvironment{choices}{%
148 \begin{itemize}[label=$\square$, labelsep=2ex]