aboutsummaryrefslogtreecommitdiff
path: root/latex/test.cls
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-11-23 16:33:26 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2023-11-23 16:38:05 +0100
commit444b6e80283d9fa72496bc2dbac1f1d48a9ff4d8 (patch)
treed0a62dd3d4c68750921785d789ecbafdf1ccda0f /latex/test.cls
parent3f00251277fc4f4aded5f8df0a37b5e6f5fccedc (diff)
downloadunterricht-444b6e80283d9fa72496bc2dbac1f1d48a9ff4d8.tar.gz
unterricht-444b6e80283d9fa72496bc2dbac1f1d48a9ff4d8.zip
improve test attribute commands
Now most commands that specify a test's attribute work like their normal TeX equivalents, like \title or \author. They no longer need to be renewed in the document.
Diffstat (limited to 'latex/test.cls')
-rw-r--r--latex/test.cls64
1 files changed, 44 insertions, 20 deletions
diff --git a/latex/test.cls b/latex/test.cls
index a17621ef..a8e7f927 100644
--- a/latex/test.cls
+++ b/latex/test.cls
@@ -2,8 +2,11 @@
\ProvidesClass{test}[muhq's test class]
% etoolbox is needed for our common options
+\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
+\DeclareStringOption{nachschrift}
+
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\newtoggle{drawborder}
@@ -12,12 +15,17 @@
\newtoggle{sigfooter}
\DeclareOption{sigfooter}{\toggletrue{sigfooter}}
+\newtoggle{keinlogo}
+\DeclareOption{keinlogo}{\toggletrue{keinlogo}}
+\newcommand{\KeinLogo}{\toggletrue{keinlogo}}
+
\newtoggle{erwartungshorizont}
\newcommand{\ifeh}[1]{\iftoggle{erwartungshorizont}{#1}{}}
\DeclareOption{erwartungshorizont}{\toggletrue{erwartungshorizont}}
\DeclareOption{eh}{\toggletrue{erwartungshorizont}}
\input{common_options.tex}
+\ProcessKeyvalOptions{}
\LoadClass[a4paper,12pt]{scrartcl}
@@ -57,14 +65,27 @@
\renewcommand{\baselinestretch}{1,5}
-\newcommand{\Datum}{\today}
-\newcommand{\Klasse}{TODO}
-\newcommand{\TestNummer}{1}
-\newcommand{\TestArt}{Schulaufgabe}
-\newcommand{\Fach}{Mathemathik}
-\newcommand{\HeaderText}{\TestArt{} im Fach \Fach}
-%\newcommand{\KeinLogo}{} %%FALLS Kein Logo erwünscht
-\newcommand{\EinleitungsSatz}{\textit{Achte auf eine korrekte Schreibweise und eine ordentliche äußere Form!}}
+\newcommand{\dasDatum}{\today}
+\newcommand{\Datum}[1]{\renewcommand{\dasDatum}{#1}}
+
+\newcommand{\dieKlasse}{TODO}
+\newcommand{\Klasse}[1]{\renewcommand{\dieKlasse}{#1}}
+
+\newcommand{\dieTestNummer}{1}
+\newcommand{\TestNummer}[1]{\renewcommand{\dieTestNummer}{#1}}
+
+\newcommand{\dieTestArt}{Schulaufgabe}
+\newcommand{\TestArt}[1]{\renewcommand{\dieTestArt}{#1}}
+
+\newcommand{\dasFach}{Mathematik}
+\newcommand{\Fach}[1]{\renewcommand{\dasFach}{#1}}
+
+\newcommand{\derHeaderText}{\dieTestArt{} im Fach \dasFach}
+\newcommand{\HeaderText}[1]{\renewcommand{\derHeaderText}{#1}}
+
+
+\newcommand{\derEinleitungsSatz}{\textit{Achte auf eine korrekte Schreibweise und eine ordentliche äußere Form!}}
+\newcommand{\EinleitungsSatz}[1]{\renewcommand{\derEinleitungsSatz}{#1}}
\definecolor{testgrauRGB}{rgb}{0.9,0.9,0.9}
\definecolor{testgrauCMYK}{cmyk}{0.0,0.0,0.0,0.30}
@@ -72,37 +93,40 @@
\newcommand{\Intro}{
\fcolorbox{black}{testgrauRGB}{%
\parbox{14.3cm}{
- \centerline{\Large \bfseries \TestNummer{}. \HeaderText{}}
+ \centerline{\Large \bfseries \dieTestNummer{}. \derHeaderText{}}
\medskip
- \centerline{\bfseries Klasse \Klasse}
- \centerline{\bfseries -- am \Datum \ --}
+ \centerline{\bfseries Klasse \dieKlasse}
+ \centerline{\bfseries -- am \dasDatum \ --}
}
}
\medskip
\newline
- \centerline{\EinleitungsSatz}
+ \centerline{\derEinleitungsSatz}
\newline
}
+\newcommand{\PlatzKnapp}{\newcommand{\platzknapp}}
+\newcommand{\KeinKleeblatt}{\newcommand{\keinkleeblatt}}
+
\newcommand{\centeredgraphics}[2][]{\[\includegraphics[#1]{images/#2}\]}
\newcommand{\Ende}{
- \ifdefined\PlatzKnapp \makebox(100,25)[c]{}
+ \ifdefined\platzknapp \makebox(100,25)[c]{}
\else \vspace*{\fill}
\fi
- \ifdefined\KeinKleeblatt
+ \ifdefined\keinkleeblatt
\else
- \ifdefined\PlatzKnapp \centeredgraphics[height=1.5cm]{Kleeblatt.jpg}
+ \ifdefined\platzknapp \centeredgraphics[height=1.5cm]{Kleeblatt.jpg}
\else \centeredgraphics[height=2.5cm]{Kleeblatt.jpg}
\fi
\centerline{\textbf{Viel Erfolg! \Signatur}}
- \ifdefined\PlatzKnapp \makebox(1,10)[c]{}
+ \ifdefined\platzknapp \makebox(1,10)[c]{}
\else \makebox(1,50)[c]{}
\fi
%%Erstellt Summenzeichen und Erreichte Punktzahl
\centerline{\Large \bfseries $\sum$ \ \ \ \ \ \ \ \ \ \ {/}\AnzahlInsgesamtPunkte \ BE}
- \ifdefined\PlatzKnapp \makebox(1,10)[c]{}
+ \ifdefined\platzknapp \makebox(1,10)[c]{}
\else \makebox(100,100)[c]{}
\fi
}
@@ -114,12 +138,12 @@
\pagestyle{fancy}
\setlength{\headheight}{25 pt}
\fancyhf{}
-\fancyhead[L]{\ifnumcomp{\value{page}}{=}{1}{\ifdefined\KeinLogo \else \includegraphics[width=0.3\textwidth,height=1.5cm]{\LogoSchule} \newline \fi}{}\Schule}
-\fancyhead[R]{\ifnumcomp{\value{page}}{=}{1}{\Large Name: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }{\HeaderText}}
+\fancyhead[L]{\ifnumcomp{\value{page}}{=}{1}{\iftoggle{keinlogo}{}{\includegraphics[width=0.3\textwidth,height=1.5cm]{\LogoSchule} \newline}}{}\Schule}
+\fancyhead[R]{\ifnumcomp{\value{page}}{=}{1}{\Large Name: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }{\derHeaderText}}
\fancypagestyle{ErsteSeite}{%
\fancyhf{}%
- \fancyhead[L]{\ifdefined\KeinLogo \else \includegraphics[width=0.3\textwidth,height=1.5cm]{\LogoSchule} \newline \fi \Schule}
+ \fancyhead[L]{\iftoggle{keinlogo}{}{\includegraphics[width=0.3\textwidth,height=1.5cm]{\LogoSchule} \newline} \Schule}
\fancyhead[R]{\Large Name: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }
}