TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having some troubles with captions in longtable tables. I'm trying to typset for a thesis (so am using a class that I didn't write) and my school requires double spacing for body text but single spacing for caption text. To the best that I can determine via google, longtable formats its captions with the formatting specified in the class. I'm using some normal tables and some longtable tables, so the caption formatting is different between tables, which looks odd...

I've found an answer to my almost exact question here but when I try to utilize the answer suggested there, I get an error saying that the "caption" package is not recommended for use and unsupported. That answer was published a few years ago so I'm not really sure what has changed since then.

Anyways, any help would be much appreciated! I'm a pretty basic latex user so appreciate any examples that I can cut/paste/fiddle so I can learn. Thanks!

share|improve this question
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. – karlkoeller Mar 7 '14 at 5:16
Which class you are using? Can you provide a link to that class file? – Harish Kumar Mar 7 '14 at 5:41
up vote 7 down vote accepted

I don't know what document class you are using, but reading your question it surely loads setspace and uses \doublespacing.

A way to avoid loading the caption package to customize the longtable caption spacing is to load the etoolbox package and put the following line in your preamble:


In this way you will have single spacing inside all your longtables.

Note also the line


to make the longtable caption span over the whole line

\usepackage{lipsum} % just for the example






        1 & 1 & 1 & 1\\
        1 & 1 & 1 & 1
    \caption{Table very very very very very very very very very very very very very long caption}

    1 & 1 & 1 & 1\\
    1 & 1 & 1 & 1\\
    \caption{Longtable very very very very very very very very very very very very very long caption}




enter image description here


If you get any error, it means that your document class doesn't load setspace.

In this case, replace the line




and it should be fine.

share|improve this answer
Thanks for this! This is great, and it fixes the minimal working example that I had prepared. Unfortunately, when I try to apply it to my project, it throws an error, saying "! Undefined control sequence. \@begin@longtable@hook ->\singlespacing \begin{longtable}" – Tim Mar 7 '14 at 9:04
@Tim See the edited answer. – karlkoeller Mar 7 '14 at 11:03
YES! This works perfectly :) Thank you so much for your help! – Tim Mar 7 '14 at 23:11

Your Answer


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.