useful custom macros for typesetting vector calculus in LaTeX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%typeset \sgn as an upright operator name, like \sin. ex: \sgn(x) | |
\DeclareMathOperator{\sgn}{sgn} | |
%rename built-in command \v to \vaccent, to make room for... | |
\let\vaccent=\v | |
% ...\v, which typesets a bold, upright vector. ex: \v a | |
\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} | |
% ... and \gv, which does the same for greek letters. ex: \gv\alpha | |
\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath $ #1 $ }}} | |
%absolute value function with | brackets. ex: \abs{x}, \abs{\frac{1}{2}} | |
\newcommand{\abs}[1]{\left| #1 \right|} | |
% rename builtinin command \d to \underdot, to make room for... | |
\let\underdot=\d | |
% ...\d, which typesets a derivative. ex: \d{y}{x}, instead of \frac{dx}{dy}. | |
\renewcommand{\d}[2]{\frac{d #1}{d #2}} | |
% ...similar for double-derivatives. ex: \dd{y}{x}. | |
\newcommand{\dd}[2]{\frac{d^2 #1}{d #2^2}} | |
% ...similar for partial derivatives. ex: \pd{y}{x}. | |
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} | |
% ...similar for partial double derivatives. ex: \pdd{y}{x}. | |
\newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}} | |
% a \degrees symbol. ex: 90\degrees. | |
\newcommand{\degrees}{\ensuremath{^\circ}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment