I want to write an equation with $\mid$, but it is too small, can i make it bigger in any way?

I am kinda new to TeX so i have no idea how to do it.

  • 2
    Perhaps How can you address the size of surrounding parentheses whose size is determined by \left and \right? can help... not sure about the usage of \mid in your case. More detail?
    – Werner
    Oct 31, 2013 at 4:36
  • 2
    Well, \Bigm| would help? And what exactly do you need it for (because there're at least 5 different meanings of |)? Maybe you can help us in helping you by providing a Minimal (non-)Working Example...
    – yo'
    Oct 31, 2013 at 7:37
  • Are you sure that you want \mid (which is usually used to such that meaning) or do you want a vertical bar to denote the absolute value, for example, on a fraction? If you want the second option, use \left|...\right|.
    – Sigur
    Oct 31, 2013 at 10:57
  • I'm not sure to have ever heard of a "given that" symbol. Can you show what it is and a context where it's used?
    – egreg
    Oct 31, 2013 at 15:14
  • @egreg: I took it to mean conditional probability, e.g., P(X = x|Y = y).
    – alexwlchan
    Nov 2, 2013 at 8:59

4 Answers 4


2017 Update: Since \mid is a relation, under normal circumstances the spaces manually inserted around \middle| should be thick \; instead of thin \,. See table on p.170 of the TEXbook.

Instead of \mid, you can use \middle command to enlarge vertical delimiter and insert spaces manually, here is an example:






enter image description here

Better yet, we can make a custom command for our conveniences:


It works sorta like \DeclarePairedDelimiter in mathtools, for example:


will give you:

  • 2
    \cdots is not the proper dots to use here
    – daleif
    Nov 1, 2013 at 7:30
  • See also my addition
    – daleif
    Nov 1, 2013 at 7:41
  • 1
    Really helpfull, thanks. However, when adding the commands at the beginning of the document I had to make some changes and include the \ensuremath{...} command: \usepackage{mathtools} \makeatletter \newcommand{\@giventhatstar}[2]{\ensuremath{\left({#1}\;\middle|\;{#2}\right)}} \newcommand{\@giventhatnostar}[3][]{#1(#2\;#1|\;#3#1)} \newcommand{\giventhat}{\@ifstar\@giventhatstar\@giventhatnostar} \makeatother Aug 15, 2018 at 11:47

Sounds like conditional probability. In that case I usually recommend our students to use something similar to


Which will be manually scalled via, say


Then the code makes sense when read

ADDITION. Building further on Francis' suggestion \given can be build into his macros such that the macros only takes one argument.

\DeclarePairedDelimiterX\Basics[1](){\let\given\sgiven #1}
  \Basics{X} \qquad \Basics[\Big]{ X \given Y}\\
  \Average{X} \qquad \Average[\Big]{ X \given Y}\\

enter image description here

  • Maybe \operatorname{E} instead of E?
    – Francis
    Nov 1, 2013 at 8:54
  • 2
    It might be yes. Though I think most people think of it in the same manner as f(x), i.e. just a function. Some people use an upright E, some people even use \mathbb{E}. Depends on the tradition.
    – daleif
    Nov 1, 2013 at 9:45

This uses features of the scalerel package.

\noindent You can stretch it to a size:\\
$A \mid 
or you can stretch it to fit something else:\\
$ \stretchrel{\mid}{\displaystyle\frac{A}{B}} $\\

enter image description here


Use \left.\right|

For example $$\mathbb{E}(Y^3) = \left.\frac{d^3 M_Z(t)}{d t^3}\right|_{t=0}$$

enter image description here

You must log in to answer this question.

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