Subfig package causing Undefined control sequence error

6,538 views
Skip to first unread message

Vittorio

unread,
Oct 30, 2009, 7:47:22 PM10/30/09
to LaTeX Users Group
Hello everyone,

I am having a very hard time trying to add subfigures to my master
thesis. I basically need to place subfigures, where each subfigure has
a label (like (a) and (b)) and the whole figure has a common caption.
Minipage doesn't do the job, since it numbers every subfigure, and I
don't want that.

I tried the subfig package, but I get a nasty error. This is my
preamble:
------------------
\documentclass[letterpaper]{uicthesi}

\usepackage{graphicx}
\usepackage[belowskip=-22pt,aboveskip=0pt]{caption}
\usepackage[cmex10]{amsmath}
\usepackage{amssymb}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{subfig}
-------------------
The documentclass "uicthesi" is the class prepared by the University
of Illinois at Chicago for Masters and PhD thesis.

Long story short, if I comment "\usepackage{subfig}" everything works,
the document is processed by pdflatex correctly. If that line is
uncommented I get this error:

! Undefined control sequence.
\baselinestretch ->\setspace@singlespace

corresponding to a line where there is a caption of an algorithm
created with the packages "algorithm" and "algorithmic".

Why am I getting that error? I got the same error while trying to use
the package "subfigure". I found online that that package was known to
mess with caption, but anyway its use was deprecated, and the use of
"subfig" suggested instead. It seems like that is not working for me.
Can you please help me out?

Thanks a lot

Vittorio

Vahid Damanafshan

unread,
Nov 9, 2009, 12:47:08 PM11/9/09
to latexus...@googlegroups.com
First, you must load subfigure package before \begin{document} and then type these:

\begin{figure}[t]‎

‎\centering \subfigure[Nearest]{\label{fig:Jamshidiyeh:Nearest}\includegraphics[height=73mm]{Images/Nearest.jpg}}‎

‎\hspace{1mm}‎

‎\centering \subfigure[Bicubic]{\label{fig:Jamshidiyeh:Bicubic}\includegraphics[height=73mm]{Images/Bicubic.jpg}}‎

‎\hspace{1mm}‎

‎\subfigure[Freeman]{\label{fig:Jamshidiyeh:Freeman}\includegraphics[height=73mm]{Images/Freeman.jpg}}‎

‎\hspace{1mm}‎

‎\subfigure[This Paper]{\label{fig:Jamshidiyeh:XFus} \includegraphics[height=73mm]{Images/XFus.jpg}}‎

‎\caption{Close-up of results} \label{fig:Jamshidiyeh}‎

‎\end{figure}‎


in this case, you can label each figure
--
--------------------------------------
وحید دامن افشان
Vahid Damanafshan
vdaman...@yahoo.com
vdaman...@gmail.com
Reply all
Reply to author
Forward
0 new messages