8000 ScribUTT/packages/commands.sty at main · ungdev/ScribUTT · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
230 lines (193 loc) · 6.33 KB

commands.sty

File metadata and controls

230 lines (193 loc) · 6.33 KB
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{packages/commands}
% Taking derivatives
\newcommand { \dd } [ 2 ] { \dfrac { d #1 } { d #2 } }
\newcommand { \dydx } { \dd yx }
\newcommand { \ddx } [1] { \dd {#1} x }
\newcommand { \ddt } [1] { \dd {#1} t }
% Taking partial derivatives
\newcommand { \pp } [ 2 ] { \frac { \partial #1 } { \partial
#2 } }
\newcommand { \ppx } [1] { \pp {#1} x }
\newcommand { \ppy } [1] { \pp {#1} y }
\newcommand { \ppz } [1] { \pp {#1} z }
% evaluating anti - derivatives
\newcommand { \eval } { \Big | }
% formatting some important single letters
\newcommand { \e } { \mbox { \large $ e $ \rule { 0 in } { 1.6 ex
}}}
% Labelling L ' Hospital ' s Rule
\newcommand { \LH } { \stackrel { \text { LH } } { = } }
% Asking if two things are equal
\newcommand { \eq } { \stackrel { \text { ? } } { = } }
% making a larger decimal point
\newcommand { \bd } { \mbox { \Large . } }
% For using in integrals , like \int\newcommand { \dx } { \ , dx }
\newcommand { \dy } { \ , dy }
\newcommand { \dz } { \ , dz }
\newcommand { \dt } { \ , dt }
\newcommand { \du } { \ , du }
\newcommand { \dv } { \ , dv }
\newcommand { \dtheta } { \ , d \theta }
% Integral over a path
\newcommand{\pathint}{\oint}
% Integral over a volume
\newcommand{\volint}{\iiint}
% Modulo operator
\newcommand{\modulo}[2]{#1 \bmod #2}
% Big-O notation
\newcommand{\bigO}[1]{\mathcal{O}\left( #1 \right)}
% Laplacian operator
\newcommand{\laplacian}{\nabla^2}
% Fourier transform
\newcommand{\fourier}[1]{\mathcal{F}\left\{ #1 \right\}}
\newcommand{\invfourier}[1]{\mathcal{F}^{-1}\left\{ #1 \right\}}
% Laplace transform
\newcommand{\laplace}[1]{\mathcal{L}\left\{ #1 \right\}}
\newcommand{\invlaplace}[1]{\mathcal{L}^{-1}\left\{ #1 \right\}}
% Z-transform
\newcommand{\ztransform}[1]{\mathcal{Z}\left\{ #1 \right\}}
\newcommand{\invztransform}[1]{\mathcal{Z}^{-1}\left\{ #1 \right\}}
% Commutator
\newcommand{\commutator}[2]{\left[ #1, #2 \right]}
% Anticommutator
\newcommand{\anticommutator}[2]{\left\{ #1, #2 \right\}}
% Dot product
\newcommand{\dotprod}[2]{\mathbf{#1} \cdot \mathbf{#2}}
% Cross product
\newcommand{\crossprod}[2]{\mathbf{#1} \times \mathbf{#2}}
% Tensor product
\newcommand{\tensorprod}[2]{\mathbf{#1} \otimes \mathbf{#2}}
% For specially formatted fractions
\newcommand { \textfrac } [ 2 ] { \frac { \text { #1 } } {
\text { #2 } } }
\newcommand { \change } [ 2 ] { \frac { \text { change in
#1 } } { \text { change in #2 } } }
% Better appearance for a " skinny frac "
% like \frac 1 x
\newcommand { \sfrac } [ 2 ] { \frac { \ #1 \ } { #2 } }
% domain , image and identity functions
\newcommand { \dom } { \mathop { \rm dom } \nolimits }
\newcommand { \im } { \mathop { \rm im } \nolimits }
\newcommand { \id } { \mathop { \rm id } \nolimits }
% Real numbers , etc .
\usepackage { amsfonts }
\newcommand { \R } { \mathbb { R } }
\newcommand { \Z } { \mathbb { Z } }
\newcommand { \Q } { \mathbb { Q } }
\newcommand { \C } { \mathbb { C } }
% inverse functions
\newcommand { \inv } { { -1 } }
% Making answer blanks
\newcommand { \blank } [ 1 ] { \underline { \hspace * { #1 } }
}
\usepackage { amssymb }
% stands for " not divides "
\newcommand { \notdiv } { \nmid }
% for labeling parts of proofs
\newcommand { \forwards } { ``$ \Rightarrow $ ''}
\newcommand { \contra } { \ensuremath { \Rightarrow
\Leftarrow } }
\newcommand { \backwards } { ``$ \Leftarrow $ ''}
% Standard basis vectors in R^3
\newcommand{\ihat}{\hat{\mathbf{i}}}
\newcommand{\jhat}{\hat{\mathbf{j}}}
\newcommand{\khat}{\hat{\mathbf{k}}}
%%% Quantic
\usepackage{braket}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Fancy boxes for theorem lemma and proof and codes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{mdframed}
\newcounter{theo}[section]\setcounter{theo}{0}
\renewcommand{\thetheo}{\arabic{section}~-~\arabic{theo}}
\usepackage{xcolor}
\newenvironment{theo}[2][]
{%
\refstepcounter{theo}%
\ifstrempty{#1}%
% DO THIS
{
\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=bleuRoiUTT]
{
\strut {\color{white} Théorème }~\thetheo
};
}
}
}
% ELSE
{
\mdfsetup{%
frametitle=
{%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=bleuRoiUTT]
{
% Ici c'est le "titre"
\strut {\color{white} Théorème ~\thetheo :~ #1 }
}
;}
}%
}%
\mdfsetup{
innertopmargin=10pt,linecolor=bleuRoiUTT,%
linewidth=2pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]
\relax%
\label{#2}
}
{
\end{mdframed}
}
% Another
\newenvironment{callout}[1]
{%
\ifstrempty{#1}%
% DO THIS
{
\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=bleuRoiUTT]
{
\strut {}
};
}
}
}
% ELSE
{
\mdfsetup{%
frametitle=
{%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=bleuRoiUTT]
{
% Ici c'est le "titre"
\strut {
{\color{white} #1 }
}
}
;}
}%
}%
\mdfsetup{
innertopmargin=10pt,linecolor=bleuRoiUTT,%
linewidth=2pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]
\relax%
}
{
\end{mdframed}
}
%%%%%%%%%%%%%%%%%%- Unicode chars
\DeclareUnicodeCharacter{2212}{-}
\DeclareUnicodeCharacter{2261}{≡}
\DeclareUnicodeCharacter{03C6}{φ}
0