
TikZ 매트릭스에서 한 열의 셀을 수직으로 중앙에 배치할 수 있습니까? 수직으로 추가하면 nodes = {anchor = center}
모든 셀이 중앙에 배치되지만 두 번째 및 세 번째 열의 셀 내용에 대한 아래쪽 정렬을 유지하고 싶습니다.
즉, asdf
첫 번째 열에서는 수직으로 가운데에 배치하면서 두 번째와 세 번째 열에서는 이미지의 아래쪽 정렬을 유지하려면 어떻게 해야 합니까?
MWE
\documentclass{article}
\usepackage{mwe}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes]{
asdf & \includegraphics[width=2cm]{example-image-a} & \includegraphics[width=3cm]{example-image-a} \\
};
\end{tikzpicture}
\end{document}
답변1
column 1/.style
을 사용 하여 첫 번째 열의 셀만 스타일을 지정하거나 row 2 column 3/.style
특정 셀에 대해 스타일을 지정할 수 있습니다 . 다음은 첫 번째 열에 적용된 일부 스타일입니다.
\documentclass{article}
\usepackage{mwe}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes,
column 1/.style={anchor=center,color=red,text depth=2cm}]{
asdf & \includegraphics[width=2cm]{example-image-a} & \includegraphics[width=3cm]{example-image-a} \\
bkgi & \includegraphics[width=3cm]{example-image-a} & \includegraphics[width=1cm]{example-image-a} \\
};
\end{tikzpicture}
\end{document}