move unicode declarations into separate package

This commit is contained in:
Maximilian Keßler 2021-09-09 21:45:25 +02:00
parent 813ea4276e
commit 32e5b8860a
2 changed files with 42 additions and 80 deletions

View file

@ -10,30 +10,14 @@
\DeclareOption*{\PackageWarning{mkessler-math}{Unknown '\CurrentOption'}} \DeclareOption*{\PackageWarning{mkessler-math}{Unknown '\CurrentOption'}}
\ProcessOptions\relax \ProcessOptions\relax
\RequirePackage{newunicodechar} %%%% Import the other custom math packages
\newunicodechar{α}{\ensuremath\alpha} \RequirePackage{mkessler-mathfonts} % Load this first to ensure untouched fonts
\newunicodechar{β}{\ensuremath\beta} \RequirePackage{mkessler-faktor}
\newunicodechar{γ}{\ensuremath\gamma} \RequirePackage[\inf@mkessler@math@english english\else german\fi]{mkessler-operators}
\newunicodechar{δ}{\ensuremath\delta} \RequirePackage{mkessler-mathfig}
\newunicodechar{ε}{\ensuremath\epsilon} \RequirePackage{mkessler-mathsymb}
\newunicodechar{ζ}{\ensuremath\zeta} \RequirePackage{mkessler-unicodechar}
\newunicodechar{η}{\ensuremath\eta} \RequirePackage{mkessler-mathfixes} % Load this last since it renews behaviour
\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{amsmath} \RequirePackage{amsmath}
\RequirePackage{mathtools} \RequirePackage{mathtools}
@ -41,40 +25,15 @@
\RequirePackage{amssymb} \RequirePackage{amssymb}
\RequirePackage{latexsym} \RequirePackage{latexsym}
\RequirePackage{mathrsfs}
\RequirePackage{pgfplots} % Plots
\pgfplotsset{compat=1.7}
\RequirePackage{tikz} % Plots / drawings
\usetikzlibrary{calc, intersections, through, quotes, angles, babel, positioning, snakes}
\RequirePackage{tikz-cd} %Commutative diagrams
%%for small diagrams, similar to tikz-cd
\usepackage[all]{xy} % for small diagrams, e.g. arrows
%%% In older versions, you found
% \usepackage{xy}
% \xyoption{all}
% here, but this messes with the catcode of the @ sign (which no package should do!)
% so that further parts in this package would get broken
% Für Formeln % Für Formeln
\RequirePackage{mathabx} \RequirePackage{mathabx}
\RequirePackage{faktor}
\RequirePackage[mathscr]{eucal} % \mathscr for another calligraphic alphabet
\RequirePackage{esint} \RequirePackage{esint}
\RequirePackage{IEEEtrantools} \RequirePackage{IEEEtrantools}
\RequirePackage[ngerman,ruled,vlined]{algorithm2e} \RequirePackage[ngerman,ruled,vlined]{algorithm2e}
%%% Custom commands %%% Custom commands
%Short commands for \mathbb{} %Short commands for \mathbb{}
\newcommand{\C}{\ensuremath{\mathbb{C}}} \newcommand{\C}{\ensuremath{\mathbb{C}}}
\newcommand{\F}{\ensuremath{\mathbb{F}}} \newcommand{\F}{\ensuremath{\mathbb{F}}}
@ -83,34 +42,3 @@
\newcommand{\Q}{\ensuremath{\mathbb{Q}}} \newcommand{\Q}{\ensuremath{\mathbb{Q}}}
\newcommand{\R}{\ensuremath{\mathbb{R}}} \newcommand{\R}{\ensuremath{\mathbb{R}}}
\newcommand{\Z}{\ensuremath{\mathbb{Z}}} \newcommand{\Z}{\ensuremath{\mathbb{Z}}}
%Paired Delimiters
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
%Norm and absolute value
%Make them scaling by default and have \abs*{} as the non-scaling version of the command
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\let\oldabs\abs
\def\abs{\@ifstar{\oldabs}{\oldabs*}}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
%%%Fixes of common misbehaviour
%Proper Degree command
\renewcommand{\degree}{^\circ}
% Always put limits under \limit
\let\oldlim\lim\def\lim{\oldlim\limits}
\if@mkessler@math@english
\RequirePackage[english]{mkessler-operators}
\else
\RequirePackage[german]{mkessler-operators}
\fi

View file

@ -0,0 +1,34 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mkessler-unicodechar}[2021/09/08 - Wrapper for the newunicodchar package with defined unicode symbols]
%%%%%%%%
% This is just a simple package loading the newunicodechar package and defining the common unicode symbols i regularly use for typesetting mathematics
\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}
\newcommand\omicron{o}\newunicodechar{ο}{\ensuremath\omicron} % For semantical use
\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}