latexsubfigure

subfig - not plotting figures


I would like to refresh this thread: Subfigs of a figure on multiple pages. I am struggling with reproduction. I have used suggestions on this post and I have used subfig docs. Unfortunately, neither works.

%Packages which I am using:
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subfig}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{figure}
  \centering 
  \subfloat[]{figures/fig1.pdf} 
  \qquad 
  \subfloat[]{figures/fig2.pdf} 
  \caption{Caption nr 1.}
  \label{fig:figure1_2}
\end{figure}

\begin{figure}
  \ContinuedFloat 
  \centering 
  \subfloat[]{figures/fig3.pdf}% 
  \qquad 
  \subfloat[]{figures/fig4.pdf} 
  \caption[]{Caption nr 2}
  \label{fig:fig3_4}
\end{figure} 
\end{document}

The output of it is a page with directories of figures displays accordingly without a figure itself.

Please let me know if something I missed.


Solution

  • You need to include the images with \includegraphics:

    \documentclass{article}
    
    %Packages which I am using:
    \usepackage{graphicx}
    \usepackage{caption}
    \usepackage{subfig}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \begin{document}
    \begin{figure}
      \centering 
      \subfloat[]{\includegraphics[width=5cm]{example-image-duck}} 
      \qquad 
      \subfloat[]{\includegraphics[width=5cm]{example-image-duck}} 
      \caption{Caption nr 1.}
      \label{fig:figure1_2}
    \end{figure}
    
    \begin{figure}
      \ContinuedFloat 
      \centering 
      \subfloat[]{\includegraphics[width=5cm]{example-image-duck}}% 
      \qquad 
      \subfloat[]{\includegraphics[width=5cm]{example-image-duck}} 
      \caption[]{Caption nr 2}
      \label{fig:fig3_4}
    \end{figure} 
    \end{document}
    

    enter image description here