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.

In the preamble I use :

\usepackage[labelformat=empty]{caption}
\usepackage[heightadjust=all,floatrowsep=none,captionskip=3pt]{floatrow}

With this package I'm able to put two figures horizontally and vertically aligned besides one another, and refer to them individually. It also puts the captions at the desired distance (3pt) below the figure base. However, this applies to all such setups in the document.

Unfortunately things become messy, and the vertical spacing between the figures and their captions seem to vary randomly.

How can I fix that individually for some figure pair with the wrong caption spacing ?

Example :

\documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}
\usepackage[top=1cm,right=1cm,bottom=1cm,left=1.5cm,noheadfoot]{geometry}
\usepackage{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings,patterns,calc}

\usepackage[labelformat=empty]{caption}
\usepackage[heightadjust=all,floatrowsep=none,captionskip=3pt]{floatrow}

\begin{document}

\begin{figure}[h!]
\begin{floatrow}
\ffigbox[\FBwidth]
{\begin{tikzpicture}[>=stealth']
\draw[line width=1mm] (0,0) circle (3);
\end{tikzpicture}}
{\caption{\footnotesize\bf Figure 1.}\label{fig:1}}
\hspace{1cm}
\ffigbox[\FBwidth]
{\begin{tikzpicture}[>=stealth']
\draw[line width=1mm,rotate=45] (0,0) rectangle (2,2);
\end{tikzpicture}}
{\caption{\footnotesize\bf Figure 2.}\label{fig:2}}
\end{floatrow}
\end{figure}

\end{document}

The floatrow package manual is mostly gibberish to me, and lacks examples.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Although the question includes an example code, there's no mention about the desired caption placement. The following example code contains the original layout and the one obtained by using \CenterFloatBoxes:

\documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}
\usepackage[top=1cm,right=1cm,bottom=1cm,left=1.5cm,noheadfoot]{geometry}
\usepackage{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings,patterns,calc}

\usepackage[labelformat=empty]{caption}
\usepackage[heightadjust=all,floatrowsep=none,captionskip=3pt]{floatrow}

\begin{document}

\begin{figure}[h!]
\begin{floatrow}
\ffigbox[\FBwidth]
{\begin{tikzpicture}[>=stealth']
\draw[line width=1mm] (0,0) circle (3);
\end{tikzpicture}}
{\caption{\footnotesize\bf Figure 1.}\label{fig:1}}%
\hspace{1cm}%
\ffigbox[\FBwidth]
{\begin{tikzpicture}[>=stealth']
\draw[line width=1mm,rotate=45] (0,0) rectangle (2,2);
\end{tikzpicture}}
{\caption{\footnotesize\bf Figure 2.}\label{fig:2}}
\end{floatrow}
\end{figure}

\begin{figure}[h!]
\begin{floatrow}
\CenterFloatBoxes
\ffigbox[\FBwidth]
{\begin{tikzpicture}[>=stealth']
\draw[line width=1mm] (0,0) circle (3);
\end{tikzpicture}}
{\caption{\footnotesize\bf Figure 1.}\label{fig:1}}%
\hspace{1cm}%
\ffigbox[\FBwidth]
{\begin{tikzpicture}[>=stealth']
\draw[line width=1mm,rotate=45] (0,0) rectangle (2,2);
\end{tikzpicture}}
{\caption{\footnotesize\bf Figure 2.}\label{fig:2}}
\end{floatrow}
\end{figure}

\end{document}

enter image description here

As a side note, it's not clear why you manually change the caption layout inside the \caption command (this is not a good idea) instead of using \captionsetup.

share|improve this answer

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.