2

I have another problem with figure caption. I have three figures that should be combined in one. At the bottom of each of them I want to put a simple letter (a), (b) and (c) and at the top of the entire figure I would like to put the title. I tried the following:

\documentclass{article}
\usepackage{graphicx}
\usepackage[labelformat=simple]{subfig}
\begin{document}
    \begin{figure}[h]
    \caption{Main caption \dots}
    \centering
\subfloat[]{\includegraphics[scale=0.5]{example-image-a}\label{fig:a}} \\
\subfloat[]{\includegraphics[scale=0.5]{example-image-b}\label{fig:b}} \\
\subfloat[]{\includegraphics[scale=0.5]{example-image-c}\label{fig:c}}
    \label{fig:myfigure}
    \end{figure}
\end{document}

However the subcaption are at the top and they are not in the bracket - a instead of (a).

Any hint on this? Thanks in advance.

1 Answer 1

2

Please see that you should not place command \label{} as you did in your shown code. command \label should always follow command \caption. I changed that in the following code.

To get the caption at the beginning of the figure simply delete option labelformat=simple for subfig:

\documentclass{article}

\usepackage{graphicx}
\usepackage{subfig} % <=================================================


\begin{document}
\begin{figure}
  \caption{Main caption}
  \label{fig:myfigure} % <==============================================
  \centering
  \subfloat[]{\includegraphics[scale=0.5]{example-image-a}\label{fig:a}} \\
  \subfloat[]{\includegraphics[scale=0.5]{example-image-b}\label{fig:b}} \\
  \subfloat[]{\includegraphics[scale=0.5]{example-image-c}\label{fig:c}}
\end{figure}
\end{document}

and the resulting pdf:

resulting pdf

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .