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.

I am trying to use the floatrow package to place to figures side by side in a subfloatrow, while this works fine I have problems following the sugested labeling method from the manual.

On page 73, of the 2009/08/02 version of the english manual of floatrow it reads:

The label command \Flabel can be defined like following:
preamble>
\newseparatedlabel\Flabel{figure}{subfigure}
preamble>

or, for all floats:

preamble>
\makeatletter
\newseparatedlabel\Flabel{\@captype}{sub\@captype}
\makeatother preamble>

However, if I try to define the \Flabel command like that I get an errormessage saying that \newseparatedlabel is undefined.

What is the correct way to label figures in subfloatrows?


MNWE(minimal NON working example):

\documentclass{article}
\usepackage{floatrow}                           %subfigures
\makeatletter
\newseparatedlabel\Flabel{\@captype}{sub\@captype}
\makeatother   
\begin{document}
    \ldots    
\end{document}
share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

I don't know floatrow package at all. For subfigures I use subfig package:

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

\begin{document}
\begin{figure}
  \subfloat[Foo]{\includegraphics[width=.4\textwidth]{foo}\label{fig:foo}}\hfil
  \subfloat[Bar]{\includegraphics[width=.4\textwidth]{bar}\label{fig:bar}}
  \caption{Figures of Foo and Bar}\label{fig}
\end{figure}
Here in fig. \ref{fig} we can see Foo in fig. \ref{fig:foo} and Bar in fig. \ref{fig:bar}.
\end{document}

Here in fig. 1 we can see Foo in fig. 1a and Bar in fig. 1b.

If you want to have "Foo in fig. 1 and Bar in fig. 2" you can use minipage cheat:

\begin{figure}
 \begin{minipage}{.49\textwidth}
  \includegraphics[width=\textwidth]{foo}
  \caption{Foo}\label{fig:foo}
 \end{minipage}\hfil
 \begin{minipage}{.49\textwidth}
  \includegraphics[width=\textwidth]{bar}
  \caption{Bar}\label{fig:bar}
 \end{minipage}
\end{figure}

Edit: Using floatrow you can achieve same result with this code:

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

 \begin{document}

 \begin{figure}[H]
 \ffigbox[\FBwidth]
 {\begin{subfloatrow}
   \sidesubfloat[Foo]{\includegraphics{foo}\label{fig:foo}}%
   \sidesubfloat[Bar]{\includegraphics{bar}\label{fig:bar}}%
   \end{subfloatrow}}
 {\caption{CCC}\label{fig}}
 \end{figure}

 See \ref{fig:foo}.

 \end{document}

For more options see chapter 7.1 in floatrow manual.

share|improve this answer
    
+1 for effort, however I am still looking for the solution with the floatrow package, since it seemed to have more configuration options than subfig when I looked arround and decided which package I want to learn for subfigures. –  ted Jun 27 '13 at 9:20
1  
@ted A good read tex.stackexchange.com/questions/13625/… –  percusse Jun 27 '13 at 10:11
    
@percusse I am not quite seeing the point. While I take from that read that I would use subcaption over subfigsince I use hyperref, I care about floatrow. It seemed to offer some more formating options (sideway captions, frames,...) and I liked the styles system which reminds me of TikZ. If you are trying to suggest for me to use another package, could you please name the advantages/disadvantages? Or am I missing your pont? –  ted Jun 27 '13 at 10:25
    
@ted I've tried floatrow and subfig - see edit. –  Crowley Jun 27 '13 at 11:24
    
@ted You can do those with subcaption too. But it's just a general suggestion. Of course I don't try to make you switch from one to another. caption is very common so better keep in mind that caption has the natural (from the same author) satellite subcaption package if floatrow starts causing trouble. –  percusse Jun 27 '13 at 11:41
show 3 more comments

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.