I've been looking for a way to use the \abs command in LyX (Version 2.3.0, using MikTex) but unfortunately I didn't find a solution.
For a reason I'm not aware of, this command does not appear as an option in a math box. I tried defining it as a macro:
with \lvert and \rvert, which is ok except for the fact that it doesn't scale. I read that there is something called a "starred" version of a command, which should solve the scaling problem ,but I didn't manage to define the macro as such.
Would appreciate any help!


\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}using the macro frommathtoolsas described in https://tex.stackexchange.com/q/1742/15925. Usable as\abs[\big]{X^Y}and\abs*{\frac{A}{X^2+Y^2}}. – Andrew Swann Mar 23 '19 at 15:51