\mid, | (vertical bar), \vert, \lvert, \rvert, \divides

According to texdoc symbols:

\mvert and \mid are identical and produce a relation. \vert is a synonym for | and both produce the same symbol, but should be used in the context of an ordinal, and should be used as an operator, not as a delimiter (p54, bottom). \divides once again produces the same symbol but should be used as a binary “divides” operator.

\lvert and \rvert are left and right delimiters, respectively.


This is similar in spirit to qbi's answer. Let me quote from the guide to the amsmath package (the document known as amsldoc), section 4.14.2 Vertical bar notations:

The amsmath package provides commands \lvert, \rvert, \lVert, \rVert (compare \langle, \rangle) to address the problem of overloading for the vert bar character |. This character is currently used in LaTeX documents to represent a wide variety of mathematical objects [...]. The multiplicity of uses in itself is not so bad; what is bad, however, is that fact that not all of the uses take the same typographical treatment, and that the complex discriminatory powers of a knowledgeable reader cannot be replicated in computer processing of mathematical documents. It is recommended therefore that there should be a one-to-one correspondence in any given document between the vert bar character | and a selected mathematical notation, and similarly for the double-bar command \|. This immediately rules out the use of | and \| for delimiters, because left and right delimiters are distinct usages that do not relate in the same way to adjacent symbols; recommended practice is therefore to define suitable commands in the document preamble for any paired-delimiter use of vert bar symbols:

\providecommand{\abs}[1]{\lvert#1\rvert} \providecommand{\norm}[1]{\lVert#1\rVert}

whereupon the document would contain \abs{z} to produce |z| and \norm{v} to produce ∥v∥.


Another option which was not mentioned in any of the comments above is:

F=\left.\frac{\partial f}{\partial x}\right|_{\hat x_{k-1}}

enter image description here

I hope this helps someone else.