5

In MathJax, I had occasion to write this:

\Big\| \Big( \,\underbrace{0,\ldots,0}_n, \frac 1 {n+1}, \frac 1 {n+2}, 
\frac 1 {n+3}, \ldots \Big) \Big\|

I used \Big instead of \left and \right|. If I had done the latter, the delimiters would have taken into account the vertical space resulting from the underbrace and the subscript to the underbrace. But I wanted them to be the same size they would be if the underbrace had not been there. Is there some standard way, in LaTeX and in MathJax, or two standard ways -- one for LaTeX and one for MathJax -- to do that?

  • Since you already got an answer, let me mention that \bigl/\bigr are usually better choices than \big (tex.stackexchange.com/q/19480/35864, tex.stackexchange.com/q/1232/35864). Some people prefer the manual size over the automatic \left/\right because the automatic sizes can be too small or too large in certain cases. All of this holds for TeX/LaTeX, there are subtle differences between TeX and MathJax and I don't know whether this are is one. – moewe Jun 9 '18 at 13:42
10

To hide the depth of the \underbrace, use \smash on it.

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}

\[
\left\| \left(\smash{\underbrace{0,\dots,0}_n}, \frac 1 {n+1}, \frac 1 {n+2}, \frac 1 {n+3}, \dots \right)\right\|
\]

\end{document}

enter image description here

| improve this answer | |
10

You also can use \smash[b] with an optional argument, in case you want to take into account the height of the upper part. I suggest simplifying the code introducing the \norm command with \DeclarePairedDelimiter from mathtools: it defines a star version which adds a pair of implicit \left ...\right in front of the delimiters. The non-star version accepts as an optional argument one of \big, \Big, \bigg and \Bigg, which adds an implicit \bigl ... \bigr, &c.

Note that, adding in your code a pair of size commands for delimiters, you should always use a pair of \bigl... \bigr, not \big ... \big, to ensure a proper horizontal spacing.

\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\norm}\|\|

\begin{document}

\begin{gather*}
 \norm*{\Bigl( \,\smash[b]{\underbrace{0,\ldots,0}_n}, \frac 1 {n+1}, \frac 1 {n+2}, \frac 1 {n+3}, \ldots \Bigr)}\\[1.5ex]
 \norm[\Big]{\Bigl( \,\smash[b]{\underbrace{0,\ldots,0}_n}, \frac 1 {n+1}, \frac 1 {n+2}, \frac 1 {n+3}, \ldots \Bigr)} \\[1.5ex]
 \norm[\bigg]{\Bigl( \,\smash[b]{\underbrace{0,\ldots,0}_n}, \frac 1 {n+1}, \frac 1 {n+2}, \frac 1 {n+3}, \ldots \Bigr)}
 \end{gather*}

\end{document} 

enter image description here

| improve this answer | |
1

An improved solution (from https://tex.stackexchange.com/a/503602/128042) that has correct spacing and works under more general conditions:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{hyperref}
\DeclarePairedDelimiter{\norm}{\|}{\|_{\href{https://de.wikipedia.org/wiki/Euklidische_Norm\#\%E2\%84\%932-Norm}{\ell_2(\mathbb{R}^2)}}}
\begin{document}
Here could be text. 
\[
\norm*{\left(2,\smash[b]{\underbrace{\frac{5}{3}}_{\mathclap{\approx 1.66666667}}} \right)}
\vphantom{\underbrace{\frac{5}{3}}_{\approx 1.66666667}}
\]
Here could be more text and this text has the correct distance to the line above, because of the vphantom outside of the delimiters.

\end{document}

compiled result

\mathclap avoids horizontal adjustment of the delimiters. \vphantom avoids an incorrect spacing (in the worst case overlapping) with the next line.

A short description of \DeclarePairedDelimiter can be found here: Easily change behavior of \DeclarePairedDelimiter

A detailed description of \smash[b] here: https://tex.stackexchange.com/a/424204/128042

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.