2

As the following code shows, it will label an 'a' and 'b' under each picture. How can I put the label at the left-top corner of each figure?

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{caption}

\begin{document}

\begin{figure}[!ht]
  \captionsetup[subfigure]{labelformat=simple}
  \centering
  \subfloat[]{\includegraphics[width=.4\textwidth]{Paris}}\quad
  \subfloat[]{\includegraphics[width=.4\textwidth]{Paris}}
  \caption{Caption about here}
  \label{fig:fig1}
\end{figure}

\end{document}

I have no right to upload pictures, so I did the following sketch map. I hope they can help to express what I mean.

what I get:

------------     -------------
-          -     -           -
-  fig1    -     -   fig2    -
-          -     -           -
------------     -------------
    a                 b
 Figure 1: Caption about here

What I want:

A                B
------------     -------------
-          -     -           -
-  fig1    -     -   fig2    -
-          -     -           -
------------     -------------
Figure 1: Caption about here

How can I do this?

3

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[position=t,singlelinecheck=off]{subfig}
\usepackage{caption}

\renewcommand\thesubfigure{\Alph{subfigure}}

\begin{document}

\begin{figure}[!ht]
  \captionsetup[subfigure]{labelformat=simple}
  \centering
  \subfloat[]{\includegraphics[width=.4\textwidth]{Paris}}\quad
  \subfloat[]{\includegraphics[width=.4\textwidth]{Paris}}
  \caption{Caption about here}
  \label{fig:fig1}
\end{figure}

\end{document}

For more information about the changes I made just take a look at the subfig package documentation.

  • I imagine this would be quite easy using (your) subcaption package too. – cmhughes Aug 18 '11 at 22:52
  • Yes, it's the same for subcaption, \subfloat just need to be replaced by \subcaptionbox. – Axel Sommerfeldt Aug 19 '11 at 7:03

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.