2

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 enter image description here

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!

  • 3
    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
5

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.

enter image description here

\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
2

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

0

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}

enter image description here

  • this does not work and generates errors – pixelou Jul 3 '18 at 13:37
  • @pixelou: Do you have errors with this very code, and nothing else? Which errors? – Bernard Jul 3 '18 at 13:58
  • see here: papeeria.com/p/1f7c62db-ff20-4045-b147-fb29d3ed0103#/main.tex "Undefined control sequence. [\end{align}]" – pixelou Jul 3 '18 at 14:26
  • @pixelou: I've jsut seen your comment, but the link doesn't work (‘requested project not exists’). However, a simple question: are the fourier package (not mandatory, can be removed from the code: it's a font package) and mathtools (mandatory) installed? – Bernard Jul 3 '18 at 16:01
  • yes I have, it looks like a conflict of packages, your example alone actually works fine. – pixelou Jul 3 '18 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.