Alineación de gráficos usando tabularx y subfloats.

Alineación de gráficos usando tabularx y subfloats.

Lo que intento hacer es alinear gráficos dentro de un tabularxentorno subfloats.

Básicamente quiero mostrar un proceso/flujo de trabajo usando 5 gráficos, teniendo 1-3 "conectados" y 4+5.

Este es mi código: probé dos enfoques diferentes pero ninguno está muy bien alineado:

\documentclass{report}
\usepackage{pifont}
\usepackage[svgnames, x11names]{xcolor}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subfig}
\usepackage{tabularx}

\newcommand\bigleftArrow{\color{Tomato2}\rotatebox[origin=c]{180}{\scalebox{2.4}[3.6]{\ding{225}}}}
\newcommand\bigrightArrow{\color{Tomato2}\rotatebox[origin=c]{0}{\scalebox{2.4}[3.6]{\ding{225}}}}

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}

\begin{figure} [h]
\begin{tabularx}{\textwidth}{@{}*{5}{>{\centering\arraybackslash}X}@{}}
  \subfloat[text 1]{
     \includegraphics[width=0.28\textwidth]
     {example-image-a}}
      &
      \bigleftArrow
      &
  \subfloat[text 2]{
     \includegraphics[width=0.28\textwidth]
     {example-image-b}}
      &
      \bigleftArrow
      &
  \subfloat[text 3 is longer as  the others text text text text text]{
     \includegraphics[width=0.28\textwidth]
     {example-image-c}}
     \\
  \subfloat[text 4]{
     \includegraphics[width=0.28\textwidth]
     {example-image}}
       &
       &
       \bigrightArrow
       &
       &
  \subfloat[text 5]{
     \includegraphics[width=0.28\textwidth]
     {example-image}}


\end{tabularx}
  \captionof{figure}[]{long text 1}
  \label{fig:merge}
\end{figure}





\begin{figure} [hb]
\begin{tabularx}{\textwidth}{X m{10pt} C{110pt} m{10pt} X}
\centering 
  \subfloat[text 1]{
     \includegraphics[width=0.28\textwidth]
     {example-image-a}}
      &
      \bigleftArrow
      &
  \subfloat[text 2]{
     \includegraphics[width=0.28\textwidth]
     {example-image-b}}
      &
      \bigleftArrow
      &
  \subfloat[text 3 is longer as  the others text text text text text]{
     \includegraphics[width=0.28\textwidth]
     {example-image-c}}
  \\ 
  \subfloat[text4]{
     \includegraphics[width=0.28\textwidth]
     {example-image}}
      &
      &
      \bigrightArrow
      &
      &
  \subfloat[text5]{
     \includegraphics[width=0.28\textwidth]
     {example-image}}


\end{tabularx} 
  \captionof{figure}[]{long text 2}

\end{figure}

\end{document}

El problema es que quiero tener las flechas verticales y horizontales centradas en cada fila. Pero este es mi resultado:

ingrese la descripción de la imagen aquí ingrese la descripción de la imagen aquí


y así es como debería verse:

ingrese la descripción de la imagen aquí

¿Alguien puede darme una pista sobre la alineación (u otro enfoque si es necesario para solucionar este problema)?

Respuesta1

Puedes usar algunas combinaciones de \makebox.

La \vcenterobjectmacro desplaza verticalmente su argumento para que la altura sea igual a la profundidad.

El \makebox[0pt]{...}comando crea un cuadro de ancho cero que se ubicará entre las "columnas".

Tenga en cuenta que tiene varios espacios falsos debido a finales de línea desprotegidos. También he simplificado la definición de las flechas.

\documentclass{report}
\usepackage{pifont}
\usepackage[svgnames, x11names]{xcolor}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subfig}

\newcommand\bigleftArrow{%
  \scalebox{-2.4}[3.6]{%
    \color{Tomato2}\ding{225}%
  }%
}
\newcommand\bigrightArrow{%
  \scalebox{2.4}[3.6]{%
    \color{Tomato2}\ding{225}%
  }%
}

\newcommand{\vcenterobject}[1]{%
  \begin{tabular}{@{}c@{}}#1\end{tabular}%
}

\begin{document}

\begin{figure}[htp]

\makebox[.33333\textwidth]{%
  \subfloat[text 1]{%
    \vcenterobject{%
      \includegraphics[width=0.2\textwidth]{example-image-a}%
    }%
  }
}%
\hfill\makebox[0pt]{\vcenterobject{\bigleftArrow}}\hfill
\makebox[.33333\textwidth]{%
  \subfloat[text 2]{%
    \vcenterobject{%
      \includegraphics[width=0.2\textwidth]{example-image-b}%
    }%
  }%
}%
\hfill\makebox[0pt]{\vcenterobject{\bigleftArrow}}\hfill
\makebox[.33333\textwidth]{%
  \subfloat[text 3 is longer as  the others text text text text text]{%
    \vcenterobject{%
      \includegraphics[width=0.2\textwidth]{example-image-c}%
    }%
  }%
}

\makebox[.33333\textwidth]{%
  \subfloat[text 4]{%
    \vcenterobject{%
      \includegraphics[width=0.2\textwidth]{example-image}%
    }%
  }%
}%
\hfill\makebox[0pt]{\vcenterobject{\bigrightArrow}}\hfill
\makebox[.33333\textwidth]{%
  \subfloat[text 5]{%
    \vcenterobject{%
      \includegraphics[width=0.2\textwidth]{example-image}%
    }%
  }%
}

\caption{long text 1}\label{fig:merge}

\end{figure}

\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

Desde el punto de vista primitivo de TeX, debes hacer algo como esto:

\def\vhb#1{\vtop{\hbox{#1}}}
\def\rb#1{\raise.9cm\hbox{#1}}

\begin{figure}[h]
\hbox to\hsize{%
  \vhb{\subfloat[text 1]{\includegraphics[width=0.28\textwidth]{example-image-a}}}%
  \hss \rb\bigleftArrow \hss
  \vhb{\subfloat[text 2]{\includegraphics[width=0.28\textwidth]{example-image-b}}}%
  \hss \rb\bigleftArrow \hss
  \vhb{\subfloat[text 3 is longer as  the others text text text text text]{
     \includegraphics[width=0.28\textwidth]{example-image-c}}}%
}
\hbox to\hsize{%
  \vhb{\subfloat[text 4]{\includegraphics[width=0.28\textwidth]{example-image}}}%
  \hss \rb\bigrightArrow \hss
  \vhb{\subfloat[text 5]{\includegraphics[width=0.28\textwidth]{example-image}}}%
}
\end{figure}

información relacionada