Horizontal icons between subfloats
It's not clear you need a table at all:
\documentclass{report}
\usepackage{pifont}
\usepackage[svgnames, x11names]{xcolor}
\usepackage{graphicx
}
\usepackage{caption}
\usepackage{subfig}
\usepackage[export]{adjustbox}
% Add \hspace to arrow definition
\newcommand\bigleftArrow{\textcolor{green}{\rotatebox[origin=c]{180}{\scalebox{2.4}[3.6]{\ding{225}}}}}
\newcommand\bigrightArrow{\hspace*{.2em}\textcolor{green}{\rotatebox[origin=c]{0}{\scalebox{2.4}[3.6]{\ding{225}}}}}
\begin{document}
\begin{figure} [ht]
\subfloat[text 1]{
\includegraphics[width=0.28\textwidth,valign=m]
{example-image-a}}
\hfill
\bigrightArrow
\hfill
\subfloat[text 2]{
\includegraphics[width=0.28\textwidth,valign=m]
{example-image-b}}
\hfill
\bigrightArrow
\hfill
\subfloat[text 3 is longer than the others: text text text text text text text text text]{
\includegraphics[width=0.28\textwidth,valign=m]
{example-image-c}}
\subfloat[text 4]{
\includegraphics[width=0.28\textwidth,valign=m]
{example-image}}
\hfill
\bigrightArrow
\hfill
\subfloat[text 6]{
\includegraphics[width=0.28\textwidth,valign=m]
{example-image}}
\caption{long text}
\label{fig:merge}
\end{figure}
\end{document}
If you use \subcaptionbox
from subcaption
, the alignment of the captions gets taken care of. The alignment of the arrows is more problematic because there is no automatic way - using this general approach - of figuring out where they should go. So, short of doing things substantially differently, I suggest manually adjusting the vertical position of the arrows. (The horizontal alignment is not a problem.)
For example,
\documentclass{report}
\usepackage{pifont}
\usepackage[x11names]{xcolor}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{tabularx}
\renewcommand{\tabularxcolumn}[1]{>{\small\centering\arraybackslash}p{#1}}
\makeatother
\newcommand*\bigrightArrow[1][0pt]{\color{green}\raisebox{#1}{\scalebox{2.4}[3.6]{\ding{225}}}}
\newcommand*\bigleftArrow[1][0pt]{\color{Tomato2}\raisebox{#1}{\rotatebox[origin=c]{180}{\scalebox{2.4}[3.6]{\ding{225}}}}}
\makeatletter
\begin{document}
\begin{figure}
\centering
\begin{tabularx}{\textwidth}{@{}XcXcX@{}}
\subcaptionbox{text 1}{\includegraphics[width=\linewidth]{example-image-a}}
&
\bigrightArrow[15pt]
&
\subcaptionbox{text 2}{\includegraphics[width=\linewidth]{example-image-b}}
&
\bigrightArrow[15pt]
&
\subcaptionbox{text 3 is longer than the others: text text text text text text text text text}{\includegraphics[width=\linewidth]{example-image-c}}
\\
\subcaptionbox{text 4}{\includegraphics[width=\linewidth]{example-image}}
&
\multicolumn{3}{c}{\bigleftArrow[15pt]}
&
\subcaptionbox{text 6}{\includegraphics[width=\linewidth]{example-image}}\\
\end{tabularx}
\captionof{figure}[]{long text}
\label{fig:merge}
\end{figure}
\end{document}
A bit fiddly, but it gives the expected results.
Note that the original code was producing overfull boxes as the images were simply too large. This in itself is going to screw up the alignment. The current code gives only one bad box, for the long caption. If your captions really look like this, you should set them \raggedright
or something rather than justified.
I would like to show you a couple of solutions with a tikz matrix
.
I've added a yshift
to your \bigleftArrow
and \bigrightArrow
commands to refine the vertical alignment of the arrows.
To avoid the Underfull \hbox
you could use \centering
within your \subcaption
command.
\documentclass{report}
\usepackage{pifont}
\usepackage[x11names]{xcolor}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newcommand*{\bigrightArrow}{|[yshift=-2]| \color{green}{\scalebox{2.4}[3.6]{\ding{225}}}}
\newcommand*{\bigleftArrow}{|[yshift=2]| \color{Tomato2}{\rotatebox[origin=c]{180}{\scalebox{2.4}[3.6]{\ding{225}}}}}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\matrix[matrix of nodes,
nodes={anchor=center},
column sep=-3.7em]{%
\includegraphics[width=0.26\textwidth]{example-image-a}
&
\bigrightArrow
&
\includegraphics[width=0.26\textwidth]{example-image-b}
&
\bigrightArrow
&
\includegraphics[width=0.26\textwidth]{example-image-c}
\\
\begin{minipage}[t][10ex][t]{0.26\textwidth}
\subcaption{text 1\label{fig:1amerge2}}
\end{minipage}
&&
\begin{minipage}[t][10ex][t]{0.26\textwidth}
\subcaption{text 2}
\end{minipage}%
&&
\begin{minipage}[t][10ex][t]{0.26\textwidth}
\subcaption{\centering text 3 is longer than the others: text text text text text text text text text}
\end{minipage}%
\\[4pt]
&
\includegraphics[width=0.26\textwidth]{example-image}
&
\bigleftArrow
&
\includegraphics[width=0.26\textwidth]{example-image}
\\
&
\begin{minipage}[t]{0.26\textwidth}
\subcaption{text 4}
\end{minipage}%
&&
\begin{minipage}[t]{0.26\textwidth}
\subcaption{text 6}
\end{minipage}%
\\
};
\end{tikzpicture}
\caption{long text\label{fig:merge2}}
\end{figure}
\begin{figure}
\centering
\begin{tikzpicture}
\matrix[matrix of nodes,
nodes={anchor=center},
column sep=-3pt
]{%
\includegraphics[width=0.26\textwidth]{example-image-a}
&
\bigrightArrow
&
\includegraphics[width=0.26\textwidth]{example-image-b}
&
\bigrightArrow
&
\includegraphics[width=0.26\textwidth]{example-image-c}
\\
\begin{minipage}[t][10ex][t]{0.26\textwidth}
\subcaption{text 1\label{fig:1a}}
\end{minipage}
&&
\begin{minipage}[t][10ex][t]{0.26\textwidth}
\subcaption{text 2}
\end{minipage}%
&&
\begin{minipage}[t][10ex][t]{0.26\textwidth}
\subcaption{text 3 is longer than the others: text text text text text text text text text}
\end{minipage}%
\\[4pt]
\includegraphics[width=0.26\textwidth]{example-image}
&&
\bigleftArrow
&&
\includegraphics[width=0.26\textwidth]{example-image}
\\
\begin{minipage}[t]{0.26\textwidth}
\subcaption{text 4}
\end{minipage}%
&&&&
\begin{minipage}[t]{0.26\textwidth}
\subcaption{text 6}
\end{minipage}%
\\
};
\end{tikzpicture}
\caption{long text\label{fig:merge}}
\end{figure}
\end{document}