# How can I write a “subcaption” on top of figure using subfigure package. But only in selected subfigure

I'm trying to change bubcaption to the top but can't find a way using subfigure package. Can not add captio/ subcaption package because they crash with subfigure package, and I'm already half way through a very long document. That's what I type:

    \begin{figure}[h]
\centering
\subfigure{A}
\label{subfigure:kinmorfirst}
\hspace{1mm}
\subfigure{B}
\label{subfigure:kindamgofirst}

\caption[Concentration response curve in the presence of 1$\mu$M PMA]{Concentration response curve in the presence of 1$\mu$M PMA (A) Morphine treatment  (B) DAMGO treatment}
\end{figure}


The A or B is in the bottom left, I want them on top left. Thanks

• Welcome to TeX.SX! Please help us to help you and complete your code to create a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Since you are explicitly dependent on particular packages, posting code without those is hardly going to make it easier for people to help you. – cfr Mar 9 '15 at 1:20
• But do note that if you are using this it is considered obsolete.... – cfr Mar 9 '15 at 1:22
• \documentclass[phd,titlesmallcaps, examinerscopy, copyrightpage]{mqthesis} – Marina J Santiago Mar 9 '15 at 2:27
• It's a very long document with many parts to it.\\ It does finish with \end{document} – Marina J Santiago Mar 9 '15 at 2:28
• Please read the link I posted which explains how to construct an MWE. If my answer below does not solve the problem, we cannot do much if we do not have a compilable document we can use to reproduce. I don't have mqthesis.cls and I can only guess what might be in it. Follow the instructions to create an example we can compile here so that we can help you. – cfr Mar 9 '15 at 2:37

Do NOT use this code in new documents. subfigure is deprecated and ought not be used. Instead use subfig or subcaption.

You can use adjustbox to align things:

\usepackage{graphicx,subfigure,adjustbox}
\begin{document}
\begin{figure}[h]
\centering
\mbox{}%
\label{subfigure:kinmorfirst}
\hspace{1mm}
\label{subfigure:kindamgofirst}

\caption[Concentration response curve in the presence of 1$\mu$M PMA]{Concentration response curve in the presence of 1$\mu$M PMA (A) Morphine treatment  (B) DAMGO treatment}
\end{figure}
\end{document}


• The problem is once I remove the package subfigure and add subfig I get hundred errors. Is that common? – Marina J Santiago Mar 9 '15 at 4:11
• Yes, because the syntax to declare a sub figure is different. I would use subcaption. – MaxNoe Mar 9 '15 at 7:23
• @MarinaJSantiago You don't need to remove subfigure to use my solution. I don't understand the problem. – cfr Mar 9 '15 at 12:59
• @cfr You explicitly admonish visitors to not use the subfigure package, so that last comment doesn't make sense. Beyond that, it would also be good if you could actually supply a solution in line with the best-practices you recommend, i.e. using subfig instead of subfigure. – E.P. Aug 31 '16 at 18:42
• @E.P. It makes perfect sense. It is perfectly sensible to say: look, I wouldn't use package X but, if you must, solution Y will work with package X. The reason for providing this solution was that the OP was already a long way into a long document and using subfigure. Without rewriting a lot of existing code, no better option is available. That's why I started with the warning not to use this in new documents. But the OP's document was not new. – cfr Aug 31 '16 at 20:56

Here's one option using the powerful floatrow package in combo with subcaption (subfig could have been an option too); since the labeling is dome automatically, you can easily cross-reference the subfigures:

\documentclass{article}
\usepackage{floatrow}
\usepackage{subcaption}
\usepackage{graphicx}

\renewcommand\thesubfigure{\Alph{subfigure}}

\begin{document}

Some references to Figure~\ref{fig:test} and its subfigures~\ref{sfig:testa} and~\ref{sfig:testb}.
\begin{figure}
capbesideposition={left,top},capbesidesep=space}
\ffigbox[\FBwidth]
{%
\begin{subfloatrow}\useFCwidth
\fcapside[\FBwidth]
{\caption{}\label{sfig:testa}}
{\includegraphics[width=4cm]{example-image-a}}
\fcapside[\FBwidth]
{\caption{}\label{sfig:testb}}
{\includegraphics[width=4cm]{example-image-b}}
\end{subfloatrow}%
}
{\caption{A figure with two subfigures}\label{fig:test}}
\end{figure}

\end{document}


I agree with cfr, you shouldn't use the obsolete subfigure package anymore.

• I'm getting errors per figure I have in the whole document?! – Marina J Santiago Mar 9 '15 at 4:56
• @MarinaJSantiago Of course, you need to replace your \subfigure commands/environments for those of the suggested packages. – Gonzalo Medina Mar 9 '15 at 11:54