图像插入错误

图像插入错误

我有一个两列布局。我使用ACM TOG 模板。我想插入两个图像作为子图,并排对齐,跨越两列。图像插入彼此之下

我怎样才能解决这个问题?

我使用这个代码:

%%%%%%%%%%%%%% 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*}
%%%%%%%%%%%%%%

这是我的序言:

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

我得到的错误是(来自日志):

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.

编辑:

这对我有用(必须使用 subfig 和 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*}
%%%%%%%%%%%%%%

答案1

包的子图subfigure不是开始-结束环境。请参阅 MWE 并将frameboxs 替换为您的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}

相关内容