HomeworkAssignment.cls 3.36 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
% Assignment.sty
%  LaTeX-Template for Assignments, specifically for Computer Science studies.
% Based uppon this Guide: http://tutex.tug.org/pracjourn/2005-4/hefferon/hefferon.pdf by Jim Hefferon
% --- Class structure: identification part
% ---
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{HomeworkAssignment}[2016/10/23]

\DeclareOption*{\InputIfFileExists{\CurrentOption.min}{}{
%
\PassOptionsToClass{\CurrentOption}{article}}}

\ProcessOptions \relax

\LoadClass{article}

17
\RequirePackage{suffix}
18
\RequirePackage{fancyhdr}
Adrian Hinrichs's avatar
Adrian Hinrichs committed
19
\RequirePackage{ifthen}
20
21
22
23
\fancypagestyle{firstpage}{
%
\fancyhf{}
% clear all six fields
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
24
\renewcommand{\headrulewidth}{.7pt}
25
26
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[RE,LO]{\thepage}
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
27
28
\fancyhead[L]{\@tutorium }
\fancyhead[R]{\@date }
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
}
\fancypagestyle{followingpage}{
%
\fancyhf{}
% clear all six fields
\fancyhead[RE,LO]{\@author}
\fancyhead[LE,RO]{\@kurs\\ Abgabe: \@abgabe}
\fancyfoot[RE,LO]{\thepage}
\renewcommand{\headrulewidth}{0.7pt}
\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{followingpage}
\AtBeginDocument{\thispagestyle{firstpage}}

%\LoadClass[10pt,a4paper]{article}

\def\@kurs{Kein Kurs}
\newcommand{\kurs}[1]{\def\@kurs{#1}}

Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
48
49
50
\def\@tutorium{}
\newcommand{\tutorium}[1]{\def\@tutorium{#1}}

51
52
53
54
55
56
\def\@abgabe{\today}

\newcommand{\abgabe}[1]{\def\@abgabe{#1}}

\renewcommand{\maketitle} {
\begin{centering}
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
57
\huge{\textbf{\@kurs}}
58
{\hrule height 2pt}
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
59
\vspace{.25cm}
60
61
62
63
64
65
66
67
68
69
70
71
72
\large
Abgabe: \@abgabe\\
\vspace{.5cm}
\hrule
\vspace{.25cm}
\normalsize{\@author}\\
\vspace{.25cm}
\hrule
\vspace{.25cm}
\normalsize
\end{centering}
}

Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
73
\newcounter{problem}
74
\setcounter{problem}{0}
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
75
76
77
78
\newcounter{subproblem}[problem]
\setcounter{subproblem}{0}
\newcounter{subsubproblem}[subproblem]
\setcounter{subsubproblem}{0}
79
80
81
82
83
84
85
86

\newcommand{\problem}[1]{\@startsection{problem}%Name
					{1}%Level
					{\z@}%indent
					{-2em \@plus -1em \@minus -1em}%beforeskip
					{1ex \@plus .5ex}%afterskip
					{\normalfont\Large\bfseries}%style
					*{#1}}
Adrian Hinrichs's avatar
Adrian Hinrichs committed
87
88
89
\newcommand{\newproblem}[1][]{\stepcounter{problem}
  \ifthenelse{\equal{#1}{}}
             { }
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
90
             {\setcounter{problem}{#1}}
Adrian Hinrichs's avatar
Adrian Hinrichs committed
91
92
             \problem{Aufgabe \arabic{problem}}
}
93
94
95
96
97
98
99
\newcommand{\subproblem}[1]{\@startsection{subproblem}%Name
					{2}%Level
					{\z@}%indent
					{-1em \@plus -.5em \@minus -.5em}%beforeskip
					{.5ex \@plus .5ex}%afterskip
					{\normalfont\large\bfseries}%style
					*{#1}}
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
100
101
102
\newcommand{\newsubproblem}[1][]{\stepcounter{subproblem}
  \ifthenelse{\equal{#1}{}}
             { }
103
104
             {\setcounter{subproblem}{#1}}
             \subproblem{Aufgabe \arabic{problem}.\alph{subproblem}}
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
105
}
106
107
108
109
110
111
112
113

\newcommand{\subsubproblem}[1]{\@startsection{subsubproblem}%Name
					{3}%Level
					{\z@}%indent
					{-.5em}%beforeskip
					{.5em}%afterskip
					{\normalfont\bfseries}%style
					*{#1}}
114
115
116
117
118
119
120

\newcommand{\newsubsubproblem}[1][]{\stepcounter{subsubproblem}
  \ifthenelse{\equal{#1}{}}
             { }
             {\setcounter{subsubproblem}{#1}}
             \subproblem{\roman{subsubproblem})}
}
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

\newcommand{\solution}{\@startsection{solution}%Name
					{4}%Level
					{\parindent}%indent
					{-.1em}%beforeskip
					{\z@}%afterskip
					{\normalfont\bfseries}%style
					*{L\"osung:~~}}
\newcommand{\proof}{\@startsection{proof}%Name
					{4}%Level
					{\parindent}%indent
					{-.1em}%beforeskip
					{\z@}%afterskip
					{\normalfont\bfseries}%style
					*{Beweis:~~}}
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
136

137
\endinput
Adrian C. Hinrichs's avatar
Adrian C. Hinrichs committed
138
%ToDo: Besipieldokument erstellen und ausgabe ansehehn