I am trying to put few images in a canvas, in such a way so that they become horizontally aligned and vertically centered collage in tikz. Below is the sample code-
\documentclass{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0cm, outer sep=0cm] (img1) at (0, 0, 0) {\includegraphics[height=2cm]{pc}};
\node[anchor=south west,inner sep=0cm, outer sep=0cm] (img2) at (img1.south east){\includegraphics[height=1cm]{arrow}};
\node[anchor=south west,inner sep=0cm, outer sep=0cm] (img3) at (img2.south east){\includegraphics[height=3cm]{db}};
\node[anchor=south west,inner sep=0cm, outer sep=0cm] (img4) at (img3.south east){\includegraphics[height=1cm]{arrow}};
\node[anchor=south west,inner sep=0cm, outer sep=0cm] (img5) at (img4.south east){\includegraphics[height=2cm]{pc}};
\end{tikzpicture}
\end{document}
This is how the generated pdf looks like-
However, I want to the arrows vertically centered, something like this-
Notice the alignment of the images in both the files.
anchor=west
and.east
instead ofanchor=south west
and.south east
.\node[anchor=south east,inner sep=0cm, outer sep=0cm] (img3) at (img2.south west){\includegraphics[height=3cm]{db}};
?\node[anchor=west,inner sep=0pt,outer sep=0pt] (img3) at (img2.east) {\includegraphics{...}};
. What you have done in your code is to place the lower left corner (anchor=south west
) of the second image on the lower right corner (at (img1.south east)
) of the first image, so naturally they're aligned at the bottom.