# \middle too big

I'm trying to typeset an equation that contains a "|":

\begin{align*}
\lambda_{l} = \lim_{q \to 0^{+}}P\left(X_{2} \leq F_{2}^{(-1)}(q) \middle|  X_{1} \leq F_{1}^{(-1)}(q) \right)
\end{align*}

which gives me

The "|" seems to be too long. I've tried \midbut that makes the vertical bar too short in relation to the outer left and right brackets. Is there a way I can get the "right" size "|" automatically?

Thanks!

-
You really need to include a MWE that recreates the problem. With a bare document with just amsmath loaded, the issue does not present for me. – cslstr May 29 '14 at 16:04
In particular, as the font you're using clearly isn't Computer Modern, please be sure to indicate which font-related package(s) you load. – Mico May 29 '14 at 16:39
I'm loading \usepackage[bitstream-charter]{mathdesign} and \usepackage[scaled]{berasans} – user2249626 May 29 '14 at 16:44

I'd argue that not only the middle vertical bar but also the outer parentheses are unnecessarily large. Try using \bigl(, \bigm|, and \bigr) to control the size of the symbols. As an extra nice touch, you could add a thinspace on either side of the big parentheses.

\documentclass{article}
\usepackage[bitstream-charter]{mathdesign}
\begin{document}
$\lambda_{l} = \lim_{q \to 0^{+}}P\bigl(\, X_{2} \leq F_{2}^{(-1)}(q) \bigm| X_{1} \leq F_{1}^{(-1)}(q) \,\bigr)$
\end{document}
-
\delimiterfactor=850 reduces the size of all of \left(, \right) and \middle|. They then actually come out the same size. However, that could possibly ruin other combinations. The real problem seems to be that there are finer divisions between different sizes of parentheses than between different sizes of \middle| in these mathdesign fonts. – Dan May 29 '14 at 17:48

use \big| instead. However, for me it looks ok with \middle|.

-

You can use this definition for conditional probabilities, adapted from the last version of mathtools (p. 27 of the doc). It has a simple syntax: \Prob{A \given B} for a a series \left…\middle…\right, or with an optional size argument: \prob[\big-Big-bigg-Bigg]{A \given B}:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{fourier}
\usepackage{mathtools}

\DeclarePairedDelimiterXPP\prob[1]{P}(){}{
\newcommand\given{\nonscript\:\delimsize\vert\nonscript\:}
#1}
\def\Prob{\prob*}

\begin{document}

\begin{align*}
\lambda_{l} & = \lim_{q \to 0^{+}}\Prob{X_{2} \leq F_{2}^{(-1)}(q) \given X_{1} \leq F_{1}^{(-1)}(q)} \\
& = \lim_{q \to 0^{+}}\prob[\big]{X_{2} \leq F_{2}^{(-1)}(q) \given X_{1} \leq F_{1}^{(-1)}(q)}
\end{align*}
\end{document}

-