How to reduce height of one row in longtable?

I am preparing a document with a quite special format: the first row in a long table should be written with \scriptsize font:

\documentclass{article}
\usepackage{longtable}
\usepackage{array}

\begin{document}

\begin{longtable}{|>{\centering\arraybackslash}m{2em}|>{
\centering\arraybackslash}m{2em}|>{\centering\arraybackslash}m{2em}|>{
\centering\arraybackslash}m{2em}|>{\centering\arraybackslash}m{2em}|}
\hline
{\bf\scriptsize 1} & {\bf\scriptsize 2} &
{\bf\scriptsize 3} & {\bf\scriptsize 4} &
{\bf\scriptsize 5}
\\  \hline
\endfirsthead
1 & 2 & 3 & 4 & 5\\
\hline
1 & 2 & 3 & 4 & 5\\
\hline
1 & 2 & 3 & 4 & 5\\
\hline
\end{longtable}

\end{document}


I would like to reduce height of the first row. The lower vertical space can be reduced by replacing \\ with \\[-0.3em] after the first row. But what to do with the upper space? I would be appreciate for any useful suggestions.

-

1 Answer

If there were no vertical rules you could do

\hline
\noalign{\vskip-3pt}


(and unrelated, but use \bfseries\scriptpsize 3 & not {\bf\scriptsize 3} & )

But as there are you could do:

\documentclass{article}
\usepackage{longtable}
\usepackage{array}

\begin{document}

\def\mystrut{\vrule height 8pt depth 2pt width 0pt\kern4\arrayrulewidth}
\begin{longtable}{|>{\centering\arraybackslash}m{2em}|>{
\centering\arraybackslash}m{2em}|>{\centering\arraybackslash}m{2em}|>{
\centering\arraybackslash}m{2em}|>{\centering\arraybackslash}m{2em}|}
\hline
\omit\vrule \scriptsize\bfseries\mystrut\hfill 1 \hfill\vrule&
\omit       \scriptsize\bfseries\mystrut\hfill 2 \hfill\vrule&
\omit       \scriptsize\bfseries\mystrut\hfill 3 \hfill\vrule&
\omit       \scriptsize\bfseries\mystrut\hfill 4 \hfill\vrule&
\omit       \scriptsize\bfseries\mystrut\hfill 5 \hfill\vrule\\
\hline
\endfirsthead
1 & 2 & 3 & 4 & 5\\
\hline
1 & 2 & 3 & 4 & 5\\
\hline
1 & 2 & 3 & 4 & 5\\
\hline
\end{longtable}

\end{document}

-
Thank you. The problem is that this reduces the upper space but also results in vertical lines above the table. How to remove them? – Andrew Oct 5 '12 at 13:03
@Andrew Avoid vertical rules: they are evil. ;-) – egreg Oct 5 '12 at 13:11
These vertical lines are more than evil: they are suggested by some bureaucratic rules:) – Andrew Oct 5 '12 at 13:18
Thank you very much. It works. Now I will try to apply it for my document. – Andrew Oct 5 '12 at 13:35