das Problem mit dem Paket Subfloat

das Problem mit dem Paket Subfloat

Ich möchte Bilderpaare mit einer gemeinsamen Beschriftung in „subfloat“ einfügen, erhalte aber eine Fehlermeldung. Kann mir bitte jemand bei diesem Problem helfen? Hier ist mein Code:

\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}

Antwort1

Sie sollten die Miniseite habeninnen \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}

Die demoOption und der \setkeysBefehl dienen lediglich zum Erstellen eines Images, da ich Ihre Images nicht habe.

Bildbeschreibung hier eingeben

verwandte Informationen