I have the command:

  {\lVert #2 \rVert}%
  {\lVert #2 \rVert}_{#1}%

and I want to switch to using \DeclaredPairedDelimiter or one of its variants. But - it seems those do not allow for defining commands with optional arguments.

What am I missing? Or - how should I do this?

  • The code you want to be optional can be added using _{foo}, I don't see why you would need that with \DeclarePairedDelimiter.
    – Skillmon
    Jul 25, 2017 at 15:32
  • 2
    @Skillmon: I just want to be able to say \norm[\infty]{\phi}. Perfectly reasonable desire IMHO.
    – einpoklum
    Jul 25, 2017 at 16:17

1 Answer 1


Here is a solution: a \mynorm with two optional arguments and one mandatory: the first optional argument may be *(appended to the name of the command) or [\big] or [\Big], &c. The second optional argument is the subscript, in its ‘natural’ position (after the mandatory argument).

However, I suggest another construction with \DeclarePairedDelimiterXPP for the standard norm, so you don't have to type the subscript. I give commands for the 1-norm, the 2-norm the p-norm and the sup-norm.

\usepackage{xparse, etoolbox}





$\mynorm{\dfrac XY}[2]\qquad\mynorm*{\dfrac XY}[2]$\bigskip


$ \supnorm{f + g} \le \supnorm{f} + \supnorm{g}$\bigskip

$\displaystyle\pnorm{f} = \biggl(\int_0^1 f(t)\dd t \biggr)^{\!\!\frac{1}{p}}$


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .