latex-packages/packages/math/mathop.pysty

178 lines
5.5 KiB
Text
Raw Normal View History

2021-10-06 20:35:06 +02:00
__HEADER__(Math Operator Package)
2021-08-26 13:41:40 +02:00
%Provides some commonly used Operators used in the write-ups of my lecture notes
2021-10-07 10:06:23 +02:00
\RequirePackage{xkeyval}
2021-10-06 20:35:06 +02:00
2021-10-07 10:06:23 +02:00
__LANGUAGE_OPTIONS_X__
__END_OPTIONS_X__
2021-08-26 13:41:40 +02:00
%%%%%Package dependencies
2021-08-26 13:41:40 +02:00
\RequirePackage{amsmath}
\RequirePackage{bbm}
2021-09-09 21:46:01 +02:00
\RequirePackage{mathtools}
%%%%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
2021-10-06 20:35:06 +02:00
\newcommand__PACKAGE_MACRO__(distribution)[1]{\operatorname{#1}}
%Easily declare new distributions
2021-10-06 20:35:06 +02:00
\newcommand\DeclareDistribution[1]{\expandafter\def\csname #1\endcsname{__PACKAGE_MACRO__(distribution){#1}}}
%%%For categories
%Introduce synonym for \operatorname
2021-10-06 20:35:06 +02:00
\newcommand__PACKAGE_MACRO__(category)[1]{\operatorname{\textbf{#1}}}
%Easily declare new categories
2021-10-06 20:35:06 +02:00
\newcommand\DeclareCategory[1]{\expandafter\def\csname #1\endcsname{__PACKAGE_MACRO__(category){#1}}}
2021-08-26 13:41:40 +02:00
%%%%%%%%%%% Operators
%Basic commands
\DeclareSimpleMathOperator{id}
\DeclareSimpleMathOperator{im}
\DeclareSimpleMathOperator{Bild}
\DeclareSimpleMathOperator{dom}
\DeclareSimpleMathOperator{Span}
\DeclareSimpleMathOperator{Aut}
\DeclareMathOperator{\rhs}{RHS} %Right hand side of equation
\DeclareMathOperator{\lhs}{LHS} %Left hand side of equation
%%Provide \ggT \gcd \kgV \lcm for 'greatest common denominator' and 'least common multiple'
% \ggT und \gcd, as well as \kgV and \lcm are synonyms and language-aware, so that
% 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)
2021-10-06 20:35:06 +02:00
\DeclareMathOperator{\@__PACKAGE_PREFIX__ggT}{ggT}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__ggT}{\if@__PACKAGE_PREFIX__english gcd\else ggT\fi}
\def\ggT{\@ifstar\@__PACKAGE_PREFIX__ggT\@@__PACKAGE_PREFIX__ggT}
2021-10-06 20:35:06 +02:00
\DeclareMathOperator{\@__PACKAGE_PREFIX__gcd}{gcd}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__gcd}{\if@__PACKAGE_PREFIX__english gcd\else ggT\fi}
\def\gcd{\@ifstar\@__PACKAGE_PREFIX__gcd\@@__PACKAGE_PREFIX__gcd}
2021-10-06 20:35:06 +02:00
\DeclareMathOperator{\@__PACKAGE_PREFIX__kgV}{kgV}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__kgV}{\if@__PACKAGE_PREFIX__english lcm\else kgV\fi}
\def\kgV{\@ifstar\@__PACKAGE_PREFIX__kgV\@@__PACKAGE_PREFIX__kgV}
2021-10-06 20:35:06 +02:00
\DeclareMathOperator{\@__PACKAGE_PREFIX__lcm}{lcm}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__lcm}{\if@__PACKAGE_PREFIX__english lcm\else kgV\fi}
\def\lcm{\@ifstar\@__PACKAGE_PREFIX__lcm\@@__PACKAGE_PREFIX__lcm}
2021-08-26 13:41:40 +02:00
%Complex numbers
2021-10-06 20:35:06 +02:00
\DeclareMathOperator{__PACKAGE_MACRO__(impart)}{Im}
\renewcommand\Im__PACKAGE_MACRO__(impart)
\DeclareMathOperator{__PACKAGE_MACRO__(repart)}{Re}
\renewcommand\Re__PACKAGE_MACRO__(repart)
2021-08-26 13:41:40 +02:00
%Linear Algebra
\DeclareSimpleMathOperator{Sym}
\DeclareSimpleMathOperator{supp}
\DeclareSimpleMathOperator{sgn}
\DeclareSimpleMathOperator{coker}
\DeclareSimpleMathOperator{rank}
\DeclareSimpleMathOperator{Mat}
\DeclareSimpleMathOperator{ev}
2021-08-26 13:41:40 +02:00
%Algebra
\DeclareSimpleMathOperator{Quot}
\DeclareSimpleMathOperator{Gal}
\DeclareSimpleMathOperator{Ext}
\DeclareSimpleMathOperator{Tor}
\DeclareSimpleMathOperator{MaxSpec}
\DeclareSimpleMathOperator{Sh}
\DeclareSimpleMathOperator{Proj}
\DeclareSimpleMathOperator{QCoh}
\DeclareSimpleMathOperator{MaxSpec}
\DeclareSimpleMathOperator{Fun}
\DeclareMathOperator{\PreSh}{Pre-Sh}
\newcommand{\tensor}{\otimes} %Synonym for tensoring
2021-08-26 13:41:40 +02:00
%Analysis
\DeclareSimpleMathOperator{dx}
\DeclareSimpleMathOperator{dy}
\DeclareSimpleMathOperator{dz}
\DeclareSimpleMathOperator{dt}
2021-08-26 13:41:40 +02:00
%Sets
\DeclareSimpleMathOperator{conv}
\DeclareSimpleMathOperator{dist}
\DeclareSimpleMathOperator{diam}
2021-08-26 13:41:40 +02:00
%%Stochastic (Algorithmische Mathematik II)
\DeclareDistribution{Bin}
\DeclareDistribution{Ber}
\DeclareDistribution{Geo}
\DeclareDistribution{Poi}
\DeclareDistribution{Unif}
\DeclareDistribution{Var}
\DeclareDistribution{Cov}
2021-08-26 13:41:40 +02:00
%Topology
\DeclareSimpleMathOperator{pr}
\def\twedge{\vee} % Semantically correct macros for wedge product
\def\tsmash{\wedge} % Semantically correct macro for smash product
2021-08-26 13:41:40 +02:00
%Category Theory
\DeclareSimpleMathOperator{Ob}
\DeclareSimpleMathOperator{Hom}
\DeclareSimpleMathOperator{Mor}
\DeclareSimpleMathOperator{End}
2021-09-09 22:42:08 +02:00
\DeclareSimpleMathOperator{colim}
2021-08-26 13:41:40 +02:00
%Categories
\DeclareCategory{Top}
\DeclareCategory{hTop}
\DeclareCategory{Set}
\DeclareCategory{CHaus}
\DeclareCategory{Grp}
\DeclareCategory{Ab}
\DeclareCategory{CRing}
\DeclareCategory{Vect}
\DeclareCategory{Fin}
\DeclareCategory{Ab}
\DeclareCategory{Cat}
%Set theory
\DeclareSimpleMathOperator{card}
\DeclareSimpleMathOperator{Cd}
\DeclareSimpleMathOperator{Ord}
\DeclareSimpleMathOperator{otp}
\DeclareSimpleMathOperator{Card}
2021-08-26 13:41:40 +02:00
%%Galoiskohomologie
\DeclareSimpleMathOperator{Br}
\DeclareSimpleMathOperator{EXT}
\DeclareSimpleMathOperator{Ind}
\DeclareSimpleMathOperator{char}
\DeclareSimpleMathOperator{res}
\DeclareSimpleMathOperator{inf}
\DeclareSimpleMathOperator{cov}
\newcommand{\del}{\partial} % Semantically correct operator for boundary maps
2021-08-26 13:41:40 +02:00
% Characteristic function
\newcommand*{\cfun}{\ensuremath{\mathbbm{1}}}
\newcommand*{\One}{\cfun}
2021-08-26 13:41:40 +02:00
2021-09-09 21:46:01 +02:00
%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*}}
\DeclareMathOperator{\amalgprod}{\star}