Espaçamento entre figuras em \matrix of tikz

Espaçamento entre figuras em \matrix of tikz

Estou tentando colocar 4 figuras com alturas desiguais em uma matriz. Meu código que você pode compilaraquié:

\documentclass[journal=aamick]{achemso}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning}
\title{hi}
\begin{document}
\maketitle
\newlength{\w}
\setlength{\w}{.9\paperwidth}

\noindent \begin{tikzpicture}[align=center]

\matrix[column sep=.0\w,row sep=.0\w,%
every node/.style={draw,node distance=0 and 0,outer sep=0},xshift=-.048\w]{
\node [label=above:(a)] (a)  {\includegraphics[width=.14\w]{figs/16_4.jpeg}}; & 
\node [label=right:(d)] (d)  {\includegraphics[width=.14\w]{figs/16_10.jpeg}};\\
\node [label=below:(b)] (b)  {\includegraphics[width=.14\w]{figs/8_4.jpeg}}; &
\node [label=right:(c)] (c)  {\includegraphics[width=.14\w]{figs/8_10.pdf}};\\};

\end{tikzpicture}%

\end{document}

O que estou recebendo é:

que tem uma lacuna (a seta vermelha) entre as caixas da esquerda. O que eu quero é algo como:

Como posso fazer isso?

Responder1

Você só precisa definir as âncoras adequadamente, ou seja, adicionar

row 1/.style={anchor=south},row 2/.style={anchor=north}

às opções da matriz.

\documentclass[journal=aamick]{achemso}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning}
\title{hi}
\begin{document}
\maketitle
\newlength{\w}
\setlength{\w}{.9\paperwidth}

\noindent \begin{tikzpicture}[align=center]
\matrix[column sep=.0\w,row sep=.0\w,%
every node/.style={draw,outer sep=0},
row 1/.style={anchor=south},row 2/.style={anchor=north}]{
\node [label=above:(a)] (a)  {\includegraphics[width=.14\w]{example-image-duck}}; & 
\node [label=right:(d)] (d)  {\includegraphics[width=.14\w,height=.14\w]{example-image-duck}};\\
\node [label=below:(b)] (b)  {\includegraphics[width=.14\w]{example-image-duck}}; &
\node [label=right:(c)] (c)  {\includegraphics[width=.14\w,height=.14\w]{example-image-duck}};\\};

\end{tikzpicture}%

\end{document}

insira a descrição da imagem aqui

Não tenho seus arquivos gráficos, então utilizo alguns arquivos padrão, mas com alturas efetivas diferentes para simular seu problema.

TERMO ADITIVO: Você pode salvar algumas teclas usando

\setkeys{Gin}{width=.14\w}

desde então todas as larguras dos gráficos incluídos neste grupo terão esta largura. Também nodesé uma abreviatura de every node/.append stylee node distance=0 and 0,não tem nenhum efeito, nem ,xshift=-.048\wdesde que tikzpictureconsista apenas nesta matriz.

\documentclass[journal=aamick]{achemso}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning}
\title{hi}
\begin{document}
\maketitle
\newlength{\w}
\setlength{\w}{.9\paperwidth}

\noindent \begin{tikzpicture}[align=center]
\setkeys{Gin}{width=.14\w}
\matrix[column sep=.0\w,row sep=.0\w,%
nodes={draw,outer sep=0},
row 1/.style={anchor=south},row 2/.style={anchor=north}]{
\node [label=above:(a)] (a)  {\includegraphics{example-image-duck}}; & 
\node [label=right:(d)] (d)  {\includegraphics[height=.14\w]{example-image-duck}};\\
\node [label=below:(b)] (b)  {\includegraphics{example-image-duck}}; &
\node [label=right:(c)] (c)  {\includegraphics[height=.14\w]{example-image-duck}};\\};

\end{tikzpicture}%
\end{document}

informação relacionada