summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fnspe
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/fnspe
Initial commit
Diffstat (limited to 'macros/latex/contrib/fnspe')
-rw-r--r--macros/latex/contrib/fnspe/README18
-rw-r--r--macros/latex/contrib/fnspe/fnspe.pdfbin0 -> 199982 bytes
-rw-r--r--macros/latex/contrib/fnspe/fnspe.sty218
-rw-r--r--macros/latex/contrib/fnspe/fnspe.tex591
4 files changed, 827 insertions, 0 deletions
diff --git a/macros/latex/contrib/fnspe/README b/macros/latex/contrib/fnspe/README
new file mode 100644
index 0000000000..8f6e011818
--- /dev/null
+++ b/macros/latex/contrib/fnspe/README
@@ -0,0 +1,18 @@
+README for fnspe.sty
+
+fnspe 1.2a
+Created by Michal Zeman
+Updated September 20, 2017
+
+E-mail comments and suggestions to: michalzemaster@gmail.com
+GIT contribution: https://bitbucket.org/Zemaster/fnspe-latex-package
+
+This material is subject to the LaTeX Project Public License.
+See https://www.latex-project.org/lppl/ for the details of that license.
+
+This package is primary intended for students of FNSPE CTU in Prague
+but many other students or scientists can found this package as useful.
+
+This package implements different standards of tensor notation,
+interval notation and complex notation. Further many macros and
+shortcuts are added, e.q. for spaces, operators, physics unit, etc. \ No newline at end of file
diff --git a/macros/latex/contrib/fnspe/fnspe.pdf b/macros/latex/contrib/fnspe/fnspe.pdf
new file mode 100644
index 0000000000..e14ff0884d
--- /dev/null
+++ b/macros/latex/contrib/fnspe/fnspe.pdf
Binary files differ
diff --git a/macros/latex/contrib/fnspe/fnspe.sty b/macros/latex/contrib/fnspe/fnspe.sty
new file mode 100644
index 0000000000..a1ca922bb8
--- /dev/null
+++ b/macros/latex/contrib/fnspe/fnspe.sty
@@ -0,0 +1,218 @@
+% fnspe 1.2a
+% This material is subject to the LaTeX Project Public License.
+% See https://www.latex-project.org/lppl/ for the details of that license.
+%
+% Useful commands for FNSPE students
+%
+% Created by Michal Zeman
+% Updated on September 20, 2017
+% Uploaded on September 20, 2017
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{fnspe}[2017/09/20 Package for FNSPE CTU in Prague made by Michal Zeman]
+
+\RequirePackage{xstring}
+\RequirePackage{bm}
+
+\RequirePackage{amsmath}
+\RequirePackage{amsfonts}
+\RequirePackage{mathrsfs}
+\RequirePackage{amsthm}
+\RequirePackage{amssymb}
+\RequirePackage{xcolor}
+\RequirePackage{listings}
+\RequirePackage{physics}
+\RequirePackage{tikz} % For arrow and dots in \xvec
+\RequirePackage{substr}
+\RequirePackage{mathtools}
+
+\newif\if@isointerval\@isointervalfalse
+\DeclareOption{isointerval}{
+ \@isointervaltrue
+}
+
+\newif\if@isoointerval\@isoointervalfalse
+\DeclareOption{isoointerval}{
+ \@isoointervaltrue
+}
+
+\newif\if@fnspeinterval\@fnspeintervalfalse
+\DeclareOption{fnspeinterval}{
+ \@fnspeintervaltrue
+}
+
+\newif\if@isotensor\@isotensorfalse
+\DeclareOption{isotensor}{
+ \@isotensortrue
+}
+
+\newif\if@undertensor\@undertensorfalse
+\DeclareOption{undertensor}{
+ \@undertensortrue
+}
+
+\newif\if@arrowtensor\@arrowtensorfalse
+\DeclareOption{arrowtensor}{
+ \@arrowtensortrue
+}
+
+\newif\if@oldcomplex\@oldcomplexfalse
+\DeclareOption{oldcomplex}{
+ \@oldcomplextrue
+}
+
+\newif\if@isocomplex\@isocomplexfalse
+\DeclareOption{isocomplex}{
+ \@isocomplextrue
+}
+
+\newif\if@deftext\@deftextfalse
+\DeclareOption{deftext}{
+ \@deftexttrue
+}
+
+\newif\if@defcolon\@defcolonfalse
+\DeclareOption{defcolon}{
+ \@defcolontrue
+}
+
+\ProcessOptions\relax
+
+\newlength\xvec@height%
+\newlength\xvec@depth%
+\newlength\xvec@width%
+\newcommand{\xvec}[1]{%
+ \ifmmode%
+ \settoheight{\xvec@height}{$#1$}%
+ \settodepth{\xvec@depth}{$#1$}%
+ \settowidth{\xvec@width}{$#1$}%
+ \else%
+ \settoheight{\xvec@height}{#1}%
+ \settodepth{\xvec@depth}{#1}%
+ \settowidth{\xvec@width}{#1}%
+ \fi%
+ \raisebox{.2ex}{\raisebox{\xvec@height}{\rlap{%
+ \kern.05em% (Because left edge of drawing is at .05em)
+ \begin{tikzpicture}[scale=1]
+ \pgfsetroundcap
+ \draw (.05em,.01)--(\xvec@width-.05em,0.01);
+ \draw (\xvec@width-.05em,0.01)--(\xvec@width-.2em, .155em);
+ \draw (\xvec@width-.05em,0.01)--(\xvec@width-.2em,-.125em);
+ %
+ \end{tikzpicture}%
+ }}}%
+ #1%
+}
+
+\lstset
+{
+ language=[LaTeX]TeX,
+ breaklines=true,
+ basicstyle=\tt\scriptsize,
+ morekeywords = [28]{ci,oi,lci,rci,rest,dif, hlf, degree, hem, htem, oover, realn, inte, ratin, compn, natun, impem, rot, dive, grad, lapl, varun, unit, expv, norm, abs, pder, tder,mat,curl,laplacian, divisionsymbol,
+ floor, ceil, df, allsetzero, allset, cclass, ccinf, ccof},
+ keywordstyle=\color{blue},
+ identifierstyle=\color{magenta},
+}
+
+%\catcode`_=\active
+
+%\newcommand_[1]{\IfSubStr{#1}{!}{\sb{\mathrm{\StrBehind{#1}{!}}}}{\sb{#1}} }
+
+\mathcode`\_=\string"8000
+\catcode`\_=12
+
+\begingroup
+\catcode`\_=\active
+\gdef_#1{\IfCharInString{!}{#1}{\sb{\mathrm{\StrBehind{#1}{!}}}}{\sb{#1}} }
+\endgroup
+\mathcode`\_=\string"8000
+\catcode`\_=12
+
+%\let\stdvec\vec
+\if@arrowtensor
+\renewcommand{\vec}[1]{\xvec{#1}}
+\else
+\renewcommand{\vec}[1]{\ensuremath{\if@undertensor \underline{#1} \else \bm{\mathrm{\MakeLowercase{#1}}} \fi}}
+\fi
+
+\newcommand{\mat}[1]{\ensuremath{\if@undertensor \underline{\underline{#1}} \else \if@arrowtensor \overset{\leftrightarrow}{#1} \else \bm{\mathrm{\MakeUppercase{#1}}} \fi \fi}}
+
+%\newcommand{\pder}[3][]{\ensuremath{\frac{\partial^#1 #2}{\partial #3^#1}}} \pdv
+
+\newcommand*{\tder}[3][]{\dv[#1]{#2}{#3}} %\dv
+
+\newcommand{\oi}[2]{\ensuremath{\if@fnspeinterval \left( #1 , #2 \right) \else \if@isoointerval \left( #1 , #2 \right) \else \left] #1 , #2 \right[ \fi \fi}}
+
+\newcommand{\ci}[2]{\ensuremath{\if@fnspeinterval \left< #1 , #2 \right> \else \left[ #1 , #2 \right] \fi}}
+
+\newcommand{\rci}[2]{\ensuremath{\if@fnspeinterval \left( #1 , #2 \right> \else \if@isoointerval \left( #1 , #2 \right] \else \left] #1 , #2 \right] \fi \fi}}
+
+\newcommand{\lci}[2]{\ensuremath{\if@fnspeinterval \left< #1 , #2 \right) \else \if@isoointerval \left[ #1 , #2 \right) \else \left[ #1 , #2 \right[ \fi \fi}}
+
+%\newcommand{\rest}[2]{\ensuremath{\left.#1\right|_{#2}}}
+
+\newcommand{\dif}[1]{\mathrm d #1}
+
+\newcommand{\hlf}{\frac{1}{2}}
+
+\newcommand{\degree}{\ensuremath{{}^{\circ}}}
+%\newcommand{\deg}{\degree}
+
+\newcommand{\hem}[1][1]{\hspace{#1em}}
+\newcommand{\htwoem}{\hspace{2em}}
+\newcommand{\htem}{\htwoem}
+
+\newcommand{\oover}[1]{\ensuremath{\frac{1}{#1}}}
+
+\newcommand{\realn}{\ensuremath{\mathbb{R}}}
+\newcommand{\compn}{\ensuremath{\mathbb{C}}}
+\newcommand{\inte}{\ensuremath{\mathbb{Z}}}
+\newcommand{\ratin}{\ensuremath{\mathbb{Q}}}
+\newcommand{\natun}{\ensuremath{\mathbb{N}}}
+\newcommand{\nnzero}{\ensuremath{\mathbb{N}_0}}
+
+\newcommand{\impem}{\hem \Rightarrow \hem}
+
+\newcommand{\rot}{\curl}
+%\newcommand{\dive}{\ensuremath{\nabla \cdot}}
+%\newcommand{\grad}{\ensuremath{\nabla}}
+\newcommand{\lapl}{\Delta} %\laplacian
+
+\newcommand{\varun}[2]{\ensuremath{\left[#1\right]=\mathrm{#2}}}
+\newcommand{\unit}[1]{\;\mathrm{#1}}
+\newcommand{\expv}[1]{\left<#1\right>}
+
+%\newcommand{\norm}[1]{\ensuremath{\left|\left|#1\right|\right|}}
+%\newcommand{\abs}[1]{\ensuremath{\left|#1\right|}}
+
+\if@oldcomplex
+\renewcommand{\Re}{\ensuremath{\mathfrak{Re}}}
+\else
+\renewcommand{\Re}{\ensuremath{\mathrm{Re}\;}}
+\fi
+
+\if@oldcomplex
+\renewcommand{\Im}{\ensuremath{\mathfrak{Im}}}
+\else
+\renewcommand{\Im}{\ensuremath{\mathrm{Im}\;}}
+\fi
+
+%\newcommand{\maxv}[1]{\vec{\mathcal{#1}}}
+%\newcommand{\maxs}[1]{\mathcal{#1}}
+
+\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
+\DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor}
+
+\if@deftext
+\newcommand{\df}{\stackrel{\mathclap{\normalfont{\mbox{\tiny def.}}}}{=}}
+\else
+\newcommand{\df}{\mbox{:=}}
+\fi
+
+\newcommand{\allset}[1]{\{1,2,\ldots,#1\}}
+\newcommand{\allsetzero}[1]{\{0,1,\ldots,#1\}}
+
+\newcommand{\cclass}{\mathscr{C}}
+\newcommand{\ccof}[1]{\cclass^{#1}}
+\newcommand{\ccinf}{\ccof{\infty}} \ No newline at end of file
diff --git a/macros/latex/contrib/fnspe/fnspe.tex b/macros/latex/contrib/fnspe/fnspe.tex
new file mode 100644
index 0000000000..6986fd4d63
--- /dev/null
+++ b/macros/latex/contrib/fnspe/fnspe.tex
@@ -0,0 +1,591 @@
+% fnspe 1.2a
+% This material is subject to the LaTeX Project Public License.
+% See https://www.latex-project.org/lppl/ for the details of that license.
+%
+% Useful commands for FNSPE students
+%
+% Created by Michal Zeman
+% Updated on September 20, 2017
+% Uploaded on September 20, 2017
+
+\documentclass{article}
+\usepackage[arrowtensor,oldcomplex]{fnspe}
+\usepackage{hyperref}
+\begin{document}
+ \section*{Options}
+
+ In this package there are four categories of options (examples and differences will be shown further)
+ \begin{enumerate}
+ \item for interval notation
+ \begin{itemize}
+ \item \texttt{isointerval} for using standardized format of interval described in \textbf{ISO 31-11}
+ \item \texttt{isoointerval} for using standardized alternative format of interval described in \textbf{ISO 31-11}
+ \item \texttt{fnspeinterval} for using special notation used at FNSPE CTU in Prague
+ \end{itemize}
+ \item for tensor notation (now for vectors and matrices)
+ \begin{itemize}
+ \item \texttt{isotensor} for using standardized format of tensor
+ \item \texttt{undertensor} for using underline notation of tensor
+ \item \texttt{arrowtensor} for using arrow notation of tensor
+ \end{itemize}
+ \item for complex notation (real and complex part)
+ \begin{itemize}
+ \item \texttt{isocomplex} for using standardized format of complex and real part
+ \item \texttt{oldcomplex} for using old \LaTeX{} default format of complex and real part
+ \end{itemize}
+ \item for definition notation
+ \begin{itemize}
+ \item \texttt{deftext} for definition using \textit{def.} over the equal
+ \item \texttt{defcolon} for definition using the colon with equal
+ \end{itemize}
+ \end{enumerate}
+
+ \section*{Macros}
+ \subsection*{Interval}
+ Let $a$ and $b$ be real numbers.
+
+ \subsubsection*{Closed interval}
+ Using of macro
+ \begin{lstlisting}
+ \ci{a}{b}
+ \end{lstlisting}
+ as \textbf{c}losed \textbf{i}nterval.
+
+ \begin{itemize}
+ \item \texttt{isointerval}
+ \begin{equation*}
+ \left[ a , b \right]
+ \end{equation*}
+ \item \texttt{isoointerval} (same as for \texttt{isointerval})
+ \begin{equation*}
+ \left[ a , b \right]
+ \end{equation*}
+ \item \texttt{fnspeinterval}
+ \begin{equation*}
+ \left< a , b \right>
+ \end{equation*}
+ \end{itemize}
+
+ \subsubsection*{Opened interval}
+ Using of macro
+ \begin{lstlisting}
+ \oi{a}{b}
+ \end{lstlisting}
+ as \textbf{o}pened \textbf{i}nterval.
+
+ \begin{itemize}
+ \item \texttt{isointerval}
+ \begin{equation*}
+ \left] a , b \right[
+ \end{equation*}
+ \item \texttt{isoointerval}
+ \begin{equation*}
+ \left( a , b \right)
+ \end{equation*}
+ \item \texttt{fnspeinterval} (same as for \texttt{isoointerval})
+ \begin{equation*}
+ \left( a , b \right)
+ \end{equation*}
+ \end{itemize}
+
+ \subsubsection*{Right closed interval}
+ Using of macro
+ \begin{lstlisting}
+ \rci{a}{b}
+ \end{lstlisting}
+ as \textbf{r}ight \textbf{c}losed \textbf{i}nterval.
+
+ \begin{itemize}
+ \item \texttt{isointerval}
+ \begin{equation*}
+ \left] a , b \right]
+ \end{equation*}
+ \item \texttt{isoointerval}
+ \begin{equation*}
+ \left( a , b \right]
+ \end{equation*}
+ \item \texttt{fnspeinterval}
+ \begin{equation*}
+ \left( a , b \right>
+ \end{equation*}
+ \end{itemize}
+
+ \subsubsection*{Left closed interval}
+ Using of macro
+ \begin{lstlisting}
+ \lci{a}{b}
+ \end{lstlisting}
+ as \textbf{l}eft \textbf{c}losed \textbf{i}nterval.
+
+ \begin{itemize}
+ \item \texttt{isointerval}
+ \begin{equation*}
+ \left[ a , b \right[
+ \end{equation*}
+ \item \texttt{isoointerval} (same as for \texttt{isointerval})
+ \begin{equation*}
+ \left[ a , b \right)
+ \end{equation*}
+ \item \texttt{fnspeinterval}
+ \begin{equation*}
+ \left< a , b \right)
+ \end{equation*}
+ \end{itemize}
+
+ \subsubsection*{Using in text}
+ All these macros can be used directly in text (thanks to the command \textit{ensuremath}). Therefore one can use this syntax
+ \begin{lstlisting}
+ Let $x$ be in \ci{a}{b}
+ \end{lstlisting}
+ which casts: Let $x$ be in \ci{a}{b}.
+
+ \subsection*{Tensor}
+ Let $x$ be vector and $A$ be matrix.
+
+ \subsubsection*{Vector}
+ Using of macro
+ \begin{lstlisting}
+ \vec{x}
+ \end{lstlisting}
+ as \textbf{vec}tor.
+
+ \begin{itemize}
+ \item \texttt{isotensor} - small letter with italic boldface
+ \begin{equation*}
+ \bm{\mathrm{x}}
+ \end{equation*}
+ \item \texttt{undertensor}
+ \begin{equation*}
+ \underline{x}
+ \end{equation*}
+ \item \texttt{arrowtensor}
+ \begin{equation*}
+ \vec x
+ \end{equation*}
+ \end{itemize}
+
+ \subsubsection*{Matrix}
+ Using of macro
+ \begin{lstlisting}
+ \mat{x}
+ \end{lstlisting}
+ as \textbf{mat}rix.
+
+ \begin{itemize}
+ \item \texttt{isotensor} - capital letter with italic boldface
+ \begin{equation*}
+ \bm{\mathrm{A}}
+ \end{equation*}
+ \item \texttt{undertensor}
+ \begin{equation*}
+ \underline{\underline{A}}
+ \end{equation*}
+ \item \texttt{arrowtensor}
+ \begin{equation*}
+ \mat{A}
+ \end{equation*}
+ \end{itemize}
+
+ \subsubsection*{Using in text}
+ All these macros can be used directly in text (thanks to the command \textit{ensuremath}). Therefore one can use this syntax
+ \begin{lstlisting}
+ Let \vec{x} be real.
+ \end{lstlisting}
+ which casts: Let \vec{x} be real.
+
+ \subsection*{Macro for set}
+
+ \subsubsection*{Set of natural numbers from 1 to $n$}
+ Using of macro
+ \begin{lstlisting}
+ \allset{n}
+ \end{lstlisting}
+ as \textbf{all} natural number up to $n$ \textbf{set} leads to
+ \begin{equation*}
+ \allset{n}.
+ \end{equation*}
+
+ \subsubsection*{Set of natural numbers from 0 to $n$}
+ Using of macro
+ \begin{lstlisting}
+ \allsetzero{n}
+ \end{lstlisting}
+ as \textbf{all} natural number up to $n$ \textbf{set} with \textbf{zero} leads to
+ \begin{equation*}
+ \allsetzero{n}.
+ \end{equation*}
+
+ \subsection*{Differentiability class}
+
+ \subsubsection*{Just symbol}
+ Using of macro
+ \begin{lstlisting}
+ \cclass
+ \end{lstlisting}
+ as \textbf{C} \textbf{class} leads to
+ \begin{equation*}
+ \cclass.
+ \end{equation*}
+
+ \subsubsection*{C infinity}
+ Using of macro
+ \begin{lstlisting}
+ \ccinf
+ \end{lstlisting}
+ as \textbf{C} \textbf{class} of \textbf{inf}inity leads to
+ \begin{equation*}
+ \ccinf.
+ \end{equation*}
+
+ \subsubsection*{C of order $d$}
+ Using of macro
+ \begin{lstlisting}
+ \ccof{d}
+ \end{lstlisting}
+ as \textbf{C} \textbf{class} \textbf{of} order leads to
+ \begin{equation*}
+ \ccof{d}.
+ \end{equation*}
+
+ \subsection*{Complex}
+ Let $z \in \compn$.
+
+ \subsubsection*{Real part}
+ Using of macro
+ \begin{lstlisting}
+ \Re{x}
+ \end{lstlisting}
+ as \textbf{Re}al.
+
+ \begin{itemize}
+ \item \texttt{oldcomplex}
+ \begin{equation*}
+ \Re\left\{z\right\}
+ \end{equation*}
+ \item \texttt{isocomplex}
+ \begin{equation*}
+ \mathrm{Re}\; z
+ \end{equation*}
+ \end{itemize}
+
+ \subsubsection*{Imaginary part}
+ Using of macro
+ \begin{lstlisting}
+ \Im{x}
+ \end{lstlisting}
+ as \textbf{Im}aginary.
+
+ \begin{itemize}
+ \item \texttt{oldcomplex}
+ \begin{equation*}
+ \Im\left\{z\right\}
+ \end{equation*}
+ \item \texttt{isocomplex}
+ \begin{equation*}
+ \mathrm{Im}\; z
+ \end{equation*}
+ \end{itemize}
+
+ \subsubsection*{Using in text}
+ All these macros can be used directly in text (thanks to the command \textit{ensuremath}). Therefore one can use this syntax
+ \begin{lstlisting}
+ Let $x$ equal to \Re{z}.
+ \end{lstlisting}
+ which casts: Let $x$ equal to $\mathrm{Re}\;z$.
+
+ \subsection*{Subscript}
+ Subscript text with two or more characters should be written in roman style (not italic as default). One can use prefix ! which makes the word after it in roman style. Using of macro
+ \begin{lstlisting}
+ A_{!unique}
+ \end{lstlisting}
+ which leads to
+ \begin{equation*}
+ A_{!unigue}
+ \end{equation*}
+ instead of classic
+ \begin{equation*}
+ A_{unique}
+ \end{equation*}
+
+ \subsection*{Floor and ceiling functions}
+ \subsubsection*{Floor function}
+ Macro
+ \begin{lstlisting}
+ \floor{x}
+ \end{lstlisting}
+ as \textbf{floor} function leads to
+ \begin{equation*}
+ \floor{x}
+ \end{equation*}
+
+ \subsubsection*{Ceil function}
+ Macro
+ \begin{lstlisting}
+ \ceil{x}
+ \end{lstlisting}
+ as \textbf{ceil} function leads to
+ \begin{equation*}
+ \ceil{x}
+ \end{equation*}
+
+ \subsection*{Definition operator}
+ There are two ways to set a definition operator. First with \textit{text} and the second with \textit{colon}.
+
+ \subsubsection*{Text definition}
+ Macro
+ \begin{lstlisting}
+ x \df a
+ \end{lstlisting}
+ \begin{itemize}
+ \item \texttt{deftext}
+ \begin{equation*}
+ x \stackrel{\mathclap{\normalfont{\mbox{\tiny def.}}}}{=} a
+ \end{equation*}
+ \item \texttt{defcolon}
+ \begin{equation*}
+ x \df a
+ \end{equation*}
+ \end{itemize}
+
+
+ \subsection*{Special sets of numbers}
+
+ \subsubsection*{Natural number}
+ Macro
+ \begin{lstlisting}
+ \natun
+ \end{lstlisting}
+ as \textbf{natu}ral \textbf{n}umber leads to
+ \begin{equation*}
+ \natun
+ \end{equation*}
+
+ \subsubsection*{Natural number with zero included}
+ Macro
+ \begin{lstlisting}
+ \nnzero
+ \end{lstlisting}
+ as \textbf{n}atural \textbf{n}umber \textbf{zero} leads to
+ \begin{equation*}
+ \nnzero
+ \end{equation*}
+
+ \subsubsection*{Integers}
+ Macro
+ \begin{lstlisting}
+ \inte
+ \end{lstlisting}
+ as \textbf{inte}regers leads to
+ \begin{equation*}
+ \inte
+ \end{equation*}
+
+ \subsubsection*{Rational number}
+ Macro
+ \begin{lstlisting}
+ \ratin
+ \end{lstlisting}
+ as \textbf{rati}onal \textbf{n}umber leads to
+ \begin{equation*}
+ \ratin
+ \end{equation*}
+
+ \subsubsection*{Real number}
+ Macro
+ \begin{lstlisting}
+ \realn
+ \end{lstlisting}
+ as \textbf{real} \textbf{n}umber leads to
+ \begin{equation*}
+ \realn
+ \end{equation*}
+
+ \subsubsection*{Complex number}
+ Macro
+ \begin{lstlisting}
+ \compn
+ \end{lstlisting}
+ as \textbf{comp}ex \textbf{n}umber leads to
+ \begin{equation*}
+ \compn
+ \end{equation*}
+
+ \subsubsection*{Using in text}
+ All these macros can be used directly in text (thanks to the command \textit{ensuremath}). Therefore one can use this syntax
+ \begin{lstlisting}
+ Let $n$ be in \natun
+ \end{lstlisting}
+ which casts: Let $n$ be in \natun.
+
+ \subsection*{Derivative}
+ It is derived from \textit{physics} package. The manual is \href{http://mirrors.ctan.org/macros/latex/contrib/physics/physics.pdf}{here}.
+
+ \subsection*{Operator}
+ Partially derived from \textit{physics} package.
+
+ \subsubsection*{Gradient}
+ Macro
+ \begin{lstlisting}
+ \grad
+ \end{lstlisting}
+ as \textbf{grad}ient leads to
+ \begin{equation*}
+ \grad
+ \end{equation*}
+
+ \subsubsection*{Divergence}
+ Macro
+ \begin{lstlisting}
+ \div
+ \end{lstlisting}
+ as \textbf{div}ergence leads to
+ \begin{equation*}
+ \div
+ \end{equation*}
+
+ \noindent Derived from \textit{physics} package, the original meaning of this command as a maths symbol for dividing has alias
+ \begin{lstlisting}
+ \divisionsymbol
+ \end{lstlisting}
+ which cast
+ \begin{equation*}
+ \divisionsymbol
+ \end{equation*}
+
+ \subsubsection*{Rotation}
+ In English literature as \textbf{curl} operator has macro
+ \begin{lstlisting}
+ \rot
+ \end{lstlisting}
+ as \textbf{rot}ation and leads to
+ \begin{equation*}
+ \rot
+ \end{equation*}
+
+ \noindent One can also use \textit{physics} package command
+ \begin{lstlisting}
+ \curl
+ \end{lstlisting}
+
+ \subsubsection*{Laplacian}
+ Macro
+ \begin{lstlisting}
+ \lapl
+ \end{lstlisting}
+ as \textbf{lapl}acian leads to
+ \begin{equation*}
+ \lapl
+ \end{equation*}
+
+ \noindent One can also use \textit{physics} package notation
+ \begin{equation*}
+ \laplacian
+ \end{equation*}
+ which is cast by macro
+ \begin{lstlisting}
+ \laplacian
+ \end{lstlisting}
+
+ \section*{Degree}
+ Macro
+ \begin{lstlisting}
+ \degree
+ \end{lstlisting}
+ as \textbf{degree} leads to \degree. Can be used without math mode.
+
+ \section*{Physics unit}
+ \subsubsection*{Variable unit}
+ Macro
+ \begin{lstlisting}
+ \varun{m}{kg}
+ \end{lstlisting}
+ as \textbf{var}iable \textbf{un}it leads to
+ \begin{equation*}
+ \varun{m}{kg}
+ \end{equation*}
+
+ \noindent This macro can be used directly in text (thanks to the \textit{ensure} function). Therefore one can use
+ \begin{lstlisting}
+ where \varun{m}{kg} is the mass.
+ \end{lstlisting}
+ which casts: where \varun{m}{kg} is the mass.
+
+ \subsubsection*{Unit}
+ Macro
+ \begin{lstlisting}
+ m\unit{kg}
+ \end{lstlisting}
+ as \textbf{unit} leads to
+ \begin{equation*}
+ m\unit{kg}
+ \end{equation*}
+ This macro looks as
+ \begin{lstlisting}
+ \;\mathrm{kg}
+ \end{lstlisting}
+ the space before the roman characters is very important in science publications.
+
+ \subsection*{Expected value}
+ Macro
+ \begin{lstlisting}
+ \expv{x}
+ \end{lstlisting}
+ as \textbf{exp}ected \textbf{v}alue leads to
+ \begin{equation*}
+ \expv{x}
+ \end{equation*}
+
+ \section*{Shortcuts}
+ \subsubsection*{One half}
+ Macro
+ \begin{lstlisting}
+ \hlf
+ \end{lstlisting}
+ as \textbf{h}a\textbf{lf} leads to
+ \begin{equation*}
+ \hlf
+ \end{equation*}
+
+ \subsubsection*{One over }
+ Macro
+ \begin{lstlisting}
+ \oover{x}
+ \end{lstlisting}
+ as \textbf{o}ne \textbf{over} leads to
+ \begin{equation*}
+ \oover{x}
+ \end{equation*}
+
+ \section*{Spaces}
+ \subsubsection*{Horizontal space}
+ Macro
+ \begin{lstlisting}
+ \hem[width]
+ \end{lstlisting}
+ as \textbf{h}space\{\textbf{em}\} leads to horizontal space of specific width (multiples of em). Special case is 1em
+ \begin{lstlisting}
+ \mathrm{text}\hem\mathrm{text}
+ \end{lstlisting}
+ which leads to
+ \begin{equation*}
+ \mathrm{text}\hem\mathrm{text}
+ \end{equation*}
+ or shortcut form space with 2em width
+ \begin{lstlisting}
+ \mathrm{text}\htem\mathrm{text}
+ \end{lstlisting}
+ which casts
+ \begin{equation*}
+ \mathrm{text}\htem\mathrm{text}
+ \end{equation*}
+
+ \subsection*{Implies with em spaces}
+ Macro
+ \begin{lstlisting}
+ \impem
+ \end{lstlisting}
+ as \textbf{implies} with \textbf{em} spaces leads to
+ \begin{equation*}
+ \mathrm{text}\impem\mathrm{text}
+ \end{equation*}
+\end{document} \ No newline at end of file