##### Child pages
• Commands based on variable size delimiters
Go to start of banner

# Commands based on variable size delimiters

This makes a macro \newvarcmd which you can use to create one-argument macros:
If you write \abs{x}, you will just get \lvert x \rvert, which is how you'd typeset the absolute value of x. But if x is bigger, you can use an optional argument and write \abs[big]{x}, say, and you will get \bigl\lvert x \bigr\rvert, which is just what you'd want to write... You can use this with any of the amslatex sizes. And if you're not sure how big the thing to typeset is going to be, you can write \abs[var]{x}, which will give you \left\lvert x \right\rvert. Demo: