# Special commands for absolute value and norm

Normally in LaTeX I find it very annoying to read and edit paired delimiters such as \lvert x \rvert, so I would \usepackage{physics} that provides \abs and \norm or write my own such as with \DeclarePairedDelimiter\abs{\lvert}{\rvert}, so I can write the much nicer \abs{x} and \norm{x}. The only way I've found to get this to work with MathJax is by inserting \newcommand{\abs}[1]{\lvert #1 \rvert} somewhere in math mode. Can special macros be defined globally for these commonly used delimiters?

(While we're at it, add \DeclareMathOperator{\E}{E} and \DeclareMathOperator{\Var}{Var} for probability use.)

• – TheSimpliFire Mod
Nov 3 at 17:34
• if you have some program that can do text-replacement when you type a keyword (this is a built in feature of Mac OS) / or a permanent clipboard (there exist commercial solutions), you can prepare a preamble that should be somewhat convenient to use Nov 4 at 9:38

This is not possible as the physics package is not supported; \newcommand (or \def) is the best there is. See $$\rm\TeX$$ Commands available in MathJax.

Note there are alternatives like \left| \right| and \left\| \right\| for absolute value and norm respectively. In general, I'd normally avoid declaring an operator using only one character.