Last active
August 29, 2015 14:06
-
-
Save deiga/cd039e657e924015f1e8 to your computer and use it in GitHub Desktop.
LaTeX absolute value shortcut
This file contains hidden or 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
% Absolute value | |
% http://tex.stackexchange.com/a/43009/62694 | |
\DeclarePairedDelimiter\abs{\lvert}{\rvert}% | |
\DeclarePairedDelimiter\norm{\lVert}{\rVert}% | |
% Swap the definition of \abs* and \norm*, so that \abs | |
% and \norm resizes the size of the brackets, and the | |
% starred version does not. | |
\makeatletter | |
\let\oldabs\abs | |
\def\abs{\@ifstar{\oldabs}{\oldabs*}} | |
% | |
\let\oldnorm\norm | |
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}} | |
\makeatother |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment