# Absolute Value Symbols in LyX

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!

• The standard LaTeX way would be to use \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} using the macro from mathtools as described in tex.stackexchange.com/q/1742/15925. Usable as \abs[\big]{X^Y} and \abs*{\frac{A}{X^2+Y^2}}. – Andrew Swann Mar 23 at 15:51
• I've tried putting this line \DeclarePairedDelimiter\abs{\lvert}{\rvert} in Document->Settings...->LaTeX Preamble, but I didn't notice any change. The \abs command is still not available. Is this the right place where it should be added? – Izo Sakallah Mar 23 at 16:41
• I don't think adding a latex command to the preamble makes LyX generate an interface for it. You'll need to input it as direct latex code in order to use it – daleif Mar 23 at 17:37
• Are any errors reported? – Andrew Swann Mar 24 at 16:57