Quantcast
Channel: Active questions tagged mathtools - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 122

Superscripts too high after macros defined with \DeclarePairedDelimiter

$
0
0

I have a macro for absolute value (using \DeclarePairedDelimiter from mathtools):

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}

This works great in terms of adjusting the size of fences etc. But the superscript position when I use \abs{x}^2 is too high. See the following:

PDF output

Any idea if this is a bug or not, or how I can fix it?Edit: It appears that the above behavior due to the fact that DeclarePairedDelimiter calls \mathclose / makes a subformula. I don't know if this was a design choice or not -- but I would certainly like to know if there is an easy way to work around it.

Here's my code for the above.

\documentclass{minimal}\usepackage[active,tightpage]{preview}\usepackage{varwidth,mathtools}\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}\begin{document}  \begin{preview}\begin{varwidth}{360pt}    The superscript following \verb'\abs{x}' is higher than that following \verb'\lvert x\rvert'.    Here is an example:    \begin{center}      \verb'\abs{x}^2 \lvert x\rvert^2' produces $\abs{x}^2 \lvert x\rvert^2$.    \end{center}    The same happens in displayed math:    \begin{equation*}      \abs{x}^2 \lvert x\rvert^2    \end{equation*}  \end{varwidth}\end{preview}\end{document}

Thanks in advance.


Viewing all articles
Browse latest Browse all 122

Trending Articles



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