[Tex/LaTex] Side by side figures with side captions

floatslabels

I want my figures to be side by side with a side caption, and I thought I had succeeded in doing this until I've realised every time I have two figures side by side it will label this, say, Figure 1, and then the next time I use a figure it will jump a number and say Figure 3! The referencing is all messed up too and says Figure 2b when I want Figure 1b etc… Please please help my project is due in 2 days!

    \begin{document}
    \documentclass[12pt,a4paper]{article}
    \usepackage{graphicx,floatrow,sidecap,caption,subcaption}
\begin{figure}[h]
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=4cm}}]{figure}[\FBwidth]
{\caption {Critical points generated by Mathematica \cite{mathematica}\label{ppex}}}
{\begin{subfigure}[b]{0.32\textwidth}
\centering
\includegraphics[width=\textwidth]{ppex1}
\caption{Saddle point at (0,0)}
\label{ppex1}
\end{subfigure}
\begin{subfigure}[b]{0.32\textwidth}
\centering
\includegraphics[width=\textwidth]{ppex2}
\caption{Centre at (0.5,3)}
\label{ppex2}
\end{subfigure}}
\end{figure}
    \end{document

Best Answer

According to page 90 of the floatrow manual, floatrow is incompatible with sidecap, so loading both packages is likely to cause problems.

Moreover, you are mixing up different things, I think as I don't think floatrow can sort out what you want when the subfigure environment is placed inside a \floatbox. I think you need boxes inside the boxes, so to speak.

Why not follow the example on page 70 instead?

floats and subfloats

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx,floatrow,caption,subcaption}
\begin{document}
  \begin{figure}% example ~p70 of manual for floatrow
    \thisfloatsetup{capbesideposition={right,top},capbesidewidth=4cm}
    \fcapside[\FBwidth]
    {%
      \begin{subfloatrow}
        \ffigbox[0.32\textwidth]{\caption{Saddle point at (0,0)}\label{ppex1}
          \centering
          \includegraphics[width=\linewidth]{example-image-a}}{}
        \ffigbox[0.32\textwidth]{\caption{Centre at (0.5,3)}\label{ppex2}
          \centering
          \includegraphics[width=\linewidth]{example-image-b}}{}
      \end{subfloatrow}
    }{\caption {Critical points generated by Mathematica\label{ppex}}}
  \end{figure}
  \begin{figure}
    \includegraphics[width=.5\textwidth]{tiger}
    \caption{Tiger}
  \end{figure}
\end{document}

Note that it was necessary to add another figure in order to reproduce the problem you asked about. This is what you want your MWE to do. Otherwise, people will compile, shrug and think 'works for me!'. [If they are especially motivated to help, they may tell you this. But they may just assume you need somebody with a specific system to reproduce the issue and move on.]