Trying to get 2 figures, with captions under each one but only counting as a single figure

\caption{First subfigure} \label{fig:1a}
\caption{Second subfigure} \label{fig:1b}
\caption{A figure that contains three subfigures} \label{fig:1}

However it keeps coming out on the next level (it says 3 subfigures but it will only be 2)

enter image description here I understand the following list of packages od theorems and packages is long

\usepackage[margin=0.9in, top=5.3em, bottom=5.3em]{geometry}
\usepackage{mathtools, chngcntr}
  • 2
    Please provide a complete example. Multiple packages define subfigure or can define it, and some of them interconnect if loaded with particular options or in specific combinations. Moreover, you class may also affect this. Basically, anybody who tries to help has to guess what you might have done. Essentially, whistle in the dark. Mysteries can be fun, but this one probably won't be. – cfr Mar 14 '17 at 2:52
  • 1
    To put this another way: your code is absolutely correct, if the rest of your document is a certain way, but how on earth would you expect it to work, if it is a second certain way, and this is only to be expected, if it is a third certain way. Space does not permit a description of the fourth and further possibilities. – cfr Mar 14 '17 at 2:55
  • Would the appropriate thing be now too show you all packages i am currently using? @cfr – Sam Harper Mar 14 '17 at 3:16
  • Make the smallest document you can which demonstrates the problem and post the code. – cfr Mar 14 '17 at 3:49
  • Don't use subfig and subcaption. – cfr Mar 14 '17 at 3:50

For two independent side-by-side figures, you can use two minipages inside a figure enviroment; for two subfigures, I would recommend the subcaption package with its subfigure environment; here's an example showing both approaches:



  \caption{A subfigure}
  \caption{A subfigure}
\caption{A figure with two subfigures}

  \captionof{figure}{A figure}
  \captionof{figure}{Another figure}


enter image description here

The demo option for graphicx was used only to make my example compilable for everyone; you shouldn't use that option in your actual code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.