サブ図では、図を同じ行に配置するのに問題があります

サブ図では、図を同じ行に配置するのに問題があります

私はIEEEtran2 列のテンプレートを使用しています。パッケージを使用して\subfigure、各図の幅を に設定し、同じ行 (2 列にまたがる) に 4 つの図を配置したい場合0.24\textwidth、これらの 4 つの図を同じ行に配置することはできません。(以下の LaTeX コードと結果の図を参照してください。)

\begin{figure*}[!t]
  \centering
  \begin{minipage}[htp]{1\textwidth}
  \subfigure[\footnotesize x1.]{
    \includegraphics[width=0.24\textwidth]{x1.eps}
    \label{fig:x1}
  }
  \hfill
  \subfigure[\footnotesize x2.]{
    \includegraphics[width=0.24\textwidth]{x2.eps}
    \label{fig:x2}
  }
  \hfill
  \subfigure[\footnotesize x3.]{
    \includegraphics[width=0.24\textwidth]{x3.eps}
    \label{fig:x3}
  }
  \hfill
  \subfigure[\footnotesize x4.]{
    \includegraphics[width=0.24\textwidth]{x4.eps}
    \label{fig:x4}
  }
  \vspace{-0.2cm}
   \caption{\footnotesize xxxx.}\label{xxxx}
\end{minipage}
\end{figure*}

ここに画像の説明を入力してください

ただし、パッケージを使用しない場合は\subfigure、4 つの数字が 1 行に正しく配置されます。(以下を参照)

   \begin{figure*}[!t]
  \centering
  \begin{minipage}[htp]{0.24\textwidth}
    \centering
    \includegraphics[width=1\textwidth]{x1.eps}
    \vspace{-0.6cm}%
    \caption{\footnotesize x1.}
    \label{fig:x1}
  %\vspace{-0.2cm}%
  \end{minipage}
    \centering
  \begin{minipage}[htp]{0.24\textwidth}
    \centering
    \includegraphics[width=1\textwidth]{x2.eps}
    \vspace{-0.6cm}%
    \caption{\footnotesize x2.}\label{fig:x2}
  %\vspace{-0.2cm}%
  \end{minipage}
   \begin{minipage}[htp]{0.24\textwidth}
    \centering
    \includegraphics[width=1\textwidth]{x3.eps}
    \vspace{-0.6cm}%
    \caption{\footnotesize x3.}
    \label{fig:x3}
  %\vspace{-0.2cm}%
  \end{minipage}
    \centering
  \begin{minipage}[htp]{0.24\textwidth}
    \centering
    \includegraphics[width=1\textwidth]{x4.eps}
    \vspace{-0.6cm}%
    \caption{\footnotesize x4.}\label{fig:x4}
  %\vspace{-0.2cm}%
  \end{minipage}
  \vspace{-0.3cm}%
\end{figure*}

ここに画像の説明を入力してください

同じ幅なのにフォーマットが異なるのはなぜですか?

編集: TEX および EPS ファイルをここにアップロードしました:http://pan.baidu.com/share/link?shareid=1594110695&uk=3776487005、MWE を構成するファイルです。そのリンクを開いて、下図のボタンをクリックしてダウンロードしてください。(開いたページは中国語になります。)

ここに画像の説明を入力してください

答え1

の内側ではsubfigure水平モードになっているので、線の端から逃げないように注意する必要があります。

\subfigure[\footnotesize x1.]{
  \includegraphics[width=0.24\textwidth]{x1.eps}
  \label{fig:x1}
}

行が で終わらない場合は毎回追加のスペース文字を挿入します%。これにより、ボックスが行をオーバーフローするのに十分なスペースが挿入されます。以下を参照してください。

\documentclass[a4paper]{article}
\usepackage[draft]{graphicx}
\usepackage{subfigure}
\begin{document}
\begin{figure*}
  \centering
  \subfigure[x1.]{%
    \includegraphics[width=0.24\textwidth]{x1.eps}%
    \label{fig:x1}%
  }%
  \hfill
  \subfigure[x2.]{%
    \includegraphics[width=0.24\textwidth]{x2.eps}%
    \label{fig:x2}%
  }%
  \hfill
  \subfigure[x3.]{%
    \includegraphics[width=0.24\textwidth]{x3.eps}%
    \label{fig:x3}%
  }%
  \hfill
  \subfigure[x4.]{%
    \includegraphics[width=0.24\textwidth]{x4.eps}%
    \label{fig:x4}%
  }%
  \caption{xxxx.}
  \label{xxxx}
\end{figure*}
\end{document}

ちなみに、各キャプション内のフォント サイズを手動で変更しないでください。captionパッケージ (など) を使用して、ドキュメント全体でこれを自動的に実行します。

関連情報