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.

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.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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:

enter image description here

\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} 
share|improve this answer
    
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
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.