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.

How can I skip to a newline in a subfloatrow environment (floatrow package) after two graphics. I want to typeset two graphics A.pdf and B.pdf on the same line, C.pdf and D.pdf should be on a new line. All graphics should be part of the same subfloatrow, considering the labels and captions. I'm missing part of the floatrow concept so I tried silly things like introducing newlines (\\ and \newline) which of course won't work.

This is the code I used:

preamble:

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

\begin{document}  
    \clearpage
    \begin{figure}[h!]
    \ffigbox[\FBwidth]
    {\begin{subfloatrow}
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{A.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{B.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{C.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{D.pdf}}%
        \end{subfloatrow}}
    {\caption{this is a caption}}
    \end{figure}
\end{document}
share|improve this question
    
Please post a complete, minimal and compilable version of your document. –  Gonzalo Medina May 3 '11 at 12:18
    
this should work –  Timtico May 3 '11 at 13:42
    
I edited your code because you wrote \start{document}. I assume you thought of writing \begin{document}. –  Thorsten May 3 '11 at 13:57
    
ah yes, ofcourse, thank alot –  Timtico May 3 '11 at 14:04
    
I added the subfig package to your code to make it (except for the actual figures) compilable. –  Gonzalo Medina May 3 '11 at 14:34
add comment

1 Answer

up vote 3 down vote accepted

For each row you need to use the subfloatrow environment:

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

\begin{document}  

\begin{figure}[h!]
  \ffigbox[\FBwidth]
    {\begin{subfloatrow}
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{A.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{B.pdf}}%
      \end{subfloatrow}
      \begin{subfloatrow}
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{C.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{D.pdf}}%
      \end{subfloatrow}}
    {\caption{this is a caption}}
\end{figure}

\end{document}

I used the demo option for graphicx to make my example code compilable for everyone; do not use that option in your actual code.

share|improve this answer
    
that was what I tried first, and for some reason it didnt work, but It seems I did something wrong then! thanks. –  Timtico May 3 '11 at 15:01
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.