Child pages
  • Commands based on variable size delimiters
Skip to end of metadata
Go to start of metadata

OK, check this.

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:

This looks like this:

This is super-cute and I think it is my favourite thing I've written.

  • No labels