1

I have a longtable with a caption, and a subsection at the bottom. There is a lot of blank space in between, and I would like to delete it. It is possible? I found only way to delete the space between two tables, but it is not my case.

enter image description here

This is the code

   \documentclass{llncs}
\setlength{\intextsep}{12pt plus 0pt} %%Per spazio dopo Caption
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[english]{babel} %% package per inglese
\usepackage[utf8]{inputenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{url}
\usepackage{xspace}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{manifest}

\makeatother

% Cross-referencing
\newcommand{\labelsec}[1]{\label{sec:#1}}
\newcommand{\xs}[1]{\sectionname~\ref{sec:#1}}
\newcommand{\xsp}[1]{\sectionname~\ref{sec:#1} \onpagename~\pageref{sec:#1}}
\newcommand{\labelssec}[1]{\label{ssec:#1}}
\newcommand{\xss}[1]{\subsectionname~\ref{ssec:#1}}
\newcommand{\xssp}[1]{\subsectionname~\ref{ssec:#1} \onpagename~\pageref{ssec:#1}}
\newcommand{\labelsssec}[1]{\label{sssec:#1}}
\newcommand{\xsss}[1]{\subsectionname~\ref{sssec:#1}}
\newcommand{\xsssp}[1]{\subsectionname~\ref{sssec:#1} \onpagename~\pageref{sssec:#1}}
\newcommand{\labelfig}[1]{\label{fig:#1}}
\newcommand{\xf}[1]{\figurename~\ref{fig:#1}}
\newcommand{\xfp}[1]{\figurename~\ref{fig:#1} \onpagename~\pageref{fig:#1}}
\newcommand{\labeltab}[1]{\label{tab:#1}}
\newcommand{\xt}[1]{\tablename~\ref{tab:#1}}
\newcommand{\xtp}[1]{\tablename~\ref{tab:#1} \onpagename~\pageref{tab:#1}}
% Category Names
\newcommand{\sectionname}{Section}
\newcommand{\subsectionname}{Subsection}
\newcommand{\sectionsname}{Sections}
\newcommand{\subsectionsname}{Subsections}
\newcommand{\secname}{\sectionname}
\newcommand{\ssecname}{\subsectionname}
\newcommand{\secsname}{\sectionsname}
\newcommand{\ssecsname}{\subsectionsname}
\newcommand{\onpagename}{on page}

% Comments

%%%---Per Tabelle che vanno su più pagine
\usepackage{longtable}
\usepackage{caption}
\usepackage{xpatch}

\makeatletter
\xpatchcmd{\maketitle}{%
  \addtocontents{toc}{\noexpand\protect\noexpand\authcount{\the\c@auco}}%
  \addcontentsline{toc}{author}{\toc@uthor}%
}{% Replace by 'nothing'
}{\typeout{success}}{\typeout{failed}}

\xpatchcmd{\maketitle}{%
  \if!\the\toctitle!\addcontentsline{toc}{title}{\@title}\else
  \addcontentsline{toc}{title}{\the\toctitle}\fi
}{%
  % Replace by nothing
}{\typeout{Success}}{\typeout{Failed patching!}}
\makeatother

\begin{document}

\maketitle

\section{Requirement analysis}
\labelsec{ReqAnalysis}

\setlength{\tabcolsep}{7pt}
\renewcommand{\arraystretch}{1.5}
    \begin{longtable}{| p{.15\textwidth} | p{.55\textwidth} | p{.18\textwidth}|}
    \hline
    \textbf{Termini} & \textbf{Descrizione} & \textbf{Sinonimi} \\ \hline
    Prototype & Exemplary of reference to which they are referable aspects and typical characteristics of that prototype. & \\
     \hline
    Allarm & Sound emitted from the console if a sensor installed on the wall detects an obstacle in front of him, along the path of the robot. & allarm sound \\
    \hline 
    \caption{Glossary of terms}
    \end{longtable}


\subsection{User stories}
\labelssec{User stories}
A User Story (user story) is a customer requirement written in natural language from the user point of view, to understand the technical staff, users and domain experts. 
\end{document}

Thank you in advance!!

5
  • Please make your code a MWE (specifically use a standard/KOMA class and remove anything which just bloats the code and does not help understanding your problem).
    – TeXnician
    Feb 6, 2017 at 16:17
  • changed the code. now it should be cleaner!
    – JEricaM
    Feb 6, 2017 at 16:23
  • Why are you embedding the longtable environment in a center environment? longtables are automatically centered...
    – Mico
    Feb 6, 2017 at 16:25
  • 1
    changed! I was not aware of this detail....
    – JEricaM
    Feb 6, 2017 at 16:28
  • The caption of a table, and especially of a long table should be above the table. Do you think you the reader should have to turn the page to know what the table is about, then go back to the beginning of the table to read it?
    – Bernard
    Feb 6, 2017 at 18:47

1 Answer 1

4

Two suggestions:

  • Don't embed the longtable environment in a center environment, as doing so makes LaTeX insert of a lot extra vertical whitespace. And, as a longtable is centered automatically centered to begin with, embedding it in a center environment serves no good purpose.

  • Load the caption package with the option skip=0.333\baselineskip. This will ensure that the caption is placed more closely to the table itself.

A full MWE:

\documentclass{llncs}
\setlength{\intextsep}{12pt plus 0pt} 
\usepackage[english]{babel} %% package per inglese
\usepackage[utf8]{inputenc}
\usepackage{url}
\usepackage{xspace}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%%%%%\usepackage{manifest}
\makeatother


%%%---Per Tabelle che vanno su più pagine
\usepackage{longtable}
\usepackage[skip=0.333\baselineskip]{caption}
\usepackage{xpatch}


\begin{document}

\maketitle

\section{Requirement analysis}
\label{ReqAnalysis}

\setlength{\tabcolsep}{7pt}
\renewcommand{\arraystretch}{1.5}
\begin{longtable}{| p{.15\textwidth} | p{.55\textwidth} | p{.18\textwidth}|}

    \hline
    \textbf{Termini} & \textbf{Descrizione} & \textbf{Sinonimi} \\ 
    \hline
    \endhead
    \hline
    \endfoot    
    \hline
    \caption{Glossary of terms}
    \endlastfoot

    Prototype & Exemplary of reference to which they are referable aspects and typical characteristics of that prototype. & \\
    \hline
    Allarm & Sound emitted from the console if a sensor installed on the wall detects an obstacle in front of him, along the path of the robot. & allarm sound \\
\end{longtable}


\subsection{User stories}
\label{User stories}

A User Story (user story) is a customer requirement written in natural language from the user point of view, to understand the technical staff, users and domain experts.

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .