4

I'm having the following table in my document:

\documentclass[12pt]{article}
\usepackage{tabu}
\begin{document}
\[
    \begin{tabu} {c | c c c c c c}
    \firsthline
        f & a_{11} & a_{12} & a_{21} & a_{22} & b_1 & b_2 \\ \hline
        1 & a_{11}^1 & a_{12}^1 & a_{21}^1 & a_{22}^1 & b_1^1 & b_2^1 \\
        \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
        n & a_{11}^n & a_{12}^n & a_{21}^n & a_{22}^n & b_1^n & b_2^n \\
        \lasthline
    \end{tabu}
\]
\end{document}

The second and the last row are a little bit too close to the horizontal lines. How can I add some more space between them?


Update: I tried using \tabulinesep=5pt in the preamble and that looks better.

Table

However, the vdots seem to be placed too much to the bottom now and the lasthline isn't displayed 'bold' anymore. How can I fix this?

4

I'd probably use array for this but in any case the same \extrarowheight parameter can be used:

enter image description here

\documentclass[12pt]{article}
\usepackage{tabu}
\begin{document}
a
\[
    \begin{tabu} {c | c c c c c c}
    \firsthline
        f & a_{11} & a_{12} & a_{21} & a_{22} & b_1 & b_2 \\ \hline
        1 & a_{11}^1 & a_{12}^1 & a_{21}^1 & a_{22}^1 & b_1^1 & b_2^1 \\
        \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
        n & a_{11}^n & a_{12}^n & a_{21}^n & a_{22}^n & b_1^n & b_2^n \\
        \lasthline
    \end{tabu}
\]
b
\[\setlength\extrarowheight{2pt}
    \begin{tabu} {c | c c c c c c}
    \firsthline
        f & a_{11} & a_{12} & a_{21} & a_{22} & b_1 & b_2 \\ \hline
        1 & a_{11}^1 & a_{12}^1 & a_{21}^1 & a_{22}^1 & b_1^1 & b_2^1 \\
        \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
        n & a_{11}^n & a_{12}^n & a_{21}^n & a_{22}^n & b_1^n & b_2^n \\
        \lasthline
    \end{tabu}
\]
\end{document}
1
  • This already looks better, but I'd also like some more spacing after the last line. I've updated my question.
    – Jeroen
    Nov 22 '14 at 19:55
0

tabu's way of doing this is to use \tabulinesep. From manual:

enter image description here

Applying to your code (with some huge space for demo)

\documentclass[12pt]{article}
\usepackage{tabu}
\begin{document}
\[\tabulinesep=1cm    %<--------------------------adjust 1cm
    \begin{tabu} {c | c c c c c c}
    \firsthline
        f & a_{11} & a_{12} & a_{21} & a_{22} & b₁ & b₂ \\ \hline
        1 & a_{11}¹ & a_{12}¹ & a_{21}¹ & a_{22}¹ & b₁¹ & b₂¹ \\
         ⋮  &  ⋮  &  ⋮  &  ⋮  &  ⋮  &  ⋮  &  ⋮  \\
        n & a_{11}^n & a_{12}^n & a_{21}^n & a_{22}^n & b₁^n & b₂^n \\
        \lasthline
    \end{tabu}
\]
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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