4
\$\begingroup\$

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

enter image description here

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?

| |
\$\endgroup\$
6
\$\begingroup\$

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.

| |
\$\endgroup\$
1
\$\begingroup\$

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| = $$

| |
\$\endgroup\$
  • 1
    \$\begingroup\$ 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}$$ \$\endgroup\$ – Davide Cervone May 8 '12 at 20:24
  • \$\begingroup\$ @DavideCervone you're right: but I still can't make the same output, can you show me where I'm wrong? \$\endgroup\$ – clabacchio May 9 '12 at 8:16
  • 1
    \$\begingroup\$ 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} \$\endgroup\$ – Davide Cervone May 9 '12 at 11:12
  • 1
    \$\begingroup\$ 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} \$\endgroup\$ – Davide Cervone May 9 '12 at 11:16
  • \$\begingroup\$ 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. \$\endgroup\$ – Davide Cervone May 9 '12 at 11:32
  • 1
    \$\begingroup\$ 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). \$\endgroup\$ – Davide Cervone May 9 '12 at 11:55
  • \$\begingroup\$ Cool! Thanks for the insights and the support! Have you got italian origins? \$\endgroup\$ – clabacchio May 9 '12 at 11:56
  • \$\begingroup\$ Yes, but several generations back. \$\endgroup\$ – Davide Cervone May 9 '12 at 11:59

You must log in to answer this question.

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