# What is the height above the baseline to the middle of an open bracket?

So I have a rule pointing at the middle of the following text. I have achieved this with the following code:

``````\newlength{\Fraiseheight}
\setlength{\Fraiseheight}{1ex}

\newlength{\Fbaselength}
\setlength{\Fbaselength}{20pt}

\newlength{\Flinewidth}
\setlength{\Flinewidth}{0.5pt}

\rule[\Fraiseheight]{\Fbaselength}{\Flinewidth}
``````

The height `1ex` is the height of an `x` in current font. This raises my rule higher than the centre of an open bracket that follows. This looks awkward especially for curly brackets. My question is: What height above the baseline do I need to achieve the following effect: "-(x" or "-{x" where the - is supposed to represent my rule and the x is present to show the discrepancy between the height `1ex` and that of the - character.

-
Just in case you didn't know, you can measure the height of the bracket with `\settoheight\height`, where `\height` is a length variable. You can then write `0.5\height` to get half the height. –  Marc van Dongen Aug 8 '12 at 7:31
I should have known that. –  Psachnodaimonia Aug 8 '12 at 7:58
@MarcvanDongen -- just the height of the bracket doesn't give the needed value. brackets also have depth, so the actual vertical span of the bracket is height plus depth. but heiko has the more direct answer: the middle of all "fences" in tex math is the math axis, which also happens to be the vertical center of the equals sign and plus. however, in fonts that were designed to be used mainly (or only) for text, the brackets, parntheses, etc., may not have sufficient depth to be visually vertically centered for tex math. –  barbara beeton Aug 8 '12 at 12:23
@barbarabeeton Thanks for that. I should have pointed that out. Heiko's solution is much better, which is why I gave him credit for it. –  Marc van Dongen Aug 8 '12 at 12:33

The middle of the brackets is the math axis. Command `\vcenter` centers its contents at the math axis.
``````\$\vcenter{\hrule width \Fbaselength height \Flinewidth}\$
``````\parbox[c]{\Fbaselength}{\rule{\FBaselength}{\Flinewidth}}