我必须在长表格下方添加标题,并在表格标题前后留出 12pt 的空白。请在这方面帮助我。
\documentclass[10pt, a4paper, oneside]{article}
\usepackage[hidelinks]{hyperref}
\usepackage{jucs2e}
\usepackage{graphicx}
\usepackage{url}
\usepackage{ulem}
\usepackage{mathtools}
\usepackage{scalerel}
\usepackage{setspace}
\usepackage[strict]{changepage}
\usepackage{caption}
\usepackage[letterspace=-50]{microtype}
\usepackage{fontspec}
\usepackage{afterpage}
\usepackage{ragged2e}
\usepackage{longtable}
\setmainfont{Times New Roman}
\usepackage{titlesec}
\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\normalsize\bfseries}
\renewcommand{\baselinestretch}{0.9}
\graphicspath{{./figures/}}
\usepackage[textwidth=8cm, margin=0cm, left=4.6cm, right=4.2cm, top=3.9cm, bottom=6.8cm, a4paper, headheight=0.5cm, headsep=0.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage[format=plain, labelfont=it, textfont=it, justification=centering]{caption}
\usepackage{breakcites}
\usepackage{microtype}
\apptocmd{\frame}{}{\justifying}{}
\urlstyle{same}
\pagestyle{fancy}
\newcommand\jucs{{Journal of Universal Computer Science}}
\newcommand\jucsvol{vol. 27, no. 1 (2021)}
\newcommand\jucspages{2987-2989}
\newcommand\jucssubmitted{1/1/2021}
\newcommand\jucsaccepted{2/2/2021}
\newcommand\jucsappeared{3/3/2021}
\newcommand\jucslicence{ CC BY-ND 4.0}
\newcommand\startingPage{2987}
\setcounter{page}{\startingPage}
\begin{document}
\begin{longtable}{| p{0.1\textwidth} | p{0.2\textwidth} | p{0.35\textwidth} | p{0.3\textwidth} |}
\hline
{Author} & {Purpose} & {Description} & {Relative Findings} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
{Author} & {Purpose} & {Description} & {Relative Findings} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\multicolumn{4}{c}{} \\
\captionsetup{font=small}
\caption{\fontsize{10pt}{11pt}\selectfont{\itshape{Review Summary of Dashboard Designing}}}
\label{table1}
\endlastfoot
\end{longtable}
\end{document}
答案1
我懒得下载 jucs2e,但是这应该可以解决问题。
在第 3 节(第 4 页)中,手册描述了\caption
longtable 的工作原理,我使用它来更好地控制实际标题并避免\noalign
错误。
\caption@caption
是 caption 包版本\caption
,并且\captionof
仅定义。请注意,表格(position=above)反转了和\@captype
的使用。\abovecaptionskip
\belowcaptionskip
最后,标题下方的间隙有些模糊,所以我在标题后添加了一个\hline
和\hrule
。这显示了标题和表格底部之间的间隙以及表格底部下方的间隙(\intextsep
IIRC)。\abovecaptionskip
根据需要进行调整。
另外,我还将其缩小,\tabcolsep
以便表格可以适合边距。
\documentclass[10pt, a4paper, oneside]{article}
\usepackage[hidelinks]{hyperref}
%\usepackage{jucs2e}
\usepackage{graphicx}
\usepackage{url}
\usepackage{ulem}
\usepackage{mathtools}
\usepackage{scalerel}
\usepackage{setspace}
\usepackage[strict]{changepage}
\usepackage{caption}
\usepackage[letterspace=-50]{microtype}
\usepackage{fontspec}
\usepackage{afterpage}
\usepackage{ragged2e}
\usepackage{longtable}
\setmainfont{Times New Roman}
\usepackage{titlesec}
\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\normalsize\bfseries}
\renewcommand{\baselinestretch}{0.9}
\graphicspath{{./figures/}}
\usepackage[textwidth=8cm, margin=0cm, left=4.6cm, right=4.2cm, top=3.9cm, bottom=6.8cm, a4paper, headheight=0.5cm, headsep=0.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage[format=plain, labelfont=it, textfont=it, justification=centering]{caption}
\usepackage{breakcites}
\usepackage{microtype}
\apptocmd{\frame}{}{\justifying}{}
\urlstyle{same}
\pagestyle{fancy}
\newcommand\jucs{{Journal of Universal Computer Science}}
\newcommand\jucsvol{vol. 27, no. 1 (2021)}
\newcommand\jucspages{2987-2989}
\newcommand\jucssubmitted{1/1/2021}
\newcommand\jucsaccepted{2/2/2021}
\newcommand\jucsappeared{3/3/2021}
\newcommand\jucslicence{ CC BY-ND 4.0}
\newcommand\startingPage{2987}
\setcounter{page}{\startingPage}
\begin{document}
\setlength{\tabcolsep}{\dimexpr (0.05\textwidth-5\arrayrulewidth)/8}% columns totol 0.95\textwidth
\begin{longtable}{| p{0.1\textwidth} | p{0.2\textwidth} | p{0.35\textwidth} | p{0.3\textwidth} |}
\hline
{Author} & {Purpose} & {Description} & {Relative Findings} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
{Author} & {Purpose} & {Description} & {Relative Findings} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline \multicolumn{4}{c}{\parbox{\LTcapwidth}{%
\setlength{\belowcaptionskip}{12pt}% applied above caption
\setlength{\abovecaptionskip}{12pt}% applied below caption
\expandafter\def\csname @captype\endcsname{table}% use caption package
\csname caption@caption\endcsname{Review Summary of Dashboard Designing}
\label{table1}}}\\
\hline
\endlastfoot
some & text & added & here
\end{longtable}
\hrule% show extra space at bottom
\end{document}