Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Style requirements for a dissertation require a single-spaced caption but with a double space between the table number and caption like so:

Table 1.

Table caption goes here, and is single spaced.

I cannot figure out how to change this. Below is mwe, if anyone has any ideas I'd be grateful.

\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}
share|improve this question
    
I would definitely use more options than just t for float placement, at least until you're done with the document and can then tinker with float placement once you've finished all of your content. See, for example, this answer. –  Adam Liter Jul 13 at 4:15

1 Answer 1

The caption package defines a macro called \DeclareCaptionLabelSeparator, which takes two arguments. The first argument is the name of the label separator, and the second argument is what you want the separator to actually be.

So, you can declare your own label separator to use instead of the newline separator, which will then allow you to retain setting the font option to singlespacing (or just omitting it, since this is the default behavior, even if you declared \doublespacing from the setpsace package in your preamble).

(Note also that there is no need to set aboveskip to 0pt in a separate call to \captionsetup. You can do it all at once.)

\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}

enter image description here

Also, in the future, please try to make your MWE as minimal as possible. There were some gratuitous packages in the code you provided.

share|improve this answer
    
Thanks Adam that's perfect. I see by commenting out that I could have only included documentclass, setspace, and ctable, and should have done that. –  Tim Jul 13 at 11:19
    
@Tim I'm glad it worked! :) And it's not that big deal in this case, about the MWE, but there might be future cases where gratuitous packages are affecting the behavior of something in non-obvious ways, which is why it's best to try to reproduce the problem with as minimal of code as possible. At any rate, glad things are working! –  Adam Liter Jul 14 at 20:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.