我有一个长表,带有标题,底部有一个子部分。中间有很多空白,我想删除它。可以吗?我发现只有一种方法可以删除两个表之间的空格,但这不是我的情况。
这是代码
\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}
先感谢您!!
答案1
两个建议:
不要将
longtable
环境嵌入到环境中center
,因为这样做会使 LaTeX 插入大量额外的垂直空白。而且,由于一longtable
开始就自动居中,因此将其嵌入到环境中center
没有任何好处。caption
使用选项加载包skip=0.333\baselineskip
。这将确保标题更靠近表格本身。
完整的 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}