As egreg commented, for this specific case you could also use the optional parameter to the commands declared with DeclarePairedDelimiter
and specify the size:
\abs[\Big]{x-\abs[\big]{x-\abs{x-4}}}

Note:
- The
\left|
, \right|
pair only resize when there is content in between that has different vertical height. In your case, the content all had the same vertical size and hence no resizing took place.
As an alternate, which might be useful in other cases (but does require more work), you could insert a \vphantom{<content with larger vertical size>}
.
Here is a solution that inserts a different \vphatom{}
between the pairs of \abs
to yield:
Notes:
- As declared below with
DeclarePairedDelimiter
, you need to use \abs*{}
if you want the delimiter resized based on the vertical size of the content.
- You can tweak the content of the
\VPhamtomL
(large), and \VPhantomM
(medium), to control the size of the delimiter.
Code:
\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\begin{document}
You can use the optional paramater to \verb|\abs|:
\[
\abs[\Big]{x-\abs[\big]{x-\abs{x-4}}}
\]
With inline math $\abs[\Big]{x-\abs[\big]{x-\abs{x-4}}}$.
%------------------
\newcommand{\VPhantomL}{\vphantom{x^{2^2}}}%
\newcommand{\VPhantomM}{\vphantom{x^{2}}}%
%
or you can insert a \verb|\vphantom{}|
\[
\abs*{\VPhantomL x-\abs*{\VPhantomM x-\abs{x-4}}}
\]
With inline math $\abs*{\VPhantomL x-\abs*{\VPhantomM x-\abs{x-4}}}$.
\end{document}
\DoMoreSitups
as an answer. – Scribblemacher Jun 8 '12 at 19:36