Graphics, Figures & TablesSingle spaced captions, 1.5-spaced text

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
xly
Posts: 7
Joined: Fri Mar 06, 2009 4:00 am

Single spaced captions, 1.5-spaced text

Post by xly »

Hi,
I am using a special class set by my university that sets all the text to 1.5 spaced. However, it also sets the captions in tables and figures to 1.5 spacing, even though the university guidelines require them to be single spaced (the class is not well maintained apparently). My question is: how do I set single spacing in captions of tables and figures without having to go though the entire document and put \singlespacing in each caption?

Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Single spaced captions, 1.5-spaced text

Post by localghost »

The current version of the caption package offers an option to explicitely set the line spacing to single space.

Code: Select all

\usepackage[font=singlespacing]{caption}
Since you are using a nonstandard document class, there is not guaranty of full functionality. Refer to the manual of the package to learn more about class support and its capabilities.


Best regards
Thorsten¹
xly
Posts: 7
Joined: Fri Mar 06, 2009 4:00 am

Re: Single spaced captions, 1.5-spaced text

Post by xly »

Hi,
The class of my thesis is based on the report class. When I tried implementing your modification it gave me the error: "Latex error: option clash for package caption."
So I decided that I will add \singlespacing to each figure caption, but that also produced errors of missing {. I have the thesis due tomorrow, and I am looking for any way change the captions to single spaced, even if I have to do it manually. My mistake was that I assumed that the class was well maintained and had all the required formatting.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Single spaced captions, 1.5-spaced text

Post by localghost »

Post your complete preamble and attach your class file or give a link where to find it.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Single spaced captions, 1.5-spaced text

Post by sommerfee »

xly wrote:When I tried implementing your modification it gave me the error: "Latex error: option clash for package caption."
If you load the subfig package additionally, please load the caption package *before* the subfig package. (See also doc of subfig and caption package, the caption package documentation also contains explanations for most warnings and errors which are related to the caption package.)

Regards,
Axel
xly
Posts: 7
Joined: Fri Mar 06, 2009 4:00 am

Re: Single spaced captions, 1.5-spaced text

Post by xly »

Thank you Axel and localghost.
Axel was right, the error was given because I loaded it after the subfig package.
Post Reply