2

I am trying to create sub-captions above my side-by-side figures. I want sub-caption to be above the figures and main caption to stay below the figures.

Here is my code:

    \documentclass{article}
    \usepackage{graphicx}
    \usepackage{subfig}
    \usepackage{floatrow}    
    \begin{figure}[htb]
        \subfloat[Caption for sub-figure1]{\includegraphics[clip, trim=0.5cm 0.5cm 1cm 0cm,width=3.5in]{fig1.pdf}}\hspace{-1cm}
        \qquad
        \subfloat[Caption for sub-figure2]{\includegraphics[clip, trim=0.5cm 0.5cm 1cm 0cm, width=3.5in]{fig2.pdf}}\\[-2ex]
        \label{Figure1}
        %\vspace{-2\baselineskip}
        \caption{\scriptsize{Main caption for subfigures 1 and 2. xxxxxx I want to add some notes here.}}
        \end{figure}
\end{document}

And, with the code above,my figures look like enter image description here

How should I modify the code to put only the sub-caption above figures?

Thanks.

4

Load subfig package with position=top option.

\documentclass{article}
    \usepackage{graphicx}
    \usepackage[position=top]{subfig}
    \usepackage{floatrow}    
    \begin{document}
    \begin{figure}[htb]
        \subfloat[Caption for sub-figure1]{\includegraphics[width=.35\linewidth]{example-image-a}}\hspace{-1cm}
        \qquad
        \subfloat[Caption for sub-figure2]{\includegraphics[width=.35\linewidth]{example-image-b}}\\[-2ex]
        \label{Figure1}
        %\vspace{-2\baselineskip}
        \caption{\scriptsize{Main caption for subfigures 1 and 2. xxxxxx I want to add some notes here.}}
        \end{figure}
\end{document}

enter image description here

  • Is it possible to have individual captions change the position? – Bernhard Kleine May 19 '16 at 18:13
  • It's better that you make a new question. It will have more visibility. – Ignasi May 19 '16 at 18:37
  • 2
    @Ignasi: I found the solution already: \captionsetup – Bernhard Kleine May 24 '16 at 13:05

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.