パッケージサブフロートに関する問題

パッケージサブフロートに関する問題

1 つのキャプションを共有する複数の画像を「サブフロート」に挿入したいのですが、エラーが発生しました。この問題について誰か助けていただけませんか? これが私のコードです:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}
  \centering
  % Requires \usepackage{graphicx}
  \begin{minipage}[t]{0.45\textwidth}
  \centering
  \subfloat[~$2\%$~lifetime sparsity]{
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/001.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/002.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/003.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/004.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/005.pdf}\\
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/006.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/007.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/008.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/009.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/010.pdf}\\
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/011.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/012.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/013.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/014.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/015.pdf}\\
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/016.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/017.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/018.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/019.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_02/020.pdf}
  }
 % \vspace{0.15in}
  %\caption{~$2\%$~lifetime sparsity}\label{fig:ROI:fig2}
  \end{minipage}
  \begin{minipage}[t]{0.45\textwidth}
  \centering
  \subfloat[~$5\%$~lifetime sparsity]{
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/001.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/002.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/003.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/004.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/005.pdf}\\
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/006.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/007.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/008.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/009.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/010.pdf}\\
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/011.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/012.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/013.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/014.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/015.pdf}\\
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/016.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/017.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/018.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/019.pdf}\hspace{0.1in}
  \includegraphics[width=0.05\textwidth]{figures/second/0_05/020.pdf}
  }
  %\vspace{0.15in}
  %\caption{~$5\%$~lifetime sparsity}\label{fig:ROI:fig3}
  \end{minipage}
\end{figure}
\end{document}

答え1

ミニページが必要です内部 \subfloat:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}

\setkeys{Gin}{height=0.1\textwidth}% just for the example, remove

  \centering

  \subfloat[$2\%$~lifetime sparsity\label{fig:ROI:fig2}]{%
  \begin{minipage}[t]{0.45\textwidth}
  \centering
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/001.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/002.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/003.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/004.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/005.pdf}\\
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/006.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/007.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/008.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/009.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/010.pdf}\\
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/011.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/012.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/013.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/014.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/015.pdf}\\
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/016.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/017.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/018.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/019.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_02/020.pdf}
  \end{minipage}%
  }\hfil
  \subfloat[~$5\%$~lifetime sparsity\label{fig:ROI:fig3}]{%
  \begin{minipage}[t]{0.45\textwidth}
  \centering
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/001.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/002.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/003.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/004.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/005.pdf}\\
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/006.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/007.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/008.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/009.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/010.pdf}\\
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/011.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/012.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/013.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/014.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/015.pdf}\\
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/016.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/017.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/018.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/019.pdf}
  \includegraphics[width=0.1\textwidth]{figures/second/0_05/020.pdf}
  \end{minipage}%
  }

  \caption{Global caption\label{fig:ROI}}
\end{figure}

\end{document}

オプションdemo\setkeysコマンドは、イメージを持っていないので、イメージを構築するためのものです。

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

関連情報