Math & Sciencedifferent norm symbols

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
dnemoc
Posts: 19
Joined: Mon May 11, 2009 2:29 pm

different norm symbols

Post by dnemoc »

Hi!

Occasionally one needs multiple norm symbols in a math document. I was wondering about the correct way to define a norm of the type

Code: Select all

$||| v |||$
in addition to

Code: Select all

$\lVert v \rVert$
I've looked at the comprehensive symbol list, and there are pre-defined symbols for this in mathabx package (I think). However, mathabx conflicts with quite a few other packages which are indispensable. Is there a correct way to do this in simple LaTeX, respecting all spacing and scaling?

Best regards, and thanks a lot in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

different norm symbols

Post by frabjous »

What conflicts are you getting for mathabx? There may be a way around them by loading packages in a different order. A minimal working example might help us diagnose the issue.

If you want a different approach, the following definitions seem to yield results very similar to \vvvert from mathabx.

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\newcommand{\mynegspace}{\hspace{-0.12em}}
\newcommand{\lvvvert}{\rvert\mynegspace\rvert\mynegspace\rvert}
\newcommand{\rvvvert}{\rvert\mynegspace\rvert\mynegspace\rvert}
\begin{document}

$\lvvvert b \rvvvert$
\end{document}
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

different norm symbols

Post by svend_tveskaeg »

One can make frabjous' code marginally easier to use, I think, but not `better' in any way. The package mathtools gives the command \DeclarePairedDelimiter (see page 22 in the manual).

Code: Select all

\documentclass{article}

\usepackage{mathtools}

\newcommand{\mynegspace}{\hspace{-0.12em}}
\newcommand{\lvvvert}{\rvert\mynegspace\rvert\mynegspace\rvert}
\newcommand{\rvvvert}{\rvert\mynegspace\rvert\mynegspace\rvert}
\DeclarePairedDelimiter{\vvvert}{\lvvvert}{\rvvvert}

\begin{document}

$\vvvert{b}$

\end{document}
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
dnemoc
Posts: 19
Joined: Mon May 11, 2009 2:29 pm

different norm symbols

Post by dnemoc »

Thank you both for the tips. I shall put an apology up: I was using the package nath, not mathabx as I mentioned before. I'm putting a bit of code below:

Code: Select all

\usepackage[urw-garamond, greekuppercase=upright, greeklowercase=italicized, sfscaled=true, ttscaled=true]{mathdesign}
\usepackage{pbsi}
\usepackage[perpage, splitrule]{footmisc}
\usepackage[all, cmtip]{xy}
\usepackage{nath}

\usepackage{amsmath, wrapfig, enumitem, graphicx}
\usepackage[usenames, dvipsnames]{color}
\usepackage{mathtools, amscd}
\usepackage[square, sort&compress, authoryear]{natbib}
Now, whenever I try to compile whatever document with these in the preamble, I get fatal errors.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

different norm symbols

Post by frabjous »

When I load those packages in that order, I get errors too, but I don't get errors if I load them in the following order (--I don't think I left any out!--):

Code: Select all

\documentclass{article}

\usepackage{amsmath} 
\usepackage[urw-garamond, greekuppercase=upright, greeklowercase=italicized, sfscaled=true, ttscaled=true]{mathdesign}
\usepackage[usenames, dvipsnames]{color}
\usepackage{pbsi}
\usepackage[perpage, splitrule]{footmisc}
\usepackage[all, cmtip]{xy}
\usepackage{wrapfig} 
\usepackage{enumitem} 
\usepackage{graphicx}
\usepackage{mathtools} 
\usepackage{nath}
\usepackage{amscd}
\usepackage[square, sort&compress, authoryear]{natbib}

\begin{document}
Hello world. 
\end{document}
dnemoc
Posts: 19
Joined: Mon May 11, 2009 2:29 pm

different norm symbols

Post by dnemoc »

Thanks a lot for spending time with this code. I still get errors with this order of packages, in particular, with the set of integers defined as

Code: Select all

\newcommand{\Z}{\mathbb{Z}}
This definition is fairly common I guess...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

different norm symbols

Post by frabjous »

Could you give a minimal working example showing the error. I do not get any errors with:

Code: Select all

\documentclass{article}

\usepackage{amsmath}
\usepackage[urw-garamond, greekuppercase=upright, greeklowercase=italicized, sfscaled=true, ttscaled=true]{mathdesign}
\usepackage[usenames, dvipsnames]{color}
\usepackage{pbsi}
\usepackage[perpage, splitrule]{footmisc}
\usepackage[all, cmtip]{xy}
\usepackage{wrapfig}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{nath}
\usepackage{amscd}
\usepackage[square, sort&compress, authoryear]{natbib}

\newcommand{\Z}{\mathbb{Z}}

\begin{document}
Hello world. $\Z$
\end{document}
Post Reply