[Tex/LaTex] thick vertical line symbol for norm of vector

delimiters

Some old text books use single thick vertical lines for writing norms of vectors. I would like to define a pair of delimiters which behaves like \lvert and \rvert, but with thicker lines. The new delimiters should of course adapt to the size of the formula, just like \lvert and \rvert do. Can this be done?

Best Answer

There is an extensible delimiter called \bracevert, but it needs some coaxing:

\documentclass{article}
\usepackage{mathtools,xparse}

\DeclarePairedDelimiter{\oldnormaux}{\bracevert}{\bracevert}

\NewDocumentCommand{\oldnorm}{som}{%
  \IfBooleanTF{#1}
    {\oldnormaux*{#3}}
    {\IfNoValueTF{#2}
       {\oldnormaux*{\vphantom{dq}#3}}
       {\oldnormaux[#2]{#3}}%
    }%
}

\begin{document}

$\oldnorm{v}\oldnorm[\big]{v}\oldnorm[\Big]{v}\oldnorm*{\dfrac{1}{2}v}$

\end{document}

See the documentation of mathtools for \DeclarePairedDelimiter, with respect to the syntax; our \oldnorm command works the same.

enter image description here

A more complex solution which also takes care of the spacing; the example also compares it with the standard \Vert symbols.

\documentclass{article}
\usepackage{amsmath,xparse}

\NewDocumentCommand{\oldnorm}{sO{}m}{%
  {\IfBooleanTF{#1}
    {\oldnormaux{\left|}{\right|}{#3}}
    {\oldnormaux{#2|}{#2|}{#3}}}
}
\makeatletter
\newcommand{\oldnormaux}[3]{\mathpalette\oldnormaux@i{{#1}{#2}{#3}}}
\newcommand{\oldnormaux@i}[2]{\oldnormaux@ii#1#2}
\newcommand{\oldnormaux@ii}[4]{%
  \sbox\z@{$\m@th#1#2#4#3$}%
  \sbox\tw@{$\m@th\|$}%
  \mathopen{\hbox to\wd\tw@{\hss\vrule height \ht\z@ depth \dp\z@ width .3\wd\tw@\hss}}%
  #4
  \mathclose{\hbox to\wd\tw@{\hss\vrule height \ht\z@ depth \dp\z@ width .3\wd\tw@\hss}}%
}
\makeatother
\begin{document}

$\oldnorm{v}\oldnorm[\big]{v}\oldnorm[\Big]{v}\oldnorm*{\dfrac{1}{2}v}^2$

$|\oldnorm{x}|$

$|\lVert x\rVert|$

$\oldnorm*{\dfrac{1}{2}v}^2 \left\lVert\dfrac{1}{2}v\right\rVert^2$

$x_{\oldnorm{v}}$ $x_{\lVert v\rVert}$
\end{document}

enter image description here