Quantcast
Channel: Active questions tagged starred-version - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 63

Swap star and non-star versions of DeclarePairedDelimiter without breaking other parameters

$
0
0

I use \DeclarePairedDelimiter from the mathtools package a lot, and I almost always want the delimiters to be automatically resized. Therefore, I switch the definitions of the star and non-star versions of the command as described in this question. The problem is that doing that completely destroys the optional size parameter:

Here's a MWE:

\documentclass{article}\usepackage{amsmath}\usepackage{mathtools}\DeclarePairedDelimiter\abs{\lvert}{\rvert}\makeatletter\let\oldabs\abs\def\abs{\@ifstar{\oldabs}{\oldabs*}}\makeatother\begin{document}\[ \abs{\frac{1}{x}} \quad \abs*{\frac{1}{x}} \quad \abs[\Bigg]{\frac{1}{x}} \]\end{document}

Is there a way to swap the star and non-star definitions without breaking the size parameter?


Viewing all articles
Browse latest Browse all 63

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>