Character in between \left and \right in the same size in LaTeX

latex

In LaTeX, it is common to use \left and \right to get parenthesis of the same size. I would like to put something in between them in the same size, like a vertical bar:

\left( \frac{a}{b} | q \right)

In this example, the vertical bar is to small.

Perhaps it is possible to save the size of the height and do something like:

\left( \frac{a}{b} \saveheight \right|\left. \restoreheight q \right)

with some definition of saveheight and restorheight, but this is just guessing from my side. Any ideas?

Best Answer

You can write

\left( \frac{a}{b} \middle| q \right)

This only (of course?) works for delimiters that actually scale.

\middle is defined as part of eTeX, which is standard in all distributions for years now.

Related Question