0

How do you control the space below a caption when using the floatrow package?

MWE:

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{floatrow}
\floatsetup[figure]{captionskip=6pt}

\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\setlength{\parskip}{6pt}
\renewcommand{\baselinestretch}{1.1}

\usepackage{caption}
\usepackage[font+=footnotesize]{subcaption}
\captionsetup[figure]{%
  justification=raggedright,
  font=footnotesize,
  labelfont=footnotesize,
  }

\usepackage{setspace}

\begin{document}\raggedright

  \begin{figure}[H]
    \ffigbox[\FBwidth]
    {\caption{(a) Mutually exclusive events and (b) events that are not mutually exclusive.}\label{fig:mutually_exclusive_events_venn}}
    {\begin{subfigure}[b]{0.35\textwidth}
      \raggedright
      \includegraphics[scale=1]{figurea}
      \caption{$A \cap B =0$}
      \label{fig:mutually_exclusive}
      \end{subfigure}
    \begin{subfigure}[b]{0.35\textwidth}
      \raggedleft
      \includegraphics[scale=1]{figureb}
      \caption{$A \cap B >0$}
      \label{fig:not_mutually_exclusive}
      \end{subfigure}}
    \end{figure}

  \lipsum[1]

  \lipsum[1]

\end{document}

enter image description here

1

Discovered the following:

If you add:

\DeclareFloatVCode{beforefloat}{\vspace{4pt}}
\DeclareFloatVCode{afterfloat}{\vspace{-10pt}}

Before \floatsetup in preamble and then add precode=beforefloat,postcode=afterfloat in \floatsetup, the problem is resolved. E.g.

\floatsetup[figure]{precode=beforefloat,postcode=afterfloat}

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.