1
$\begingroup$

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.)

$\endgroup$
2
  • $\begingroup$ Related: math.meta.stackexchange.com/a/19145/471884. $\endgroup$
    – TheSimpliFire Mod
    Nov 3, 2021 at 17:34
  • $\begingroup$ 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 $\endgroup$ Nov 4, 2021 at 9:38

1 Answer 1

5
$\begingroup$

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.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .