# Overbrace is not alligned correctly

Here is an equation:

\documentclass[a4paper,10pt]{report}
\usepackage{xltxtra}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{array}
\usepackage{unicode-math}

\setmainfont{XITS}
\setmathfont{XITS Math}

\begin{document}

Hello world
$$\overbrace{ \left[ \begin{array}{c} x \\ y \\ w \\ \end{array} \right]}^q = \overbrace{ \left[ \begin{array}{c c c} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \\ \end{array} \right] }^M \cdot \overbrace{ \left[ \begin{array}{c} X \\ Y \\ Z \\ \end{array} \right]}^Q$$

\end{document}


The thing is that the overbraces are not equally aligned vertically as you can clearly see.

-
You are using a different font, which may be the cause for it. Inserting \mathstrut (or even \strut) in a cell across all the rows might solve the problem. However, you may which to provide a minimal working example (MWE) that clearly illustrates your current setup. From there, it may be easier to assess the exact problem source. –  Werner Jul 15 '12 at 17:27
@Werner i have added the MWE. –  msmechanized Jul 15 '12 at 18:17
This doesn't look like the output that I get when running the code with xe/lualatex from TL2012. Though the TL 2012 output has its own share of problems. –  Caramdir Jul 15 '12 at 21:17
I opened a bug report at github.com/wspr/unicode-math/issues/241 with a much more minimal MWE and the output that I get. –  Caramdir Jul 15 '12 at 21:42
@Caramdir wow, did not know that i found a bug there.. is there a way to work around this? –  msmechanized Jul 16 '12 at 2:01

There's really not much that can be done here with the present XITS Math font. However, the output is much better with TG Termes Math

\documentclass[a4paper,10pt]{report}
\usepackage{amsmath}
\usepackage{array}
\usepackage{unicode-math}

\setmainfont{XITS}
\setmathfont{TG Termes Math}

\begin{document}

Hello world
$$\overbrace{ \begin{bmatrix} x \\ y \\ w \\ \end{bmatrix} }^{\mathstrut q} = \overbrace{ \begin{bmatrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \\ \end{bmatrix} }^{\mathstrut M} \cdot \overbrace{ \begin{bmatrix} X \\ Y \\ Z \\ \end{bmatrix} }^{\mathstrut Q}$$

\end{document}


-