# How can I get an 'evaluation at' vertical bar in MathJax? \right| doesn't seem to work, looking for alternatives

I tried to write the following equation on the main site using MathJax:

The vertical bar and $a_2=0$ indicate that this equation should be evaluated at the point where the related parameter $a_2$ is zero. It's described further in the original post. This notation is also used in other mathematical contexts.

The traditional LaTeX notation for this symbol is \right|_{a_2=0}, but experimentation shows that \right| is not supported.

I've made do in this case by using |_{a_2=0} which produces the following result:

$s_{11} = {\frac{b_1}{a_1}} |_{a_2=0}$

It's legible, but the vertical bar is the wrong height. It should match the height of the fraction, but it's just a normal character and does not stretch. I do note that other characters like ( do stretch with \left( and \right):

$\left(\frac{b_1}{a_1}\right)$

so perhaps I'm just screwing something up. The MathJax documentation says that \right is supported, so I think this should work. What am I doing wrong?

A \right must be matched by a preceding \left, which marks the beginning of the material that the \right is supposed to stretch to match. If you don't want a visible character, you use \left.. So

$s_{11} = \left.\frac{b_1}{a_1}\right|_{a_2=0}$


should get what you want: $s_{11} = \left.\frac{b_1}{a_1}\right|_{a_2=0}$.

Alternatively, you can use \big, \Big, \bigg or \Bigg to get a stretchable delimiter at larger and larger sizes. There are right, left, and middle versions of these (e.g., \biggr, \Bigl, \Biggm) that get the spacing right for those locations. So

$s_{11} = \frac{b_1}{a_1}\Bigr|_{a_2=0}$


should get you $s_{11} = \frac{b_1}{a_1}\Bigr|_{a_2=0}$ as well.

Test sizes:

$$\big| \Big| \bigg| \Bigg|$$


$$\big| \Big| \bigg| \Bigg|$$

For some reason, they are not aligned as I was expecting

$$= \bigl| = \\ = \bigm| = \\ = \bigr| =$$


$$= \bigl| = \\ = \bigm| = \\ = \bigr| =$$

• TeX's spacing rules work between pairs of adjacent tokens, not single tokens, so the extra space for the various forms will not show up in your example. There is also the issue of individual lines being centered. Perhaps this example will give you a better idea of the spacing of the various forms: $$\begin{array}{l} =\mathopen{|}=\\ =\mathrel{|}=\\ =\mathclose{|}= \end{array}$$ May 8, 2012 at 20:24
• @DavideCervone you're right: but I still can't make the same output, can you show me where I'm wrong? May 9, 2012 at 8:16
• The extra spacing only comes into play when a open or close is next to a binary operator or relation. So it works in my example because I used equal signs (relations) while not in yours because you used variables (which are "ordinaries"). Try this:\begin{array}{l} =\bigl|=\\ =\bigm|=\\ =\bigr|= \end{array} May 9, 2012 at 11:12
• Note that your \bigm spacing is different than mine because \bigm is a relation, and that gets extra space when next to an ordinary, but not when next to another relation. Here's one using binary operators:\begin{array}{l} {}-\bigl|-\\ {}-\bigm|-{}\\ {}-\bigr|- \end{array} May 9, 2012 at 11:16
• Interesting. That middle one appears to be a big in MathJax. It should have space on the left of the bar. I'll have to look into that. May 9, 2012 at 11:32
• I found the bug and will fix it in the next release. It also resolves another minor spacing issue (the first line should have small space before the minus but doesn't). May 9, 2012 at 11:55
• Cool! Thanks for the insights and the support! Have you got italian origins? May 9, 2012 at 11:56
• Yes, but several generations back. May 9, 2012 at 11:59