clean up math package even more, move circled command to mathsymb package

This commit is contained in:
Maximilian Keßler 2021-09-08 21:01:28 +02:00
parent e0d20609f2
commit a9a2f55dc5
2 changed files with 46 additions and 62 deletions

View File

@ -12,16 +12,6 @@
\DeclareOption{beamer}{\beamertrue} \DeclareOption{beamer}{\beamertrue}
\DeclareOption{nobeamer}{\beamerfalse} \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'}} \DeclareOption*{\PackageWarning{mkessler-math}{Unknown '\CurrentOption'}}
\ProcessOptions\relax \ProcessOptions\relax
@ -32,38 +22,34 @@
% When using utf8x, we have to load ucs and inputenc with utf8x option and must exclude bibtex % 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 % 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 % also, when using plain utf8, we want to load the newunicodechar package
\RequirePackage[\ifutf utf8\else utf8x\fi]{inputenc} \RequirePackage[utf8]{inputenc}
\ifutf
\RequirePackage{newunicodechar} \RequirePackage{newunicodechar}
\newunicodechar{α}{\ensuremath\alpha} \newunicodechar{α}{\ensuremath\alpha}
\newunicodechar{β}{\ensuremath\beta} \newunicodechar{β}{\ensuremath\beta}
\newunicodechar{γ}{\ensuremath\gamma} \newunicodechar{γ}{\ensuremath\gamma}
\newunicodechar{δ}{\ensuremath\delta} \newunicodechar{δ}{\ensuremath\delta}
\newunicodechar{ε}{\ensuremath\epsilon} \newunicodechar{ε}{\ensuremath\epsilon}
\newunicodechar{ζ}{\ensuremath\zeta} \newunicodechar{ζ}{\ensuremath\zeta}
\newunicodechar{η}{\ensuremath\eta} \newunicodechar{η}{\ensuremath\eta}
\newunicodechar{θ}{\ensuremath\theta} \newunicodechar{θ}{\ensuremath\theta}
\newunicodechar{ι}{\ensuremath\iota} \newunicodechar{ι}{\ensuremath\iota}
\newunicodechar{κ}{\ensuremath\kappa} \newunicodechar{κ}{\ensuremath\kappa}
\newunicodechar{λ}{\ensuremath\lambda} \newunicodechar{λ}{\ensuremath\lambda}
\newunicodechar{μ}{\ensuremath\mu} \newunicodechar{μ}{\ensuremath\mu}
\newunicodechar{ν}{\ensuremath\nu} \newunicodechar{ν}{\ensuremath\nu}
\newunicodechar{ξ}{\ensuremath\xi} \newunicodechar{ξ}{\ensuremath\xi}
\newunicodechar{π}{\ensuremath\pi} \newunicodechar{π}{\ensuremath\pi}
\newunicodechar{ρ}{\ensuremath\rho} \newunicodechar{ρ}{\ensuremath\rho}
\newunicodechar{σ}{\ensuremath\sigma} \newunicodechar{σ}{\ensuremath\sigma}
\newunicodechar{τ}{\ensuremath\tau} \newunicodechar{τ}{\ensuremath\tau}
\newunicodechar{υ}{\ensuremath\upsilon} \newunicodechar{υ}{\ensuremath\upsilon}
\newunicodechar{φ}{\ensuremath\phi} \newunicodechar{φ}{\ensuremath\phi}
\newunicodechar{χ}{\ensuremath\chi} \newunicodechar{χ}{\ensuremath\chi}
\newunicodechar{ψ}{\ensuremath\psi} \newunicodechar{ψ}{\ensuremath\psi}
\newunicodechar{ω}{\ensuremath\omega} \newunicodechar{ω}{\ensuremath\omega}
\RequirePackage[backend=biber,style=alphabetic]{biblatex} \RequirePackage[backend=biber,style=alphabetic]{biblatex}
\RequirePackage{csquotes} \RequirePackage{csquotes}
\else
\RequirePackage[mathletters]{ucs}
\fi
\RequirePackage{anyfontsize} \RequirePackage{anyfontsize}
\RequirePackage{lmodern} \RequirePackage{lmodern}
@ -118,22 +104,18 @@
\RequirePackage{microtype} \RequirePackage{microtype}
\RequirePackage{changepage} \RequirePackage{changepage}
\RequirePackage{esint}
%Für Zeilenabstand 1,5 \RequirePackage{IEEEtrantools}
\ifonehalfspacing
\RequirePackage[onehalfspacing]{setspace} \else
\fi
%For setting counters of itemns in \enemerate \RequirePackage[ngerman,ruled,vlined]{algorithm2e}
\makeatletter
\newcommand\setItemnumber[1]{\setcounter{enum\romannumeral\@enumdepth}{\numexpr#1-1\relax}}
\makeatother
%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{} %Short commands for \mathbb{}
\newcommand{\C}{\ensuremath{\mathbb{C}}} \newcommand{\C}{\ensuremath{\mathbb{C}}}
@ -160,23 +142,22 @@
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}} \def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother \makeatother
%Fixes of common misbehaviour %%%Fixes of common misbehaviour
%Proper Degree command
\renewcommand{\degree}{^\circ} \renewcommand{\degree}{^\circ}
% Always put limits under \limit % Always put limits under \limit
\let\oldlim\lim\def\lim{\oldlim\limits} \let\oldlim\lim\def\lim{\oldlim\limits}
%Used to start an exercise and resetting the equation number \newcommand{\emphasize}[1]{{\color{red} #1}}
%\newcommand{\nr}[1]{\setcounter{equation}{0}\section*{\ifenglish Exercise \else Aufgabe \fi #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}

View File

@ -27,11 +27,14 @@
\RequirePackage{graphicx} \RequirePackage{graphicx}
\newcommand\contra{\scalebox{1.5}{$\lightning$}} \newcommand\contra{\scalebox{1.5}{$\lightning$}}
%Print a warning sign %Print a warning sign
\RequirePackage{pgf} \RequirePackage{pgf}
\newcommand\Warning{% \newcommand\Warning{%
\makebox[1.4em][c]{% \makebox[1.4em][c]{%
\makebox[0pt][c]{\raisebox{.1em}{\small!}}% \makebox[0pt][c]{\raisebox{.1em}{\small!}}%
\makebox[0pt][c]{\color{red}\Large$\bigtriangleup$}}}% \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};}}