first restructuring approach: sorted packages

This commit is contained in:
Maximilian Keßler 2021-09-09 18:15:10 +02:00
parent ad7f1df1dd
commit 04a322a54c
4 changed files with 160 additions and 137 deletions

View File

@ -6,7 +6,17 @@
\RequirePackage{lmodern} % Use latin modern font \RequirePackage{lmodern} % Use latin modern font
\RequirePackage{anyfontsize} % Provides \fontsize{...}{...}\selectfont \RequirePackage{anyfontsize} % Provides \fontsize{...}{...}\selectfont
\RequirePackage{soul} % Hyphenation, crossing \ldots \RequirePackage{soul} % Hyphenation, crossing \ldots
\RequirePackage{microtype} % Hyphenation, character protrusion, font expansion
% Layout
\RequirePackage{parskip} % Leave blank line instead of indenting paragraphs
\RequirePackage{onehalfspacing}
\RequirePackage{changepage} % Change page layout in middle of document
\RequirePackage{tabto} % Tabulators
% Language support % Language support
\RequirePackage[\ifenglish english \else ngerman\fi]{babel} \RequirePackage[\ifenglish english \else ngerman\fi]{babel}
%Referencation
\RequirePackage{lastpage} %\pageref{LastPage} for reference on the last page

View File

@ -2,15 +2,10 @@
\ProvidesPackage{mkessler-math}[2021/03/31 - Math package] \ProvidesPackage{mkessler-math}[2021/03/31 - Math package]
%%%%%%Provides the basic math packages used for my lecture-note write-ups %%%%%%Provides the basic math packages used for my lecture-note write-ups
%The language to pass to babel \newif\if@mkessler@math@english\@mkessler@math@englishtrue
\newif\ifenglish\englishtrue \DeclareOption{german}{\@mkessler@math@englishfalse}
\DeclareOption{german}{\englishfalse} \DeclareOption{ngerman}{\@mkessler@math@englishfalse}
\DeclareOption{english}{\englishtrue} \DeclareOption{english}{\@mkessler@math@englishtrue}
%If beamer shall be activated
\newif\ifbeamer\beamerfalse
\DeclareOption{beamer}{\beamertrue}
\DeclareOption{nobeamer}{\beamerfalse}
\DeclareOption*{\PackageWarning{mkessler-math}{Unknown '\CurrentOption'}} \DeclareOption*{\PackageWarning{mkessler-math}{Unknown '\CurrentOption'}}
\ProcessOptions\relax \ProcessOptions\relax
@ -40,7 +35,6 @@
\newunicodechar{ψ}{\ensuremath\psi} \newunicodechar{ψ}{\ensuremath\psi}
\newunicodechar{ω}{\ensuremath\omega} \newunicodechar{ω}{\ensuremath\omega}
\RequirePackage{etoolbox}
\RequirePackage{amsmath} \RequirePackage{amsmath}
\RequirePackage{mathtools} \RequirePackage{mathtools}
\RequirePackage{amsthm} \RequirePackage{amsthm}
@ -48,9 +42,6 @@
\RequirePackage{latexsym} \RequirePackage{latexsym}
\RequirePackage{mathrsfs} \RequirePackage{mathrsfs}
\ifbeamer\else
\RequirePackage[shortlabels]{enumitem}
\fi
\RequirePackage{pgfplots} % Plots \RequirePackage{pgfplots} % Plots
\pgfplotsset{compat=1.7} \pgfplotsset{compat=1.7}
@ -60,45 +51,30 @@
\RequirePackage{tikz-cd} %Commutative diagrams \RequirePackage{tikz-cd} %Commutative diagrams
%%for small diagrams, similar to tikz-cd %%for small diagrams, similar to tikz-cd
\usepackage{xy} % for small diagrams, e.g. arrows \usepackage[all]{xy} % for small diagrams, e.g. arrows
\xyoption{all} %%% 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
%%Theorems needed in any case (fancy or not fancy theorems)
% Für Formeln % Für Formeln
\RequirePackage{mathabx} \RequirePackage{mathabx}
\RequirePackage{faktor} \RequirePackage{faktor}
\RequirePackage[mathscr]{eucal} \RequirePackage[mathscr]{eucal} % \mathscr for another calligraphic alphabet
\RequirePackage{blindtext}
\RequirePackage{tabto}
\RequirePackage{lastpage} %\pageref{LastPage} for reference on the last page
% Für Tabulatoren
\RequirePackage{pdfpages} % PDF-Dateien einbinden
% Für Zeilenumbruch
\RequirePackage{microtype}
\RequirePackage{changepage}
\RequirePackage{esint} \RequirePackage{esint}
\RequirePackage{IEEEtrantools} \RequirePackage{IEEEtrantools}
\RequirePackage[ngerman,ruled,vlined]{algorithm2e} \RequirePackage[ngerman,ruled,vlined]{algorithm2e}
%%% Custom commands %%% 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}}}
\newcommand{\F}{\ensuremath{\mathbb{F}}} \newcommand{\F}{\ensuremath{\mathbb{F}}}
@ -115,14 +91,12 @@
%Norm and absolute value %Norm and absolute value
%Make them scaling by default and have \abs*{} as the non-scaling version of the command %Make them scaling by default and have \abs*{} as the non-scaling version of the command
\DeclarePairedDelimiter\abs{\lvert}{\rvert} \DeclarePairedDelimiter\abs{\lvert}{\rvert}
\makeatletter
\let\oldabs\abs \let\oldabs\abs
\def\abs{\@ifstar{\oldabs}{\oldabs*}} \def\abs{\@ifstar{\oldabs}{\oldabs*}}
\DeclarePairedDelimiter\norm{\lVert}{\rVert} \DeclarePairedDelimiter\norm{\lVert}{\rVert}
\let\oldnorm\norm \let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}} \def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother
%%%Fixes of common misbehaviour %%%Fixes of common misbehaviour
@ -132,14 +106,15 @@
% Always put limits under \limit % Always put limits under \limit
\let\oldlim\lim\def\lim{\oldlim\limits} \let\oldlim\lim\def\lim{\oldlim\limits}
\newcommand{\emphasize}[1]{{\color{red} #1}} \RequirePackage[mathscr]{eucal} % \mathscr alphabet
\newcommand{\cat}[1]{ \mathscr{#1} }
%For setting counters of itemns in \enemerate
\makeatletter
\newcommand\setItemnumber[1]{\setcounter{enum\romannumeral\@enumdepth}{\numexpr#1-1\relax}}
\makeatother
\if@mkessler@math@english
\RequirePackage[english]{mkessler-operators}
\else
\RequirePackage[german]{mkessler-operators}
\fi

View File

@ -1,104 +1,133 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mkessler-operators}[2021-04-27 - Operator Package] \ProvidesPackage{mkessler-operators}[2021-04-27 - Operator Package]
%%%%%%%%%%%%%%%%%%mmmm %%%%%%%%%%%%%%%%%
%Provides some commonly used Operators used in the write-ups of my lecture notes %Provides some commonly used Operators used in the write-ups of my lecture notes
\newif\if@mkessler@operators@english\@mkessler@operators@englishtrue
\newif\ifenglish\englishtrue \DeclareOption{german}{\@mkessler@operators@englishfalse}
\DeclareOption{german}{\englishfalse} \DeclareOption{english}{\@mkessler@operators@englishtrue}
\DeclareOption{english}{\englishtrue}
\DeclareOption*{\PackageWarning{mkessler-operators}{Unknown '\CurrentOption'}} \DeclareOption*{\PackageWarning{mkessler-operators}{Unknown '\CurrentOption'}}
\ProcessOptions\relax \ProcessOptions\relax
%Packages %%%%%Package dependencies
\RequirePackage{amsmath} \RequirePackage{amsmath}
\RequirePackage{bbm}
%%%%Different types of operator wrappers:
% For simple math operators that are just to be printed as their name
\newcommand\DeclareSimpleMathOperator[1]{
\expandafter\providecommand\csname #1\endcsname{\operatorname{#1}}
}
%%%For distributions
%Introduce synonym for \operatorname
\newcommand\mkessler@operators@distribution[1]{\operatorname{#1}}
%Easily declare new distributions
\newcommand\DeclareDistribution[1]{\expandafter\def\csname #1\endcsname{\mkessler@operators@distribution{#1}}}
%%%For categories
%Introduce synonym for \operatorname
\newcommand\mkessler@operators@category[1]{\operatorname{\textbf{#1}}}
%Easily declare new categories
\newcommand\DeclareCategory[1]{\expandafter\def\csname #1\endcsname{\mkessler@operators@category{#1}}}
%%%%%%%%%%% Operators %%%%%%%%%%% Operators
%Basic commands %Basic commands
\renewcommand\subset\subseteq \DeclareSimpleMathOperator{id}
\renewcommand\supset\supseteq \DeclareSimpleMathOperator{im}
\DeclareMathOperator{\id}{id} \DeclareSimpleMathOperator{Bild}
\DeclareMathOperator{\im}{im} \DeclareSimpleMathOperator{dom}
\DeclareMathOperator{\Bild}{Bild} \DeclareSimpleMathOperator{Span}
\DeclareMathOperator{\dom}{dom} \DeclareSimpleMathOperator{Aut}
\DeclareMathOperator{\Span}{Span} \DeclareMathOperator{\rhs}{RHS} %Right hand side of equation
\DeclareMathOperator{\Aut}{Aut} \DeclareMathOperator{\lhs}{LHS} %Left hand side of equation
\let\ggT\relax\DeclareMathOperator{\ggT}{\ifenglish gcd \else ggT\fi}
\let\kgV\relax\DeclareMathOperator{\kgV}{\ifenglish lcm \elese kgV\fi} %%Provide \ggT \gcd \kgV \lcm for 'greatest common denominator' and 'least common multiple'
\DeclareMathOperator{\rhs}{RHS} %Right hand side % \ggT und \gcd, as well as \kgV and \lcm are synonyms and language-aware, so that
\DeclareMathOperator{\lhs}{LHS} %Left hand side % e.g. when the german language option is loaded, even
% \lcm would print 'kgV'
% The starred versions of the four commands will ignore the language option and print their
% exact names (without the *, of course)
\DeclareMathOperator{\@mkessler@operators@ggT}{ggT}
\DeclareMathOperator{\@@mkessler@operators@ggT}{\if@mkessler@operators@english gcd\else ggT\fi}
\def\ggT{\@ifstar\@mkessler@operators@ggT\@@mkessler@operators@ggT}
\DeclareMathOperator{\@mkessler@operators@gcd}{gcd}
\DeclareMathOperator{\@@mkessler@operators@gcd}{\if@mkessler@operators@english gcd\else ggT\fi}
\def\gcd{\@ifstar\@mkessler@operators@gcd\@@mkessler@operators@gcd}
\DeclareMathOperator{\@mkessler@operators@kgV}{kgV}
\DeclareMathOperator{\@@mkessler@operators@kgV}{\if@mkessler@operators@english lcm\else kgV\fi}
\def\kgV{\@ifstar\@mkessler@operators@kgV\@@mkessler@operators@kgV}
\DeclareMathOperator{\@mkessler@operators@lcm}{lcm}
\DeclareMathOperator{\@@mkessler@operators@lcm}{\if@mkessler@operators@english lcm\else kgV\fi}
\def\lcm{\@ifstar\@mkessler@operators@lcm\@@mkessler@operators@lcm}
%Complex numbers %Complex numbers
\DeclareMathOperator{\Impart}{Im} \DeclareMathOperator{\mkessler@impart}{Im}
\renewcommand\Im\Impart \renewcommand\Im\mkessler@impart
\DeclareMathOperator{\Repart}{Re} \DeclareMathOperator{\mkessler@repart}{Re}
\renewcommand\Re\Repart \renewcommand\Re\mkessler@impart
%Linear Algebra %Linear Algebra
\DeclareMathOperator{\Sym}{Sym} \DeclareSimpleMathOperator{Sym}
\DeclareMathOperator{\supp}{supp} \DeclareSimpleMathOperator{supp}
\DeclareMathOperator{\sgn}{sgn} \DeclareSimpleMathOperator{sgn}
\DeclareMathOperator{\coker}{coker} \DeclareSimpleMathOperator{coker}
\DeclareMathOperator{\rank}{rank} \DeclareSimpleMathOperator{rank}
\DeclareMathOperator{\Mat}{Mat} \DeclareSimpleMathOperator{Mat}
\DeclareMathOperator{\ev}{ev} \DeclareSimpleMathOperator{ev}
%Algebra %Algebra
\DeclareMathOperator{\Quot}{Quot} \DeclareSimpleMathOperator{Quot}
\DeclareMathOperator{\Gal}{Gal} \DeclareSimpleMathOperator{Gal}
\DeclareMathOperator{\Ext}{Ext} \DeclareSimpleMathOperator{Ext}
\DeclareMathOperator{\Tor}{Tor} \DeclareSimpleMathOperator{Tor}
\DeclareMathOperator{\Mspec}{MaxSpec} \DeclareSimpleMathOperator{MaxSpec}
\DeclareMathOperator{\Sh}{Sh} \DeclareSimpleMathOperator{Sh}
\DeclareMathOperator{\Proj}{Proj} \DeclareSimpleMathOperator{Proj}
\DeclareMathOperator{\QCoh}{QCoh} \DeclareSimpleMathOperator{QCoh}
\DeclareMathOperator{\MaxSpec}{MaxSpec} \DeclareSimpleMathOperator{MaxSpec}
\DeclareMathOperator{\Presh}{Pre-Sh} \DeclareSimpleMathOperator{Fun}
\DeclareMathOperator{\Fun}{Fun} \DeclareMathOperator{\PreSh}{Pre-Sh}
\newcommand{\tensor}{\otimes} \newcommand{\tensor}{\otimes} %Synonym for tensoring
%Analysis %Analysis
\DeclareMathOperator{\dx}{dx} \DeclareSimpleMathOperator{dx}
\DeclareMathOperator{\dy}{dy} \DeclareSimpleMathOperator{dy}
\DeclareMathOperator{\dz}{dz} \DeclareSimpleMathOperator{dz}
\DeclareMathOperator{\dt}{dt} \DeclareSimpleMathOperator{dt}
%Sets %Sets
\DeclareMathOperator{\conv}{conv} \DeclareSimpleMathOperator{conv}
\DeclareMathOperator{\dist}{dist} \DeclareSimpleMathOperator{dist}
\DeclareMathOperator{\diam}{diam} \DeclareSimpleMathOperator{diam}
%%Stochastic (Algorithmische Mathematik II) %%Stochastic (Algorithmische Mathematik II)
\newcommand\distribution[1]{\operatorname{#1}}
\newcommand\DeclareDistribution[1]{\expandafter\def\csname #1\endcsname{\distribution{#1}}}
\DeclareDistribution{Bin} \DeclareDistribution{Bin}
\DeclareDistribution{Ber} \DeclareDistribution{Ber}
\DeclareDistribution{Geo} \DeclareDistribution{Geo}
\DeclareDistribution{Poi} \DeclareDistribution{Poi}
\DeclareDistribution{Unif} \DeclareDistribution{Unif}
\DeclareMathOperator{\Var}{Var} \DeclareDistribution{Var}
\DeclareMathOperator{\Cov}{Cov} \DeclareDistribution{Cov}
%Topology %Topology
\DeclareMathOperator\pr{pr} \DeclareSimpleMathOperator{pr}
\def\twedge{\vee} \def\twedge{\vee} % Semantically correct macros for wedge product
\def\tsmash{\wedge} \def\tsmash{\wedge} % Semantically correct macro for smash product
%Category Theory %Category Theory
\DeclareMathOperator{\Ob}{Ob} \DeclareSimpleMathOperator{Ob}
\newcommand{\cat}[1]{ \mathscr{#1} } \DeclareSimpleMathOperator{Hom}
\DeclareMathOperator{\Hom}{Hom} \DeclareSimpleMathOperator{Mor}
\DeclareMathOperator{\Mor}{Mor} \DeclareSimpleMathOperator{End}
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\opposite}{\textbf{opp}}
\DeclareMathOperator{\abelian}{\textbf{ab}}
\newcommand{\ab}{^{\abelian}}
\newcommand\opp{^{\opposite}}
\newcommand\op{^{\opposite}}
%Categories %Categories
\newcommand\category[1]{\operatorname{\textbf{#1}}}
\newcommand\DeclareCategory[1]{\expandafter\def\csname #1\endcsname{\category{#1}}}
\DeclareCategory{Top} \DeclareCategory{Top}
\DeclareCategory{hTop} \DeclareCategory{hTop}
\DeclareCategory{Set} \DeclareCategory{Set}
@ -110,31 +139,28 @@
\DeclareCategory{Fin} \DeclareCategory{Fin}
\DeclareCategory{Ab} \DeclareCategory{Ab}
\DeclareCategory{Cat} \DeclareCategory{Cat}
\DeclareMathOperator{\colim}{colim}
%Set theory
\DeclareSimpleMathOperator{card}
\DeclareSimpleMathOperator{Cd}
\DeclareSimpleMathOperator{Ord}
\DeclareSimpleMathOperator{otp}
\DeclareSimpleMathOperator{Card}
%%Galoiskohomologie
\DeclareSimpleMathOperator{Br}
\DeclareSimpleMathOperator{EXT}
\DeclareSimpleMathOperator{Ind}
\DeclareSimpleMathOperator{char}
\DeclareSimpleMathOperator{res}
\DeclareSimpleMathOperator{inf}
\DeclareSimpleMathOperator{cov}
\newcommand{\del}{\partial} % Semantically correct operator for boundary maps
% Characteristic function % Characteristic function
\newcommand*{\cfun}{\ensuremath{\mathbbm{1}}} \newcommand*{\cfun}{\ensuremath{\mathbbm{1}}}
\newcommand*{\One}{\ensuremath{\mathbbm{1}}} \newcommand*{\One}{\cfun}
%Possibly destructive commands
%Set theory \renewcommand\subset\subseteq
\DeclareMathOperator\card{card} \renewcommand\supset\supseteq
\DeclareMathOperator\Cd{Cd}
\DeclareMathOperator\Ord{Ord}
\DeclareMathOperator\otp{otp}
\DeclareMathOperator\Card{Card}
%%Galoiskohomologie
\DeclareMathOperator{\Br}{Br}
\newcommand{\del}{\partial}
\DeclareMathOperator{\EXT}{EXT}
\DeclareMathOperator{\Ind}{Ind}
\DeclareMathOperator{\Char}{char}
\DeclareMathOperator{\res}{res}
\DeclareMathOperator{\infl}{inf}
\DeclareMathOperator{\cov}{cov}

View File

@ -1,5 +1,3 @@
%%%% Bibliography %%%% Bibliography
\RequirePackage[backend=biber,style=alphabetic]{biblatex} \RequirePackage[backend=biber,style=alphabetic]{biblatex}
@ -10,8 +8,22 @@
%%%% Utilities %%%% Utilities
\RequirePackage{comment} %comments \RequirePackage{comment} %comments
\RequirePackage{todo} % todo notes \RequirePackage{todo} % todo notes
\RequirePackage{blindtext} % \blindtext filling
\RequirePackage[export]{adjustbox} % \RequirePackage[export]{adjustbox} %
\RequirePackage{pdfpages} % Include external PDF files easily
% only load enumitem if beamer class has not been loaded
% This is based on the internal command beamer@tempdim that beamer.sty defines
\RequirePackage{etoolbox}
\ifdef{\beamer@tempdim}{}{
\RequirePackage[shortlabels]{enumitem}
}
\RequirePackage[mathscr]{eucal} % \mathscr alphabet
\newcommand{\cat}[1]{ \mathscr{#1} }
\newcommand{\emphasize}[1]{{\color{red} #1}}
%%% Figures %%% Figures
\RequirePackage{caption} % Caption in minipages \RequirePackage{caption} % Caption in minipages