typesetting/ngexrcs.cls
2025-12-24 05:06:10 +01:00

66 lines
1.8 KiB
TeX

% vim: set filetype:tex
% Identification %
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ngexrcs}[2021/12/21 ADS Exercise class]
% Handle options %
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions\relax
% More declarations %
\LoadClass{scrartcl}
\KOMAoptions{mpinclude=true}
\recalctypearea
\RequirePackage{ngutils}
\RequirePackage{enumitem}
\setlist{leftmargin=*}
% define fonts
\RequirePackage{fontspec}
%\RequirePackage{tgpagella}
%\RequirePackage{tgheros}
%\RequirePackage{euler-math}
\RequirePackage[math-style=upright]{unicode-math}
\setmainfont{TeX Gyre Pagella}
\setsansfont{TeX Gyre Heros}
\setmonofont{TeX Gyre Cursor}
\setmathfont{Euler Math}
\setlength{\marginparwidth}{1.5\marginparwidth}
\setlength{\fboxrule}{\heavyrulewidth}
%
\renewcommand\theenumi{\@alph\c@enumi}
\renewcommand\theenumii{\@arabic\c@enumii}
%\renewcommand\theenumiii{\@roman\c@enumiii}
%\renewcommand\theenumiv{\@Alph\c@enumiv}
\renewcommand\labelenumi{\theenumi)}
\renewcommand\labelenumii{\theenumii.}
%\renewcommand\labelenumiii{\theenumiii.}
%\renewcommand\labelenumiv{\theenumiv.}
% Use sansfont for all title elements
\addtokomafont{titlehead}{\sffamily}
\addtokomafont{subject}{\normalfont \sffamily \itshape}
\addtokomafont{title}{\sffamily}
\addtokomafont{subtitle}{\sffamily}
\addtokomafont{author}{\sffamily}
\addtokomafont{date}{\sffamily}
\addtokomafont{publishers}{\sffamily}
% Use serif font for headings
\addtokomafont{disposition}{\rmfamily}
% Let sections be formated as in: Aufgabe 1 -- Section title
\renewcommand*{\sectionformat}{Aufgabe \thesection\autodot\enskip--\enskip}
% Let points of an exercise be printed as in: [__ / 2]
\newkomafont{points}{\sffamily}
\newcommand\points[2][\quad]{\marginline{\framebox{{\usekomafont{points}#1 \textbf{/} #2}}}}