Graphics, Figures & TablesSingle-spaced caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jpbaker
Posts: 1
Joined: Mon Jun 01, 2009 12:54 am

Single-spaced caption

Post by jpbaker »

I am trying to get single-spacing in captions with double spacing in the main document (see preamble below).

The document class is ucdthesis (see attached), which is a spin-off of ucthesis. Other pertinent information: MikTex 2.7, Texniccenter 1 beta 7.5, building document using pdfLaTex.

I have tried using the caption package with singlespacing as a font option without success (no errors are given, but no modification to caption line spacing). I also found the following post which mentions a similar problem, but does not solve my issue:
Single spaced captions, 1.5-spaced text

Thanks in advance. I have spent hours trying to resolve this issue.

Here is the preamble of my document:

Code: Select all

\documentclass[12pt]{ucdthesis}

\usepackage[pdftex]{graphicx}
\usepackage{mathptmx} 
\usepackage{amsmath}
\usepackage[margin=10pt,font={small,singlespacing,bf},labelfont=bf]{caption} 
\usepackage{subfig}
\usepackage{paralist} 
\usepackage{cite}
\usepackage{xspace}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{booktabs} 
\usepackage{pdfpages} 
\usepackage[intoc,noprefix]{nomencl} 
\usepackage{ifthen}   
\usepackage{verbatim} 

\usepackage[pdftex,plainpages=false]{hyperref} 
\hypersetup{
    colorlinks,%
    citecolor=black,%
    filecolor=black,%
    linkcolor=black,%
    urlcolor=black
}
Attachments
ucdthesis.cls
(46.31 KiB) Downloaded 302 times

Recommended reading 2024:

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

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

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

Single-spaced caption

Post by localghost »

I supplemented your code snippet to a not so minimal working example (MWE) and ran pdflatex on it.

Code: Select all

\documentclass[12pt]{ucdthesis}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage[margin=10pt,font={small,singlespacing,bf},labelfont=bf]{caption}
\usepackage{subfig}
\usepackage{paralist}
\usepackage{cite}
\usepackage{xspace}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{pdfpages}
\usepackage[intoc,noprefix]{nomencl}
\usepackage{ifthen}
\usepackage{verbatim}
\usepackage{blindtext}

\usepackage[pdftex,plainpages=false]{hyperref}
\hypersetup{
    colorlinks,%
    citecolor=black,%
    filecolor=black,%
    linkcolor=black,%
    urlcolor=black
}

\begin{document}
  \blindtext

  \begin{figure}[!ht]
    \centering
    \rule{6.4cm}{3.6cm}
    \caption{\blindtext}
  \end{figure}

  \blindtext
\end{document}
It reproduces the behaviour you described. The log file lists two interesting warnings. The first one comes from the caption package.

Code: Select all

Package caption Warning: Unsupported document class (or package) detected,
(caption)                usage of the caption package is not recommended.
This warnings is succeeded by the information that the internal macro \@makecaption seems to be redefined and so may cause the misbehaviour.

The second warning comes from the subfig package and is more detailed.

Code: Select all

Package subfig Warning: Your document class has a bad definition
 of \endfigure, most likely
 \let\endfigure=\end@float
 which has now been changed to
 \def\endfigure{\end@float}
 because otherwise subsequent changes to \end@float
 (like done by several packages changing float behaviour)
 can't take effect on \endfigure.
 Please complain to your document class author.
Especially the last sentence catches my eye. Looking at the class file you'll find out that it is rather old (1994).

If you have to fulfill special requirements for your work, there may be other document classes which also could do that with some manual adjustments.


Best regards and welcome to the board
Thorsten
Post Reply