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.

When using this class: http://daviddoria.com/Uploads/acmtog.cls

I am trying to place a figure* right under the title/authors. I tried this:

\documentclass{acmtog}
\pdfminorversion=5

\usepackage{float}
\usepackage{graphicx}
\usepackage[caption=false,format=hang]{subfig} % needed for \subfloat. caption=false fixes: ``Unsupported document class (or package) detected, (caption) use of the caption package is not recommended''. format=hang makes the hanging indention in the figure captions look correct.
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{algpseudocode}
\usepackage{algorithm}
\usepackage{lipsum}

\acmVolume{VV}
\acmNumber{N}
\acmYear{2012}
\acmMonth{April}
\acmArticleNum{XXX}
\acmdoi{10.1145/XXXXXXX.YYYYYYY}

\begin{document}

\title{My paper}

\author{Me {\upshape and} My Friend
\affil{Affiliation}}

\maketitle

\begin{bottomstuff}

Authors' addresses: 
\end{bottomstuff}

\def\BannerFigSize{.25}
\begin{figure*}[ht!]
\centering
\subfloat[a.]
  {
  \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} }
  \label{fig:banner:scene}
  }
\subfloat[b.]
  {
  \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} }
  \label{fig:banner:strokes}
  }
\caption{Our algorithms.}
\label{fig:banner}
\end{figure*}


\lipsum[1-4]

\end{document}

But the figure appears on the next page. I also tried [H] placement (from the float package) but that seems to make the image disappear entirely. Is there a better way to do this?

share|improve this question
1  
Don't use the environment figure. Use instead center in combination with captionof. –  Marco Daniel May 1 '12 at 15:09
    
@Marco Daniel - How do you make subfigures in a 'center' environment? I tried this but it doesn't work: \def\BannerFigSize{.25} \begin{center} \subfloat[a.] { \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} } \label{fig:banner:scene} } \subfloat[b.] { \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} } \label{fig:banner:strokes} } \caption{Our algorithms.} \label{fig:banner} \end{center} –  David Doria May 1 '12 at 15:15
    
I wrote an example. –  Marco Daniel May 1 '12 at 15:24

1 Answer 1

up vote 3 down vote accepted

As I wrote in the comment you should use the environment center instead of a floating one. However my system doesn't know your document class so I can't provide a general solution. Use the package caption which allows setting a type. So at the beginning of center write \captionsetup{type=figure}.

\documentclass{article}
\usepackage{graphicx}
\usepackage[caption=false,format=hang]{subfig} 
\usepackage{caption}
\begin{document}
\def\BannerFigSize{.25}
\begin{center}
\captionsetup{type=figure}
\subfloat[a.]
  {
  \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} }
  \label{fig:banner:scene}
  }
\subfloat[b.]
  {
  \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} }
  \label{fig:banner:strokes}
  }
\caption{Our algorithms.}
\label{fig:banner}
\end{center}
\end{document}

The class uses special definitions of caption so you can do the following: I defined the command \captiontype{} so that you can use it inside an environment.

\newcommand*\captiontype[1]{\def\@captype{#1}}

In your case simple \captiontype{figure}

\documentclass{acmtog}
\usepackage{graphicx}
\usepackage[caption=false,format=hang]{subfig} 
\makeatletter
\newcommand*\captiontype[1]{\def\@captype{#1}}
\makeatother
\begin{document}
\def\BannerFigSize{.25}
\begin{center}
\captiontype{figure}
\subfloat[a.]
  {
  \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} }
  \label{fig:banner:scene}
  }
\subfloat[b.]
  {
  \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} }
  \label{fig:banner:strokes}
  }
\caption{Our algorithms.}
\label{fig:banner}
\end{center}
\end{document}
share|improve this answer
    
Your solution does work as is. However, when I try it with acmtog.cls, I get "\subfloat outside float". When you say "my system doesn't know your document class" - is there something more than dropping this file: daviddoria.com/Uploads/acmtog.cls in the same directory? Thanks for your help so far! –  David Doria May 1 '12 at 15:27
    
@DavidDoria: See my update –  Marco Daniel May 1 '12 at 15:37
    
Awesome, that seems to do it, thanks! –  David Doria May 1 '12 at 15:41
    
Actually... @Marco Daniel I'm not sure why in the demo acmtog produces a single column format? Typically it produces a two column format. In which case we have to span the columns. figure* does that, but center* does not seem to. Is there an easy fix? –  David Doria May 1 '12 at 15:48
    
@DavidDoria: Not really. Why do you have twocolumn? –  Marco Daniel May 1 '12 at 16:39

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.