Here is an MWE:

\documentclass[a4paper,11pt]{article}
\usepackage{soul}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{fontspec}
\setmainfont{Arial}
\usepackage{hyperref}
\begin{document}

\begin{longtable}{@{}rrrrrrr@{}} \toprule
\multicolumn{7}{c}{Vertical} \\
$i$
& \multicolumn{2}{c}{$\langle x^1_{i}, y^1_{i} \rangle$}
& \multicolumn{2}{c}{$\langle x^2_{i}, y^2_{i} \rangle$}
& $\measuredangle_{i}$ & $m_{i}$ \endhead \midrule
$1$
&   $\langle 17.90,$ & $27.19 \rangle$
&   $\langle -192.10,$ & $69.53 \rangle$
&   $-90.0°$
&   $29$ \\
$2$
&   $\langle 47.65,$ & $31.32 \rangle$
&   $\langle -162.35,$ & $73.66 \rangle$
&   $-90.0°$
&   $21$ \\
$3$
&   $\langle 85.94,$ & $32.43 \rangle$
&   $\langle -124.06,$ & $74.77 \rangle$
&   $-90.0°$
&   $27$ \\
$4$
&   $\langle 117.53,$ & $34.29 \rangle$
&   $\langle -92.47,$ & $76.63 \rangle$
&   $-90.0°$
&   $23$ \\
$5$
&   $\langle 154.71,$ & $29.83 \rangle$
&   $\langle -55.29,$ & $72.17 \rangle$
&   $-90.0°$
&   $21$ \\
\multicolumn{3}{l}{Average}
&   \multicolumn{4}{r}{$\tilde{m} = \frac{1}{n}\sum_{i=1}^{n}m_{i}$} = $24.0$ \\ \bottomrule

\end{longtable}

\end{document}


Result:

The obvious problem is that header columns are misaligned. $i$ should be above the numbers (first column) and $m_i$ should be above the last column.

• You need to compile two or three times in order that the header and footer of the longtable can be typeset with the correct lengths. As an aside: I'd put the first \midrule before \endhead (with \\ in front of it). – egreg Sep 29 '12 at 22:10
• As egerg says you need multiple runs -- this actually needs three runs to stabilize. – Peter Grill Sep 29 '12 at 22:10
• I ran it twice. But now I tried to run it three times and the problem is gone. Sorry, it was a very dumb question. Is it possible that I will ever need to run it four times? – nagylzs Sep 29 '12 at 22:15
• A typographically suggestion: Use {@{}rr@{${},{}$}rr@{${},{}$}rrr@{}} as column specification and remove the commas in the table body. – Qrrbrbirlbel Sep 29 '12 at 22:18
• @nagylzs TeX informs you if the longtable is not yet stable. Don't worry too much: during document preparation, you run frequently LaTeX, so this is a minor problem. – egreg Sep 29 '12 at 22:27

The headers and footers of a longtable cannot be typeset correctly at the first run, but also the rows: for saving memory and avoiding overflows, longtable processes the table dividing it into chunks and annotating in the .aux file the column widths, so that in the next LaTeX run they can be fixed.

Depending on the table, two or three runs may be needed. If a new run is needed, LaTeX will print in the .log file a couple of warnings. The first

Package longtable Warning: Column widths have changed
(longtable)                in table 1 on input line 55.


when the table is typeset, the second

Package longtable Warning: Table widths have changed. Rerun LaTeX.


at the end of the run. In this way the user is informed about the problem.

This shows also the importance of the .aux file that mustn't be deleted after a run, because it contains basic information for the next run (cross references, for instance). Only in a few cases, due to some kinds of errors in the input, the .aux file can become corrupt. This usually shows with weird errors in the early stages of the LaTeX run. When the compiler raises a very weird error, one of the strategies is indeed removing the .aux file; but this is more the exception than the rule.