Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by egreg for New math command with alternative definition for inline mode

I don't think you really wants this. However, here it is:

\documentclass{article}\usepackage{amsmath}\newcommand{\xnorm}[1]{%  \mathchoice{\Bigl\|#1\Bigr\|}{\lVert#1\rVert}{\lVert#1\rVert}{\lVert#1\rVert}%}\begin{document}A norm in text mode is $\xnorm{v}$, while in display math it is\[\xnorm{v}=\sum_{i=1}^n\lvert v_i\rvert\]\end{document}

The result is really ugly (and wrong):

Image may be NSFW.
Clik here to view.
enter image description here

If you change \Bigl and \Bigr with \bigl and \bigr you get a more acceptable result, but I can't see the point of increasing the fences' size.

Image may be NSFW.
Clik here to view.
enter image description here


Viewing all articles
Browse latest Browse all 2

Trending Articles