论文中的表格标题间距

论文中的表格标题间距

论文的风格要求标题为单倍行距,但表格编号和标题之间有双倍行距,如下所示:

表格1。

表格标题放在此处,单倍行距。

我不知道该如何改变这一点。下面是 mwe,如果有人有任何想法,我将不胜感激。

\documentclass[12pt,letterpaper]{report}  
\usepackage[latin1]{inputenc}
\usepackage{setspace}
\doublespacing
\usepackage{tabulary}
\usepackage{tabularx}
\usepackage{ctable}

% from http://tex.stackexchange.com/questions/80494/changing-style-of-table-caption
% this code sets the table caption text to be italic and on new line from table number, singlelinecheck=off makes it align left
 \usepackage{caption}
\captionsetup[table]{
font=doublespacing, 
  labelsep=newline,
 % justification=left,
 singlelinecheck=off,
  textfont=it,
}
 \captionsetup[table]{aboveskip=0pt} % adjusts position of caption to get it closer to top rule of tables

\begin{document}
\begin{table}[t]
\caption[Study Schools]{Numbers of schools and teachers in east-central Florida middle schools, teaching grades 7--9 science.}\label{tab:schools}
\begin{tabular}{l r r}                      
\toprule
County & Number of Schools & Number of Teachers (approx.)  \\
\midrule
Brevard      &  16 &  80 \\
Indian River &   8 &  40 \\
Orange       &  38 & 190  \\
Osceola      &  10 &  50 \\
Seminole     &  12 &  60 \\
Volusia      &  19 &  95 \\
Total        & 103 & 515 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

答案1

caption包定义了一个名为的宏\DeclareCaptionLabelSeparator,它接受两个参数。第一个参数是标签分隔符的名称,第二个参数是您希望分隔符实际是什么。

因此,您可以声明自己的标签分隔符来代替newline分隔符,然后您可以保留设置选项fontsinglespacing或者只是省略它,因为这是默认行为,即使您\doublespacingsetpsace序言中的包中声明)。

(还请注意,无需在单独调用时aboveskip设置为。您可以一次性完成所有设置。)0pt\captionsetup

\documentclass[12pt,letterpaper]{report}  

\usepackage{caption}

\DeclareCaptionLabelSeparator{twolines}{\newline\newline}

\captionsetup[table]{
labelsep=twolines,
textfont=it,
singlelinecheck=off,
aboveskip=0pt
}

\begin{document}

\begin{table}[htpb]
\caption[Study Schools]{Numbers of schools and teachers in east-central Florida middle schools, teaching grades 7--9 science.}\label{tab:schools}
\begin{tabular}{l r r}                      
\hline
County & Number of Schools & Number of Teachers (approx.)  \\
\hline
Brevard      &  16 &  80 \\
Indian River &   8 &  40 \\
Orange       &  38 & 190  \\
Osceola      &  10 &  50 \\
Seminole     &  12 &  60 \\
Volusia      &  19 &  95 \\
Total        & 103 & 515 \\
\hline
\end{tabular}
\end{table}

\end{document}

在此处输入图片描述

此外,在未来,请尝试让你的 MWE 成为最小尽可能。您提供的代码中有一些免费的包。

相关内容