longtabu 底部标题太近了

longtabu 底部标题太近了

我想在表格底部添加 longtabu 标题。我知道这不好。但我被告知要这样做。当我按照代码示例中的方式执行此操作时,标题离表格太近了。但标题后面有一个很大的垂直空间。

我也使用过 \captionsetup[longtable]{skip=10pt}。但是没有用。

\documentclass[a4paper,12pt, oneside]{book}

%tweek font spacing for better look
\usepackage{microtype}

%enable linespacing commands%
\usepackage{setspace}

%enable H option that prevent figure floats
\usepackage{float}

%used to import graphics%
\usepackage{graphicx}

%used for referencing%
\usepackage{harvard}

%customise chapter styles%
\usepackage{titlesec}

%set margins%
\usepackage[left=2.8cm,right=2.8cm,top=2.8cm,bottom=2.8cm]{geometry}

%allows to create tables with different column widths%
\usepackage{tabularx}

%allows to create tables that can span across pages%
\usepackage{longtable}%dependency of longtabu (bug fix patch applied)
\usepackage{tabu}%contains longtabu

%enable table row colors
\usepackage{color, colortbl}
%\usepackage[table]{xcolor}

%enable listing customizations
\usepackage{listings}

%enable pyglist code blocks
\usepackage{verbments}

%enables itemize space customization options
\usepackage{enumitem}

%enable caption customizations ie:\captionsetup
\usepackage{caption}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{stablecell}{
\begin{minipage}{\linewidth-1pt}
\vspace{2mm}
}{
\vspace{1mm}
\end{minipage}
}

\newenvironment{spackenum}{
\begin{enumerate}[noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt,leftmargin=*]
}{
\end{enumerate} 
}

\newenvironment{spackitems}{
\begin{itemize}[noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt,leftmargin=*]
}{
\end{itemize} 
}

\newenvironment{snomargitems}{
\begin{itemize}[leftmargin=*]
}{
\end{itemize}
}

\newenvironment{scode}{\captionsetup{type=listing}}{}

\newcommand{\shrule}{\vspace{1mm}\hrule\vspace{2mm}}

%========================================

\newcommand{\cgui}{\textit{CGui}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\definecolor{gray}{gray}{0.9}

%keep only the page number%
\pagestyle{plain}

%set onehalf line spacing
\onehalfspacing

%customise chapter styles from titlesec%
\titleformat{\chapter}{}{}{0em}{\bf\LARGE}

%set bibliography listing style to agsm%
\bibliographystyle{agsm}

%monospace font in listing
\lstset{basicstyle=\ttfamily\small,
captionpos=b,tabsize=4}

\captionsetup[longtable]{skip=10pt}

\begin{document}




%%%%%%%%%%%%%%%% Table Start %%%%%%%%%%%%%%%%%%%%
\begin{longtabu} to \textwidth { |>{\columncolor{gray}}X[1, l] | X[4 , l ]| }
%%%%%%%%%%%%%%%% Heading Start %%%%%%%%%%%%%%%%%%
\hline
\endfirsthead
%==============================================
%Next page headings
\hline
\endhead
%==============================================
%Before page break text
%\multicolumn{2}{r}{Continued on next page} \\
\endfoot
%==============================================
\hline
\caption[xxxx xxx xxx xxx xxxx xxxxxxx xxxxx xxxx xxxxx]
{xxxx xxx xxx xxx xxxx xxxxxxx xxxxx xxxx xxxxx}
\label{table:xxxx_xxx_xxxx}\\
\endlastfoot
%%%%%%%%%%%%%%%% Heading End %%%%%%%%%%%%%%%%%%
%\hline
\textbf{xxxxxxxxx}
& xxxx xxx xxx xxx xxxx xxxxxxx x xxx xxxx xxxxxxx xxxxx xxxx xxx xxxxx xxxx xxxxx \\
%==============================================
\hline
\textbf{xxxxxxxxx}
& xxxx xxx xxx xxx xxxx xxxxxxx x xxx xxxx xxxxxxx xxxxx xxxx xxx xxxxx xxxx xxxxx \\
%%%%%%%%%%%%%%%%% Body End %%%%%%%%%%%%%%%%%%%%
\end{longtabu}
%%%%%%%%%%%%%%%% Table End %%%%%%%%%%%%%%%%%%%%
\paragraph{}
xxxxx xxxx xxxx xxxxx xxxx xxxxx xxxx xxxx


\end{document}

相关内容