28

Can anyone tell me how to change the horizontal position of subfigure labels?

I have:

 \captionsetup[subfigure]{labelformat=simple,position=top}

Is there something like:

 {position=topleft}

to place the label in the top left corner of my subfigures? Thanks

1
  • 1
    Welcome to TeX.SE! Hint: you can highlight code either by pressing the {} button above the edit window or by indenting with 4 spaces, or for inline code check here.
    – Count Zero
    Jul 27, 2012 at 16:23

2 Answers 2

20

Here's one possible solution using the floatrow and subfig packages:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\usepackage{subfig}

\begin{document}

\floatsetup[figure]{style=plain,subcapbesideposition=top}
\begin{figure}
  \sidesubfloat[]{\includegraphics{image1}\label{fig:sub1}}\quad%
  \sidesubfloat[]{\includegraphics{image2}\label{fig:sub2}}%
  \caption{Two subfigures with their caption beside}\label{fig:test}
\end{figure}

\end{document}

enter image description here

2
  • How do I get subcaptions as well?
    – user29730
    Apr 26, 2013 at 10:00
  • @MLT although related to the original question, your requirement can't be tackled with the approach mentioned in my answer (the question only asks for labels and that's exactly what \sidesubfloat does; it places the labels beside the subfigures). The best thing to do would be for you to ask a follow-up question. Apr 26, 2013 at 13:29
14

A simple way of doing it is to use singlelinecheck=off and justification=raggedright together. Below is an example that creates a bolded caption with left alignment for subfigures only:

  • singlelinecheck=off means that the justification setting is used even when the caption is only a single line long.
  • if singlelinecheck=on, then caption is always centered when the caption is only one line.
  • caption label is bold, the caption text normal.
  • justification is raggedright (i.e. left aligned)

\captionsetup[subfigure]{position=top, labelfont=bf,textfont=normalfont,singlelinecheck=off,justification=raggedright}

The above will place the caption on top of the figure left aligned. It will not place it on the side as Gonzalo example did, but I think this is what the original question was about

You must log in to answer this question.

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