\documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiter\abs{\lvert}{\rvert} \begin{document} $\abs{-x} = x$ \end{document}