Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
\begin{equation}
\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{equation}

\end{document}

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

share|improve this question
4  
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
add comment

1 Answer

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
\begin{equation}
\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{equation}

\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.