How does TeX decide how to size a middle delimiter?

How does TeX decide how to size a middle delimiter? When I want to show evaluation of limits of an integral, I would type $$\int_1^2 x\; dx=\frac{x^2}{2}|_1^2=4-\frac{1}{2}=\frac{7}{2}.$$ How do I get the vertical bar showing the limits big enough? I have found \bigg and \Big but I would like it to autosize like \left. It seems harder because there isn't a left side to figure out what is inside. I tried \left space and \right \mid, but didn't find success. On math.stackexchange it was stated I just needed \left. as period is a delimiter. Is there a list of delimiters?

• My post doesn't get rendered by MathJax as it does on math.stackexchange.com What should I do, as the question is difficult to read without it? – Ross Millikan Jun 15 '11 at 4:55
• This is discussed in Evaluation of Differentiation and Integration – Danie Els Jun 15 '11 at 5:00
• This site does not use MathJax - as we prefer to see the code. However, users are asked to provide a MWE (minimum working example) for the convenience of people that answer and to clarify and reproduce the issue. – Yiannis Lazarides Jun 15 '11 at 5:20

You should use:

$\int_1^2 x\; dx=\left.\frac{x^2}{2}\right|_1^2=4-\frac{1}{2}=\frac{7}{2}.$

Latex grabs the height of whatever is in between the \left and \right and then adjust the delimiters (. and | in this case) to be big enough to encompass that.

Since in your example, the limit evaluation only relates to the fraction in front of it, therefore one can use \left and \right without the need of \middle. Since we don't need a left delimited we use . which stands for ''nothing''. Even if we don't want a left delimiter \left has to be there to tell latex where to start measuring the height.

\middle is only needed when three or more delimiters are used, as is the case in this example:

$A = \left\{ \frac{x_i}{i} \middle| i\in \mathcal{I} \right\}$

where we would want the collections curly braces to match with the inner line.

Giving a list of delimiters would be hard, since there are so many of them, and a lot of packages introduce new ones. Have a look at The Comprehensive Symbol List to have an idea of what is generally in use. I mostly use ( ) \{ \} [ ] and |.

Some other notes:

• I tend not to use \Big etc since this doesn't work automatically.
• You should use $and$ to denote a math environment instead of , which is old tex code instead of latex.
• Have a look at this question about integral evaluation.
• When I say ''delimiters'', I don't mean that this is a class of latex symbols that is special in any way, I just mean symbols that can be scaled.
• "I don't that this is a class of latex symbols that is special in any way" is confusing. What do you mean? Delimiters are an integral part of TeX. In particular, delimiters have specific \mathcodes. – TH. Jun 15 '11 at 9:09
• Concerning \Big etc., one needs them in two places: first, when putting resized delimiters around a multiline equation; and second, when putting large parentheses around an expression that is not large enough for \left...\right to resize for. This comes up when you want to set off a grouping in an expression with lots of parentheses. – Ryan Reich Jun 15 '11 at 14:09
• \Big etc are also useful when the subexpression contains \sum or \prod. In those cases, \left and \right are too big. The nath package fixes the behavior of \left and \right; but, it is incompatible with amsmath. – Aditya Jun 15 '11 at 14:58
• @ TH I just meant that Ross shouldn't think delimiter are mafically special. They don't do much. – romeovs Jun 15 '11 at 17:55
• Be aware that in =\left.\frac{x^2}{2}\right|_1^2, there's an extra 1.2pt of space between the = sign and the fraction than there is in =\frac{x^2}{2}\bigg|_1^2 or, indeed, in =\frac{x^2}{2}. 1.2pt is the default value of \nulldelimiterspace, which is the actual space created by a \left. or a \right.. (They aren't just markers; they're empty boxes with width \nulldelimiterspace.) – MSC Feb 22 '13 at 22:32