Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to create a norm-like operator with 3 verticals bars instead of two. It has to look like $|||\cdot|||$. I would like to know how to decrease the spacing between the vertical bars such that it has the same spacing as the $\lVert .. \rVert$ command.

There is a command available in the stmaryrd package called \biginterleave, but this command has to much spacing between the vertical bars, especially in display math mode.

Is there some work-around to adjust the spacing between to vertical bars?

share|improve this question
add comment

4 Answers 4

Here's a solution that doesn't require the use of additional packages. The new command, \vertiii, takes one argument; the triple vertical bars resize automatically depending on the size of the argument. For the MWE below, I've actually set the spacing between the vertical bars to be slightly less than what's generated by \[l,r]Vert -- you can adjust the spacing to suit your taste by changing the value of the argument of the four \kern commands.

Addendum: I've modified the code -- by inserting curly braces around the entire command -- to allow for the use of the command \vertiii in subscripts and superscripts as well.

\documentclass{article}
\usepackage{amsmath,amssymb}
\newcommand{\vertiii}[1]{{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert #1 
    \right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}
\begin{document}
$\vertiii{a}$, 
$\vertiii{\int_0^1 a(x)\,\mathrm{d}x}$,
$\displaystyle \vertiii{\int_0^1 a(x)\,\mathrm{d}x}_\vertiii{b}$

$\lVert a \rVert$ (for comparison)

$c_\vertiii{d}$, $f^\vertiii{g}$
\end{document}

enter image description here

share|improve this answer
    
Thank you for your solution –  AliG May 4 '12 at 13:26
    
I've added a better image; however some artifact are unavoidable, unless a very large resolution is used. What are you using for conversion from PDF to PNG? –  egreg May 4 '12 at 13:38
    
Thanks, @egreg! I use Acrobat 9.5 to save the file in png format. Is there a better converter I should be considering? –  Mico May 4 '12 at 14:11
    
I always use ImageMagick's convert, with parameters -density 300 -quality 90 (as does the standalone class). You should at least activate antialiasing. –  egreg May 4 '12 at 14:13
    
@egreg - thanks, I will adopt your method from now on. –  Mico May 4 '12 at 14:28
show 1 more comment

A solution modelled on Mico's, but that allows also for use in subscripts and superscripts. Using \mkern-1.5mu seems better; this should be adjusted if other base fonts are used, comparing to what \| produces.

The syntax is similar to the one used by mathtools for "fenced" symbols:

\opnorm{a}        % normal size
\opnorm[\big]{a}  % slightly larger
\opnorm[\Bigg]{a} % largest
\opnorm*{a}       % \left and \right

Here's the example.

\documentclass{article}
\usepackage{amsmath,amssymb}
\makeatletter
\newcommand{\opnorm}{\@ifstar\@opnorms\@opnorm}
\newcommand{\@opnorms}[1]{%
  \left|\mkern-1.5mu\left|\mkern-1.5mu\left|
   #1
  \right|\mkern-1.5mu\right|\mkern-1.5mu\right|
}
\newcommand{\@opnorm}[2][]{%
  \mathopen{#1|\mkern-1.5mu#1|\mkern-1.5mu#1|}
  #2
  \mathclose{#1|\mkern-1.5mu#1|\mkern-1.5mu#1|}
}
\makeatother

\begin{document}

$\opnorm{a}$,
$\opnorm[\Big]{\int_0^1 a(x)\,\mathrm{d}x}$,
$\displaystyle \opnorm*{\int_0^1 a(x)\,\mathrm{d}x}_{\opnorm{a}}$

$\lVert a \rVert$ (for comparison)

\end{document}

enter image description here

share|improve this answer
add comment

The fourier package provides such a symbol, called \VERT. However, \usepackage{fourier} will change the font throughout your document. You can access just this one symbol by adding its definition (taken from fourier.sty) to your preamble.

enter image description here

\documentclass{article}
\DeclareFontEncoding{FMS}{}{}
\DeclareFontSubstitution{FMS}{futm}{m}{n}
\DeclareFontEncoding{FMX}{}{}
\DeclareFontSubstitution{FMX}{futm}{m}{n}
\DeclareSymbolFont{fouriersymbols}{FMS}{futm}{m}{n}
\DeclareSymbolFont{fourierlargesymbols}{FMX}{futm}{m}{n}
\DeclareMathDelimiter{\VERT}{\mathord}{fouriersymbols}{152}{fourierlargesymbols}{147}
\begin{document}
The quick brown fox jumps over the lazy dog.
\[ 
\VERT x \VERT \quad \left\VERT\frac{1}{2}\right\VERT 
\]
\end{document}
share|improve this answer
    
Thank you for your help –  AliG May 4 '12 at 13:26
add comment

A solution using \vvvert of package mathabx. The symbol can also be used with \left and \right. Since the package changes many math symbols, the following example only defines \vvvert and the symbol fonts, needed for it without changing other math symbols:

\documentclass{article}
%\usepackage{mathabx}

% Math symbol font matha
\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
\DeclareFontShape{U}{matha}{m}{n}{
      <5> <6> <7> <8> <9> <10> gen * matha
      <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12
      }{}
\DeclareSymbolFont{matha}{U}{matha}{m}{n}
\DeclareFontSubstitution{U}{matha}{m}{n}

% Math symbol font mathb
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
      <5> <6> <7> <8> <9> <10>
      <10.95> <12> <14.4> <17.28> <20.74> <24.88>
      mathx10
      }{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}

% Symbol definition
\DeclareMathDelimiter{\vvvert}{0}{matha}{"7E}{mathx}{"17}

\begin{document}
\[
  \left\vvvert \frac{A}{B}\right\vvvert
\]
\end{document}

Result

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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