43

It is well-known \big\mid throws an error. But why is it so? As far as I know, \mid is equivalent to \mathrel|, while \lvert and \rvert are equivalent to \mathopen| and \mathclose|, respectively --- just like \vert is equivalent to |. And \lvert,\rvert, do work with both \big, \bigl and \bigr. So by symmetry, I think it would make sense that \mid worked with \big,\bigm etc. as well.

MWE:

\documentclass{article}

\begin{document}
$\bigl\rvert ... \bigr\lvert$ works fine.

$\big\mid$ does not.
\end{document}

Note that I am not looking for a solution to printing a taller \mid; I know I could just use \big| or \bigm|. I'm just curious.

4
  • Yes, I do, but why? It works with \lvert...\rvert, and by symmetry, it ought to work with \mid, too.
    – Gaussler
    Apr 18, 2015 at 10:16
  • I'm afraid I have no special insights into DEK's linguistic and semantic preferences... BTW, \big| and \bigm| do not produce the same output.
    – Mico
    Apr 18, 2015 at 10:20
  • Indeed, I know that, but thanks for pointing it out if it wasn't clear enough from the question. :-)
    – Gaussler
    Apr 18, 2015 at 10:22
  • 8
    \big must be followed by a delimiter; \mid is not a delimiter, but a relation symbol.
    – egreg
    Apr 18, 2015 at 10:31

2 Answers 2

24
  • The commands \bigl\vert, \bigm\vert, and \bigr\vert are semantically symmetric. Incidentally, the triplets of commands \bigl\lvert \bigl\vert \big\lvert and \bigr\rvert \bigr\vert \big\rvert, respectively, produce the same output.

  • It's the command \mid that's a bit of an outlier, semantically speaking. As @egreg has noted in a comment, \mid is constructed as a relation symbol and is not set up to take a size-modifying prefix.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\dots\ $\bigl\lvert \ldots \bigm| \ldots \bigr\rvert$ \dots\ works fine.

\dots\ $\bigl\vert \ldots \bigm\vert \ldots \bigr\vert$ \dots\ works just the same.

\dots\ $\bigl\vert \ldots \big| \ldots \bigr\vert$ \dots\ works too, but it isn't the same.

\end{document}
2
  • Once you use any of \big or \bigx, it doesn't matter whether you use \lvert or \vert -- the category code doesn't matter since the \big commands change it anyways. See $+ \bigl\lvert - x$ vs $+ \big\lvert - x$.
    – yo'
    Apr 18, 2015 at 10:44
  • @yo' - I put in that sentence as an indirect commentary on the code snippets \bigl\rvert and \bigr\lvert in the original posting. I wasn't quite sure what to make of them...
    – Mico
    Apr 18, 2015 at 10:50
13

Using \big is generally wrong, because it produces an ordinary atom. So one has better using \bigl for opening fences, \bigr for closing and \bigm for relations.

The definition of \bigX ultimately does \big anyway, but first adding the correct type. And \big<token> simply does

\left<token>

so we must ensure that the argument to \bigX is a delimiter, which \mid isn't.

One could, in principle, lift off this limitation for relations that we know are built upon a delimiter:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\let\amsmath@bigm\bigm

\renewcommand{\bigm}[1]{%
  \ifcsname fenced@\string#1\endcsname
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
  {\expandafter\amsmath@bigm\csname fenced@\string#1\endcsname}%
  {\amsmath@bigm#1}%
}

\newcommand{\DeclareFence}[2]{\@namedef{fenced@\string#1}{#2}}
\makeatother

\DeclareFence{\mid}{|}

\begin{document}

$\bigl\{\, x\in X \bigm\mid x\notin X \,\bigr\}$

\smallskip

$\bigl\{\, x\in X \bigm| x\notin X \,\bigr\}$

\end{document}

This is just a proof of concept, so I didn't attempt a generalization to \bigm siblings \Bigm, \biggm and \Biggm.

enter image description here

2
  • What do you mean by "And \big<token> simply does \left<token>". Isn't \left a completely different command, whose use is restricted to \left...\right constructions?
    – Gaussler
    Apr 18, 2015 at 10:59
  • 2
    @Gaussler Any \bigX like command eventually places the argument after \left, for constructing the bigger fence.
    – egreg
    Apr 18, 2015 at 11:03

You must log in to answer this question.

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