[Tex/LaTex] Absolute Value Symbols


What is the "best LaTeX practices" for writing absolute value symbols? Are there any packages which provide good methods?

Some options include |x| and \mid x \mid, but I'm not sure which is best…

Best Answer

I have been using the code below using \DeclarePairedDelimiter from the mathtools package.

Since I don't think I have a case where I don't want this to scale based on the parameter, I make use of Swap definition of starred and non-starred command so that the normal use will automatically scale, and the starred version won't:

enter image description here

If you want it the other way around comment out the code between \makeatother...\makeatletter.



% Swap the definition of \abs* and \norm*, so that \abs
% and \norm resizes the size of the brackets, and the 
% starred version does not.

    \[\abs{\Value}  \quad \norm{\Value}  \qquad\text{non-starred}  \]
    \[\abs*{\Value} \quad \norm*{\Value} \qquad\text{starred}\qquad\]
Related Question