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.

I am making a poster and I saw that sciposter is a very good poster class with the ability to process eps figures. Also I found that sciposter can handle \psfrag commands used to add labels on figures. I require this feature in my work. However I am having trouble to include subfigures as I normally do in a normal article class document. The example in the package sciposter comes with an example showing how to include subfigures, but I still want to use the subfig package as I normally do. Here is a minimal code:

\documentclass{sciposter}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multicol}

\usepackage{graphicx}
\usepackage{subfig}
\usepackage{caption}
\captionsetup{labelsep=period}
\captionsetup[subfloat]{captionskip=15pt}
%\usepackage{xcolor}
\usepackage{psfrag}

\title{Generalized Pattern Spectra Sensitive to Spatial Information}

\author{Michael H. F. Wilkinson}

\institute{Institute for Mathematics and Computing Science,\\
       University of Groningen\\}

\email{michael@cs.rug.nl}  % shows author email address below institute

\begin{document}

\conference{{\bf ICPR 2002}, 16th International Conference on Pattern
Recognition, 11-15 August 2002, Qu\'ebec City, Canada}

\maketitle

%%% Begin of Multicols-Enviroment
\begin{multicols}{3}

\section{Introduction}

\begin{figure}[htp]
\centering{
\subfloat[Good stiffness ratio $\overline{k}=0.2$]{
     \label{fig:subfig:first figure}
      \input{k02bb.tex}
  \includegraphics[width=0.48\columnwidth]
  {k02bb.eps}}
\hfill
\subfloat[Bad stiffness ratio $\overline{k}=0.3$]{
     \label{fig:subfig:second figure}
     \input{k02bb.tex}
  \includegraphics[width=0.48\columnwidth]
  {k02bb.eps}}
   \caption{Test figure}
     \label{fig:stiffgoodbad}}
\end{figure}


\end{multicols}

\end{document}

The above file is adapted from the example file sciposter-example.tex that comes with the package. The only difference is that I am using \subfloat from the subfig package and that my figures are each in two files: 1 eps for the drawing and 1 tex files for the labels. This is how I normally do it when using Matlab and Laprint. On compiling the above I get the error message:

! LaTeX Error: \subfloat outside float.

l.50 \subfloat
              [Good stiffness ratio $\overline{k}=0.2$]{
?     

I don't get this error with \subfloat when using the normal article or book class. What am I doing wrong here and why does it not work with sciposter?

Update: The files k02bb.tex and k02bb.eps can be downloaded from here:

I've closed the link. Contact me if you want the files.

There is an additional tex file: testforfigure.tex that is for a normal article class to test if combination of k02bb.tex and k02bb.eps works.

Even if we take away the two lines \input{k02bb.tex} in the code that I put above, I still get the same error message. It seems that Sciposter can't handle \subfloat well.

Thanks a lot...

share|improve this question
    
Can you build an example that doesn't depend on external files? –  Thorsten Donig Jan 13 '11 at 18:07
    
Thanks. The sciposter-example.tex included with the package works fine and figures are included. I also tested a figure with \psfrag commands and it works fine. \subfloat is giving problems. By external files, do you mean my figures? –  yCalleecharan Jan 13 '11 at 18:14
    
@yCalleecharan: I've marked your inline code with backticks `. –  Hendrik Vogt Jan 13 '11 at 18:26
    
@yCalleecharan: Graphics files are not the problem. They can be ignored with the »demo« option for the graphicx package. But there are others like k02bb.tex which we don't have. –  Thorsten Donig Jan 13 '11 at 18:30
    
@Hendrik Vogt : Thanks. I didn't know how to do this. –  yCalleecharan Jan 13 '11 at 18:30
show 8 more comments

1 Answer

up vote 4 down vote accepted

Since the sciposter document class provides its own figure code the subfig package does not recognize the figure as floating environment.

So using \captionsetup{type=figure} as first line of the figure which contains subfigures should make \subfloat work, i.e.

\begin{figure}[htp]
\captionsetup{type=figure}% tell subfig package that this is a figure
...
share|improve this answer
    
Thank you very much. This works very nicely indeed. 1 vote up also. –  yCalleecharan Jan 13 '11 at 20:44
add comment

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.