Espaciado horizontal entre subflotadores usando floatrow y subfig (con soporte fr-subfig)

Espaciado horizontal entre subflotadores usando floatrow y subfig (con soporte fr-subfig)

Estoy intentando organizar dos filas de subfiguras usando subfigy floatrow. Los títulos están alineados como deseo y la alineación vertical de los objetos también está bien. Sin embargo, no puedo entender cómo lograr que el espacio horizontal entre las subfiguras sea uniforme. En la fila inferior no hay problema: 2 figuras con algo de espacio entre ellas. Bien. En la fila superior, sin embargo, hay más espacio entre las dos primeras figuras que entre la segunda y la tercera. Y no puedo entender por qué.

5 subfiguras en 2 filas

¿Qué me estoy perdiendo?

\documentclass{article}
\usepackage{graphicx,subfig}
\usepackage[heightadjust=all,valign=c]{floatrow}
\usepackage{fr-subfig}

\begin{document}

  \begin{figure}[!htbp]
    \captionsetup[subfigure]{justification=centering}
    \floatbox{figure}{%
      \caption{%
        Components of the system: Penguins (\ref{fig:a}), Jumpers (\ref{fig:b}), Thingies (\ref{fig:c}), Cabbages (\ref{fig:d}) and Nuclear Warheads (\ref{fig:e})%
      }\label{fig:x}%
    }{%
  \begin{subfloatrow}%
    \subfloat[Penguins were here and here and here]{%
      \includegraphics[height=.1\textheight]{example-image-a}\label{fig:a}}
    \qquad
    \subfloat[Penguin]{%
      \includegraphics[height=.15\textheight]{example-image-b}\label{fig:b}}
    \qquad
    \subfloat[Penguin]{%
      \includegraphics[height=.125\textheight]{example-image-a}\label{fig:c}}
  \end{subfloatrow}

  \begin{subfloatrow}
    \subfloat[Penguin]{%
      \includegraphics[height=.15\textheight]{example-image-b}\label{fig:d}}
    \qquad
    \subfloat[Penguins were here, there and everywhere!]{%
      \includegraphics[height=.2\textheight]{example-image-a}\label{fig:e}}
  \end{subfloatrow}}
\end{figure}

\end{document}

Tenga en cuenta que conozco alternativas a subfig. Si no hay una solución disponible para subfig, piratearé algo por ahora y buscaré otras opciones para el futuro.

Respuesta1

Actualizar

Las subfloatrowsepteclas floatrowseple dan control sobre la separación horizontal entre subflotadores (flotadores) cuando usa floatrow; sin embargo, simplemente usando algo como

\thisfloatsetup{subfloatrowsep=qquad}

en su código actualnoproduzca el resultado deseado desde que lo está usando \subfloat(del subfigpaquete). La solución es no usar \subfloaty usar floatrow's \ffigboxen su lugar. Esto hace

\thisfloatsetup{subfloatrowsep=qquad}

comportarse como se esperaba y también resuelve un problema con los contadores (que se analiza más a fondo en¿Cómo puedo obtener el etiquetado correcto de las subfiguras con subfig y floatrow?).

\documentclass{article}
\usepackage{graphicx,subfig}
\usepackage[heightadjust=all,valign=c]{floatrow}
\usepackage{fr-subfig}

\begin{document}

  \thisfloatsetup{subfloatrowsep=qquad}
  \begin{figure}[!htbp]
    \captionsetup[subfigure]{justification=centering}
      \ffigbox{%
  \begin{subfloatrow}[3]%
    \ffigbox[\FBwidth]{\caption{Penguins were here and here and here}\label{fig:a}}{%
      \includegraphics[height=.1\textheight]{example-image-a}}
    \ffigbox[\FBwidth]{\caption{Penguin}\label{fig:b}}{%
      \includegraphics[height=.15\textheight]{example-image-b}}
    \ffigbox[\FBwidth]{\caption{Penguin}\label{fig:c}}{%
      \includegraphics[height=.125\textheight]{example-image-a}}
  \end{subfloatrow}

  \begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{Penguin}\label{fig:d}}{%
      \includegraphics[height=.15\textheight]{example-image-b}}
    \ffigbox[\FBwidth]{\caption{Penguins were here, there and everywhere!}\label{fig:e}}{%
      \includegraphics[height=.2\textheight]{example-image-a}}
  \end{subfloatrow}%
      }{%
        \caption{Components of the system: Penguins (\ref{fig:a}), Jumpers (\ref{fig:b}), Thingies (\ref{fig:c}), Cabbages (\ref{fig:d}) and Nuclear Warheads (\ref{fig:e})\label{fig:x}}%
    }
\end{figure}

\end{document}

La salida:

ingrese la descripción de la imagen aquí

Versión inicial

También he tenido problemas con el posicionamiento horizontal de las figuras floatrowy las floatrowsepteclas subfloatrowsepparecen no siempre comportarse como se esperaba.

Una opción que he encontrado que funciona en casos problemáticos es eliminar la separación predeterminada subfloatrowsep=noney luego usar \quadcualquier otro comando de espaciado para controlar manualmente la separación (uno pensaría que subfloatrowsep=quadesto se manejaría automáticamente, pero no siempre es así). . De todos modos, mi sugerencia:

\documentclass{article}
\usepackage{graphicx,subfig}
\usepackage[heightadjust=all,valign=c]{floatrow}
\usepackage{fr-subfig}

\begin{document}
  \thisfloatsetup{subfloatrowsep=none}
  \begin{figure}[!htbp]
    \captionsetup[subfigure]{justification=centering}
    \floatbox{figure}{%
      \caption{%
        Components of the system: Penguins (\ref{fig:a}), Jumpers (\ref{fig:b}), Thingies (\ref{fig:c}), Cabbages (\ref{fig:d}) and Nuclear Warheads (\ref{fig:e})%
      }\label{fig:x}%
    }{%
  \begin{subfloatrow}%
    \subfloat[Penguins were here and here and here]{%
      \includegraphics[height=.1\textheight]{example-image-a}\label{fig:a}}%
    \qquad
    \subfloat[Penguin]{%
      \includegraphics[height=.15\textheight]{example-image-b}\label{fig:b}}
    \qquad
    \subfloat[Penguin]{%
      \includegraphics[height=.125\textheight]{example-image-a}\label{fig:c}}
  \end{subfloatrow}

  \begin{subfloatrow}
    \subfloat[Penguin]{%
      \includegraphics[height=.15\textheight]{example-image-b}\label{fig:d}}
    \qquad
    \subfloat[Penguins were here, there and everywhere!]{%
      \includegraphics[height=.2\textheight]{example-image-a}\label{fig:e}}
  \end{subfloatrow}}
\end{figure}

\end{document}

ingrese la descripción de la imagen aquí

información relacionada