aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-04-24 11:31:31 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-04-24 11:31:31 +0200
commit35d739edafcfdecfb4f02bebc5a8e41201d55a88 (patch)
tree93fd820c1f29625eef768f37117b7053499d40b7
parenteca6267ce15a94a9013d3b793550ea72fc2d524b (diff)
downloadunterricht-35d739edafcfdecfb4f02bebc5a8e41201d55a88.tar.gz
unterricht-35d739edafcfdecfb4f02bebc5a8e41201d55a88.zip
improve latex classes
* pass options to the underling KOMA script * introduce new drawborder option for test * fix test header always printing Mathematik * increase \Ende shrinking if PlatzKnapp is defined * add command to not include the shamrock image
-rw-r--r--latex/common_options.tex2
-rw-r--r--latex/handout.cls10
-rw-r--r--latex/test.cls52
3 files changed, 50 insertions, 14 deletions
diff --git a/latex/common_options.tex b/latex/common_options.tex
index 0ef8b1cb..b76dd419 100644
--- a/latex/common_options.tex
+++ b/latex/common_options.tex
@@ -1,4 +1,4 @@
-\RequirePackage{etoolbox}
+% \RequirePackage{etoolbox}
\newtoggle{lehrerversion}
\DeclareOption{lehrerversion}{\toggletrue{lehrerversion}}
diff --git a/latex/handout.cls b/latex/handout.cls
index 5943769a..8d9fb7b1 100644
--- a/latex/handout.cls
+++ b/latex/handout.cls
@@ -1,13 +1,19 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{handout}[muhq's simple handout class]
+% etoolbox is needed for our common options
+\RequirePackage{etoolbox}
+
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
+
+\input{common_options.tex}
+
\LoadClass{scrartcl}
\input{common_packages.tex}
-\input{common_options.tex}
\input{common.tex}
-\geometry{a4paper,margin=1cm,nohead}
+\geometry{a4paper, margin=1cm, nohead}
\newcommand{\solution}[1]{
\iftoggle{lehrerversion}{
diff --git a/latex/test.cls b/latex/test.cls
index 64fdf54e..2f5585a4 100644
--- a/latex/test.cls
+++ b/latex/test.cls
@@ -1,7 +1,15 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{test}[muhq's test class]
-\renewcommand{\baselinestretch}{1,5}
+% etoolbox is needed for our common options
+\RequirePackage{etoolbox}
+
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
+
+\newtoggle{drawborder}
+\DeclareOption{drawborder}{\toggletrue{drawborder}}
+
+\input{common_options.tex}
\LoadClass[a4paper,12pt]{scrartcl}
@@ -13,11 +21,31 @@
\RequirePackage{comment}
\input{common_packages.tex}
-\input{common_options.tex}
+
\input{common.tex}
\geometry{a4paper, top=35mm, left=20mm, right=35mm, bottom=25mm, headsep=15mm, footskip=10mm}
+\iftoggle{drawborder}{
+ \RequirePackage{everypage}
+ \RequirePackage{tikzpagenodes}
+ \usetikzlibrary{backgrounds}
+
+ \AddEverypageHook{
+ \ifthispageodd{
+ \begin{tikzpicture}[remember picture, overlay, black]
+ \draw (current page marginpar area.north west) -- (current page marginpar area.south west);
+ \end{tikzpicture}
+ }{
+ \begin{tikzpicture}[remember picture, overlay, black]
+ \draw (current page marginpar area.north east) -- (current page marginpar area.south east);
+ \end{tikzpicture}
+ }
+ }
+}{}
+
+\renewcommand{\baselinestretch}{1,5}
+
\newcommand{\Verteilung}{}
\newcommand{\AnzahlPunkte}{0} %%Anzahl der Punkte festlegen
@@ -86,7 +114,7 @@
\newcommand{\Intro}{
\fcolorbox{black}{testgrauRGB}{%
\parbox{14.3cm}{
- \centerline{\Large \bfseries \TestNummer{}. \TestArt{} aus der Mathematik}
+ \centerline{\Large \bfseries \TestNummer{}. \TestArt{} aus der \Fach{}}
\medskip
\centerline{\bfseries Klasse \Klasse}
\centerline{\bfseries -- am \Datum \ --}
@@ -102,19 +130,21 @@
\ifdefined\PlatzKnapp \makebox(100,25)[c]{}
\else \vspace*{\fill}
\fi
- %\makebox(100,50)[c]{}
- \centeredgraphics[height=2.5cm]{Kleeblatt.jpg}
+ \ifdefined\KeinKleeblatt
+ \else
+ \ifdefined\PlatzKnapp \centeredgraphics[height=1.5cm]{Kleeblatt.jpg}
+ \else \centeredgraphics[height=2.5cm]{Kleeblatt.jpg}
+ \fi
\centerline{\textbf{Viel Erfolg! \Signatur}}
- \newline
- \makebox(1,50)[c]{}
+ \ifdefined\PlatzKnapp \makebox(1,10)[c]{}
+ \else \makebox(1,50)[c]{}
+ \fi
%%Erstellt Summenzeichen und Erreichte Punktzahl
\centerline{\Large \bfseries $\sum$ \ \ \ \ \ \ \ \ \ \ {/}\AnzahlInsgesamtPunkte \ BE}
- \makebox(1,25)[c]{} \newline
- \ifdefined\PlatzKnapp
- \else
- \makebox(100,100)[c]{}
+ \ifdefined\PlatzKnapp \makebox(1,10)[c]{}
+ \else \makebox(100,100)[c]{}
\fi
}