0

I'm using the book class and I created a table. The table is alone on page and the spacing to the upper edge of the paper is too big. How can I reduce? I tried using \setlength{\textfloatsep}{0.1cm} but nothing happened. Here is my code:

\documentclass{book} 
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{booktabs,dcolumn}
\usepackage[figureposition=bottom]{caption}
\usepackage{fancyhdr}
\fancyhf{}
\fancyhead[C]{\leftmark}
\fancyhead[R]{\thepage}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\chaptermark}[1]{
 \markboth{#1}{}}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\newcommand*{\mc}[1]{\multicolumn{1}{c}{#1}}
\newcommand*{\mcTwo}[1]{\multicolumn{2}{c}{#1}}
\linespread{1.8}
\setlength\parindent{0pt}
\begin{document} 
\chapter {Hello world} 
\section{Hello world} 
\lipsum
\begin{table}[htbp]
     \centering
     \caption{Zusammensetzungen einiger SX-Nickelbasislegierungen in wt\%.}
     \label{tbl:1}
      \begin{tabular}{c d{2.1} d{2.1} d{2.1} d{1.1} d{1.1} d{1.2} d{1.1} d{1.1} d{1.1} d{1.1} d{1.0} d{1.2}}
       \toprule
        Alloy & \mc{Ni} & \mc{Cr} & \mc{Co} & \mc{Mo} & \mc{W} & \mc{Al} & \mc{Ti} & \mc{Ta} & \mc{Re} & \mc{Nb} & \mc{V} & \mc{Hf} \\
       \midrule
        \mcTwo{First generation} & & & & & & & & & & & \\
       \midrule
        PWA~1480    & 62.5 & 10   &  5   & \mc{---} & 4        & 5    & 1.5      & 12   & \mc{---} & \mc{---} & \mc{---} & \mc{---} \\[1ex]
        Ren{\'e}~N4 & 62.6 &  9   &  8   & 2        & 6        & 3.7  & 4.2      &  4   & \mc{---} & 0.5 & \mc{---} & \mc{---}      \\[1ex]
        CMSX-2      & 66.6 &  8   &  4.6 & 0.6      & 7.9      & 5.6  & 0.9      &  5.8 & \mc{---} & \mc{---} & \mc{---} & \mc{---} \\[1ex]
        SRR~99      & 66.5 &  8.5 &  5   & \mc{---} & 9.5      & 5.5  & 2.2      &  2.8 & \mc{---} & \mc{---} & \mc{---} & \mc{---} \\
       \midrule
        \mcTwo{Second generation} & & & & & & & & & & & \\
       \midrule
        PWA~1484    & 59.4 &  5   & 10   & 2        & 6        & 5.6  & \mc{---} &  9   & 3        & \mc{---} & \mc{---} & \mc{---} \\[1ex]
        Ren{\'e}~N5 & 61.8 &  7   &  8   & 2        & 5        & 6.2  & \mc{---} &  7   & 3        & 0.5      & \mc{---} & 0.2      \\[1ex]
        CMSX~4      & 61.8 &  6.5 &  9   & 0.6      & 6        & 5.6  & 1        &  6.5 & 3        & \mc{---} & \mc{---} & 0.1      \\[1ex]
        CMSX~6      & 70.4 & 10   &  5   & 3        & \mc{---} & 4.8  & 4.7      &  2   & \mc{---} & \mc{---} & \mc{---} & 0.1      \\[1ex]
       \midrule
        \mcTwo{Third generation} & & & & & & & & & & & \\
       \midrule
        CMSX-10     & 69.6 &  2   &  3   & 0.4      & 5        & 5.7  & 0.2      &  8   & 6        & 0.1      & \mc{---} & 0.03     \\[1ex]
        Ren{\'e}~N6 & 57.4 &  4.2 & 12.5 & 1.4      & 6        & 5.75 & 0        &  7.2 & 5.4      & 0        & 0        & 0.15     \\
       \bottomrule
      \end{tabular}
    \end{table}
    \end{document}
ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149
abdu
  • 1,849
  • @DavidCarlisle I also added the code for the table. Now I added also a screenshot =) – abdu May 23 '13 at 20:09
  • You should put the table in the document in a position where it has space you don't understand, just add junk text or vspace commands to pad out the page so you get whatever effect you need to show. As is the code posted is no help at all. However the linked answer most likely solves the problem/ – David Carlisle May 23 '13 at 20:12
  • @DavidCarlisle Ok I added a junk text. The situation is not much complicated though. I have a table on a page and I need to move it to the top of the page just under the headline. Thank you and excuse my little knowledge in LaTeX. – abdu May 23 '13 at 20:31
  • Please test the code before you post: your example produces ! Undefined control sequence. l.31 \lipsum However if I add the code from the answer linked above to your preamble the table moves to the top of the page. So this question should be closed as duplicate/ – David Carlisle May 23 '13 at 20:38
  • @DavidCarlisle by the way I tried using \setlength{\@fptop}{0pt} but it's giving an error: ! You can't use `\spacefactor' in internal vertical mode. – abdu May 23 '13 at 20:39
  • 1
    You need to copy all the code in that answer including \makeatletter – David Carlisle May 23 '13 at 20:39
  • @DavidCarlisle it works! that's exactly what I want. Sorry one more time for not getting what you mean immediately. – abdu May 23 '13 at 20:48
  • Thanks for confirming it works, this question will be closed as a duplicate then. – David Carlisle May 23 '13 at 21:02

0 Answers0