From a9a2f55dc5fb68ed39c43e0aa2032ac435cd642c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 8 Sep 2021 21:01:28 +0200 Subject: [PATCH] clean up math package even more, move circled command to mathsymb package --- mkessler-math.sty | 101 +++++++++++++++++------------------------- mkessler-mathsymb.sty | 7 ++- 2 files changed, 46 insertions(+), 62 deletions(-) diff --git a/mkessler-math.sty b/mkessler-math.sty index 8192cea..9101e35 100644 --- a/mkessler-math.sty +++ b/mkessler-math.sty @@ -12,16 +12,6 @@ \DeclareOption{beamer}{\beamertrue} \DeclareOption{nobeamer}{\beamerfalse} -%Options for onehalf-spacing of lines -\newif\ifonehalfspacing\onehalfspacingfalse %default is normalspace -\DeclareOption{onehalfspacing}{\onehalfspacingtrue} -\DeclareOption{normalspacing}{\onehalfspacingfalse} - -%Options for utf8 or utf8x - encoding -\newif\ifutf\utftrue %by default, utf8 is not enabled -\DeclareOption{utf8x}{\utffalse} -\DeclareOption{utf8}{\utftrue} - \DeclareOption*{\PackageWarning{mkessler-math}{Unknown '\CurrentOption'}} \ProcessOptions\relax @@ -32,38 +22,34 @@ % When using utf8x, we have to load ucs and inputenc with utf8x option and must exclude bibtex % When not using utf8x (plan utf8), we must NOT load ucs, and then load inputenc with utf8-option as well as bibtex % also, when using plain utf8, we want to load the newunicodechar package -\RequirePackage[\ifutf utf8\else utf8x\fi]{inputenc} -\ifutf +\RequirePackage[utf8]{inputenc} \RequirePackage{newunicodechar} -\newunicodechar{α}{\ensuremath\alpha} -\newunicodechar{β}{\ensuremath\beta} -\newunicodechar{γ}{\ensuremath\gamma} -\newunicodechar{δ}{\ensuremath\delta} -\newunicodechar{ε}{\ensuremath\epsilon} -\newunicodechar{ζ}{\ensuremath\zeta} -\newunicodechar{η}{\ensuremath\eta} -\newunicodechar{θ}{\ensuremath\theta} -\newunicodechar{ι}{\ensuremath\iota} -\newunicodechar{κ}{\ensuremath\kappa} -\newunicodechar{λ}{\ensuremath\lambda} -\newunicodechar{μ}{\ensuremath\mu} -\newunicodechar{ν}{\ensuremath\nu} -\newunicodechar{ξ}{\ensuremath\xi} -\newunicodechar{π}{\ensuremath\pi} -\newunicodechar{ρ}{\ensuremath\rho} -\newunicodechar{σ}{\ensuremath\sigma} -\newunicodechar{τ}{\ensuremath\tau} -\newunicodechar{υ}{\ensuremath\upsilon} -\newunicodechar{φ}{\ensuremath\phi} -\newunicodechar{χ}{\ensuremath\chi} -\newunicodechar{ψ}{\ensuremath\psi} -\newunicodechar{ω}{\ensuremath\omega} + \newunicodechar{α}{\ensuremath\alpha} + \newunicodechar{β}{\ensuremath\beta} + \newunicodechar{γ}{\ensuremath\gamma} + \newunicodechar{δ}{\ensuremath\delta} + \newunicodechar{ε}{\ensuremath\epsilon} + \newunicodechar{ζ}{\ensuremath\zeta} + \newunicodechar{η}{\ensuremath\eta} + \newunicodechar{θ}{\ensuremath\theta} + \newunicodechar{ι}{\ensuremath\iota} + \newunicodechar{κ}{\ensuremath\kappa} + \newunicodechar{λ}{\ensuremath\lambda} + \newunicodechar{μ}{\ensuremath\mu} + \newunicodechar{ν}{\ensuremath\nu} + \newunicodechar{ξ}{\ensuremath\xi} + \newunicodechar{π}{\ensuremath\pi} + \newunicodechar{ρ}{\ensuremath\rho} + \newunicodechar{σ}{\ensuremath\sigma} + \newunicodechar{τ}{\ensuremath\tau} + \newunicodechar{υ}{\ensuremath\upsilon} + \newunicodechar{φ}{\ensuremath\phi} + \newunicodechar{χ}{\ensuremath\chi} + \newunicodechar{ψ}{\ensuremath\psi} + \newunicodechar{ω}{\ensuremath\omega} \RequirePackage[backend=biber,style=alphabetic]{biblatex} \RequirePackage{csquotes} -\else -\RequirePackage[mathletters]{ucs} -\fi \RequirePackage{anyfontsize} \RequirePackage{lmodern} @@ -118,22 +104,18 @@ \RequirePackage{microtype} \RequirePackage{changepage} +\RequirePackage{esint} -%Für Zeilenabstand 1,5 -\ifonehalfspacing -\RequirePackage[onehalfspacing]{setspace} \else -\fi +\RequirePackage{IEEEtrantools} -%For setting counters of itemns in \enemerate -\makeatletter -\newcommand\setItemnumber[1]{\setcounter{enum\romannumeral\@enumdepth}{\numexpr#1-1\relax}} -\makeatother +\RequirePackage[ngerman,ruled,vlined]{algorithm2e} -%Make circled symbols -\newcommand*\circled[1]{\tikz[baseline=(char.base)]{ - \node[shape=circle,draw,inner sep=2pt] (char) {#1};}} -\newcommand{\emphasize}[1]{{\color{red} #1}} +%%% Custom commands + + +%%Load additional operators +\RequirePackage{mkessler-operators} %Short commands for \mathbb{} \newcommand{\C}{\ensuremath{\mathbb{C}}} @@ -160,23 +142,22 @@ \def\norm{\@ifstar{\oldnorm}{\oldnorm*}} \makeatother -%Fixes of common misbehaviour +%%%Fixes of common misbehaviour + +%Proper Degree command \renewcommand{\degree}{^\circ} % Always put limits under \limit \let\oldlim\lim\def\lim{\oldlim\limits} -%Used to start an exercise and resetting the equation number -%\newcommand{\nr}[1]{\setcounter{equation}{0}\section*{\ifenglish Exercise \else Aufgabe \fi #1}~} +\newcommand{\emphasize}[1]{{\color{red} #1}} + +%For setting counters of itemns in \enemerate +\makeatletter +\newcommand\setItemnumber[1]{\setcounter{enum\romannumeral\@enumdepth}{\numexpr#1-1\relax}} +\makeatother -\RequirePackage{esint} - -\RequirePackage{IEEEtrantools} - -\RequirePackage[ngerman,ruled,vlined]{algorithm2e} -%%Load additional operators -\RequirePackage{mkessler-operators} diff --git a/mkessler-mathsymb.sty b/mkessler-mathsymb.sty index 6130914..7bc8517 100644 --- a/mkessler-mathsymb.sty +++ b/mkessler-mathsymb.sty @@ -27,11 +27,14 @@ \RequirePackage{graphicx} \newcommand\contra{\scalebox{1.5}{$\lightning$}} - - %Print a warning sign \RequirePackage{pgf} \newcommand\Warning{% \makebox[1.4em][c]{% \makebox[0pt][c]{\raisebox{.1em}{\small!}}% \makebox[0pt][c]{\color{red}\Large$\bigtriangleup$}}}% + +%Make circled symbols +\newcommand*\circled[1]{\tikz[baseline=(char.base)]{ + \node[shape=circle,draw,inner sep=2pt] (char) {#1};}} +