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 have a two collumn layout. I work with the ACM TOG template. I want insert two images as subfigures aligned next to each other, spanning two columns. The images are inserted under each other

How can i fix this?

I use this code:

%%%%%%%%%%%%%% Image: sensor suit
\begin{figure*}[t]
\begin{center}
    \label{image:suit}
        \begin{subfigure}[t]{\textwidth}
                \label{im:device_front}
        \includegraphics[width=0.39\textwidth]{images/device_front}
        \caption{Frontal view of the sensor system}
    \end{subfigure}
                \quad
                \quad
    \begin{subfigure}[t]{\textwidth}
                \label{im:device_side}
        \includegraphics[width=0.39\textwidth]{images/device_side}
        \caption{Side view of the sensor system}
    \end{subfigure} 
\caption{Overview of the body sensor network as worn by the subjects}
\label{default}
\end{center}
\end{figure*}
%%%%%%%%%%%%%%

This is my preamble:

\documentclass{acmtog}
\usepackage{paralist}
\usepackage{graphicx}
\usepackage[width=0.48\textwidth]{caption}
%\usepackage{subcaption}
\usepackage{subfigure}
...

The error i get is (from the log):

Underfull \vbox (badness 5862) has occurred while \output is active []


./thesis_ACM_format_final.tex:182: Missing number, treated as zero.
<to be read again> 
                   }
l.182         \begin{subfigure}[t]{\textwidth}

? 
./thesis_ACM_format_final.tex:182: Illegal unit of measure (pt inserted).
<to be read again> 
                   }
l.182         \begin{subfigure}[t]{\textwidth}

? 

Overfull \hbox (8.8799pt too wide) in paragraph at lines 182--182
[]\OT1/ptm/m/n/8 (a)
 []


Overfull \hbox (2.22392pt too wide) in paragraph at lines 182--182
\OT1/ptm/m/n/8 t 
 []

<images/device_front.jpg, id=10, 4336.2pt x 3252.15pt>
File: images/device_front.jpg Graphic file (type jpg)

<use images/device_front.jpg>
Package pdftex.def Info: images/device_front.jpg used on input line 184.
(pdftex.def)             Requested size: 196.5597pt x 147.38254pt.

./thesis_ACM_format_final.tex:189: Missing number, treated as zero.
<to be read again> 
                   }
l.189   \begin{subfigure}[t]{\textwidth}

? 
./thesis_ACM_format_final.tex:189: Illegal unit of measure (pt inserted).
<to be read again> 
                   }
l.189   \begin{subfigure}[t]{\textwidth}

? 

Overfull \hbox (8.8799pt too wide) in paragraph at lines 189--189
[]\OT1/ptm/m/n/8 (a)
 []


Overfull \hbox (2.22392pt too wide) in paragraph at lines 189--189
\OT1/ptm/m/n/8 t 
 []

<images/device_side.jpg, id=11, 4336.2pt x 3252.15pt>
File: images/device_side.jpg Graphic file (type jpg)

<use images/device_side.jpg>
Package pdftex.def Info: images/device_side.jpg used on input line 191.
(pdftex.def)             Requested size: 196.5597pt x 147.38254pt.

EDIT:

This worked for me (had to use subfig and subfloat):

%%%%%%%%%%%%%% Image: sensor suit
\begin{figure*}[t]
\begin{center}
    \label{image:suit}
        \subfloat[Frontal view of the sensor suit as worn by the subject]{\includegraphics[width=0.45\textwidth]{images/device_front}}
    \quad
    \quad
    \quad
        \subfloat[Side view of the sensor suit as worn by the subject]{\includegraphics[width=0.45\textwidth]{images/device_front}}
    \caption{Overview of the body sensor network as worn by the subjects}
\label{default}
\end{center}
\end{figure*}
%%%%%%%%%%%%%%
share|improve this question
1  
subfigure is obsolete and subfig is its successor; there has never been a subfigure environment, but only a \subfigure command. With subfig there is \subfloat. –  egreg Aug 13 '12 at 12:19

1 Answer 1

up vote 2 down vote accepted

Subfigures of subfigure package are not begin-end environments. Please see the MWE and replace the frameboxs by your includegraphics.

\documentclass{article}
\usepackage[width=0.48\textwidth]{caption}
\usepackage{subfigure}
\subfigcapmargin = 2em
\begin{document}

    \begin{figure}%
    \centering
    \subfigure[Frontal view of the sensor system]
    {\framebox{... ... Image here ... ...}}
    \quad\quad
    \subfigure[Side view of the sensor system]
    {\framebox{... ... Image here ... ...}}
    \caption{Overview of the body sensor network 
     as worn by the subjects}
    \end{figure}


\end{document}
share|improve this answer

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.