summaryrefslogtreecommitdiff
path: root/macros.sty
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--macros.sty58
1 files changed, 58 insertions, 0 deletions
diff --git a/macros.sty b/macros.sty
new file mode 100644
index 0000000..5cc98b9
--- /dev/null
+++ b/macros.sty
@@ -0,0 +1,58 @@
+% Horizontal rule.
+\newcommand{\hr}{\noindent\rule[0.5ex]{\linewidth}{0.5pt}}
+
+% Ensure upright text in math events.
+\NewCommandCopy{\vartext}{\text}
+\renewcommand{\text}[1]{\vartext{\textnormal{#1}}}
+
+% Upright type for Euler's number and imaginary number.
+\newcommand{\e}{\ensuremath{\mathrm{e}}}
+\renewcommand{\i}{\ensuremath{\mathrm{i}}}
+\renewcommand{\j}{\ensuremath{\mathrm{j}}}
+
+% Use bold for vectors.
+\renewcommand{\vec}{\symbf}
+
+% Use blackboard bold.
+\let\mathbb\relax
+\DeclareMathAlphabet{\mathbb}{U}{msb}{m}{n}
+\newcommand{\N}{\ensuremath{\mathbb{N}}}
+\newcommand{\Z}{\ensuremath{\mathbb{Z}}}
+\newcommand{\Q}{\ensuremath{\mathbb{Q}}}
+\newcommand{\R}{\ensuremath{\mathbb{R}}}
+\newcommand{\C}{\ensuremath{\mathbb{C}}}
+
+% Does not exist.
+\newcommand{\DNE}{\ensuremath{\text{DNE}}}
+
+% Trigonometric and hyperbolic functions.
+\DeclareMathOperator{\sech}{sech}
+\DeclareMathOperator{\csch}{csch}
+\DeclareMathOperator{\arccot}{arccot}
+\DeclareMathOperator{\arcsec}{arcsec}
+\DeclareMathOperator{\arccsc}{arccsc}
+\DeclareMathOperator{\arsinh}{arsinh}
+\DeclareMathOperator{\arcosh}{arcosh}
+\DeclareMathOperator{\artanh}{artanh}
+\DeclareMathOperator{\arcoth}{arcoth}
+\DeclareMathOperator{\arsech}{arsech}
+\DeclareMathOperator{\arcsch}{arcsch}
+
+\makeatletter
+\let\@epsilon\epsilon
+\let\@theta\theta
+\let\@phi\phi
+\AtBeginDocument{
+ \RenewCommandCopy{\angle}{\measuredangle}
+
+ \RenewCommandCopy{\epsilon}{\varepsilon}
+ \RenewCommandCopy{\varepsilon}{\@epsilon}
+ \RenewCommandCopy{\theta}{\vartheta}
+ \RenewCommandCopy{\vartheta}{\@theta}
+ \RenewCommandCopy{\phi}{\varphi}
+ \RenewCommandCopy{\varepsilon}{\@epsilon}
+ \undef\@epsilon
+ \undef\@theta
+ \undef\@phi
+}
+\makeatother