diff --git a/tex/latex/ngexrcs/ngexrcs.cls b/tex/latex/ngexrcs/ngexrcs.cls index 400ecbd..ba90825 100644 --- a/tex/latex/ngexrcs/ngexrcs.cls +++ b/tex/latex/ngexrcs/ngexrcs.cls @@ -29,7 +29,7 @@ % Use sansfont for all title elements \addtokomafont{titlehead}{\sffamily} -\addtokomafont{subject}{\normalfont \sffamily \itshape} +\addtokomafont{subject}{\sffamily} \addtokomafont{title}{\sffamily} \addtokomafont{subtitle}{\sffamily} \addtokomafont{author}{\sffamily} @@ -44,7 +44,7 @@ % Let points of an exercise be printed as in: [__ / 2] \newkomafont{points}{\sffamily} -\newcommand\points[2][\quad]{\marginline{\framebox{{\usekomafont{points}#1 \textbf{/} #2}}}} +\newcommand\points[2][1em]{\marginline{\framebox{{\usekomafont{points} \hspace{#1} \textbf{/} #2}}}} \newcounter{task} \renewcommand{\thetask}{\@alph\c@task)} diff --git a/tex/latex/ngutils/ngutils.sty b/tex/latex/ngutils/ngutils.sty index 615c953..69cc21c 100644 --- a/tex/latex/ngutils/ngutils.sty +++ b/tex/latex/ngutils/ngutils.sty @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ngutils}[2025/12/24 Never's LaTeX utils] +\ProvidesPackage{ngutils}[2026/06/05 Never's LaTeX utils] \RequirePackage[ngerman]{babel} \RequirePackage{graphicx} @@ -16,7 +16,7 @@ basicstyle=\normalfont, identifierstyle=\scshape, keywordstyle=\bfseries, - keywords={, new, if, then, else, while, for, in, to, up, down, foreach, do, return}, + keywords={, and, or, not, new, if, then, else, while, for, in, to, up, down, foreach, do, return}, commentstyle=\itshape, comment=[l]//, delim=[is][\normalfont]{|}{|}, @@ -54,17 +54,45 @@ \newcommand{\braces}[1]{\left\{#1\right\}} \newcommand{\angled}[1]{\left\langle#1\right\rangle} -\newcommand{\tup}[1]{\parens{#1}} -\newcommand{\ivl}[1]{\brackets{#1}} -\newcommand{\set}[1]{\braces{#1}} -\newcommand{\arr}[1]{\angled{#1}} -\newcommand{\abs}[1]{\lvert#1\rvert} -\newcommand{\norm}[1]{\lVert#1\rVert} -\newcommand{\ceil}[1]{\lceil#1\rceil} -\newcommand{\floor}[1]{\lfloor#1\rfloor} +\newcommand{\suchthat}{\;\middle\vert\;} -\newcommand{\alg}[2]{{\normalfont\scshape#1}{\normalfont(#2)}} +\newcommand{\tup}[1]{\parens{#1}} +\newcommand{\interval}[2][b]{ + \if\detokenize{a}\detokenize{#1}% + \left[#2\right[ + \fi + \if\detokenize{b}\detokenize{#1}% + \left[#2\right] + \fi + \if\detokenize{c}\detokenize{#1}% + \left]#2\right[ + \fi + \if\detokenize{d}\detokenize{#1}% + \left]#2\right] + \fi +} +\newcommand{\set}[2][]{ + \ifx& + \braces{#2} + \else + \braces{#1 \suchthat #2} + \fi +} +\newcommand{\arr}[1]{\angled{#1}} +\newcommand{\abs}[1]{\left\vert#1\right\vert} +\newcommand{\norm}[1]{\left\Vert#1\right\Vert} +\newcommand{\ceil}[1]{\left\lceil#1\right\rceil} +\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor} + +% \newcommand{\alg}[2]{{\normalfont\scshape#1}{\normalfont(#2)}} \newcommand{\algt}[1]{{\normalfont\scshape#1}} + +\makeatletter +\newcommand*{\alg@unstarred}[2]{{\normalfont\scshape#1}{\normalfont(#2)}} +\newcommand*{\alg@starred}[1]{{\normalfont\scshape#1}} +\newcommand*{\alg}{\@ifstar{\alg@starred}{\alg@unstarred}} +\makeatother + \newcommand{\com}[1]{{\normalfont\itshape/\!\!/ #1}} \newenvironment{algorithmic}[1][1em]{