I have some code that used to work correctly on some other machine, but I currently have an issue with subfloat captions: They appear next to the image (on the left side) instead of below. Here is a minimal exemple:
\documentclass[a4paper,twoside,12pt]{memoir}
\usepackage{graphicx}
\usepackage{float}
%\usepackage{subfig}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\subfloat[subcap 1]{\includegraphics[width=0.48\linewidth]{example-image-a}}
\subfloat[subcap 2]{\includegraphics[width=0.48\linewidth]{example-image-b}}
\caption{caption}
\end{figure}
\end{document}
And here is the result:
I managed to get the result I want using the subcaption package, with the following syntax:
\begin{figure}
\centering
\begin{subfigure}{0.48\linewidth}
\includegraphics[width=\linewidth]{example-image-a}
\caption{subcap 1}
\end{subfigure}
\end{figure}
With subfig, it works as expected. But I have a very big document, with other commands that are specific to subcaption. I don't want to have to change everything if I can help it... I'm getting confused between all different subfloat packages. I only find information on subfig or subcaption.
What can I do?
Thanks!
subcaption
orsubfig
).subcaption
package. The output seems ok. I am not sure but maybe there are some other issues. You may try to reproduce the error and show here.\begin{subfigure}
by\begin{minipage}
. I have a document very similar to what I expect with mininal changes to the code. But still, I would be interested to understand where my problem comes from. I just installed the latest version of MikTeX, and I am using a recent install of TexMaker as well, which downloads package automatically. If it can help...subcaption
package tells us that it provides a command\subfloat
for compatibility reasons that should behave exactly like the macro with the same name from thesubfig
package, as of TeXLive 2021, this seems not to work. With older installations, however, it works. I don't exactly know why this is.