Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

\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.

share|improve this answer
    
Thank you very much. It works very well. So excited. –  ct586 Aug 18 '11 at 12:58
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.