![tikz 행렬 정렬이 약간 벗어남](https://rvso.com/image/309841/tikz%20%ED%96%89%EB%A0%AC%20%EC%A0%95%EB%A0%AC%EC%9D%B4%20%EC%95%BD%EA%B0%84%20%EB%B2%97%EC%96%B4%EB%82%A8.png)
비슷한 제목의 게시물이 많다는 것을 알고 있지만 왠지 관련이 있을 것 같은 게시물을 찾을 수 없었습니다. 다음은 모든 행의 거리가 균일할 것으로 예상되는 MWE입니다. 그러나 분명히 첫 번째와 두 번째 행은 두 번째와 세 번째 행보다 서로 더 가깝습니다.
\documentclass[]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\matrix[
matrix of nodes,
anchor=north,
column 1/.style={nodes={anchor=base west,align=center}},
column 2/.style={nodes={anchor=base west,align=center}},
column 3/.style={nodes={anchor=base west,align=center}},
column 4/.style={nodes={anchor=base west,align=center}}
]
{ Some text& \\
Some text& Some longer text\\
Some text&
Some text\\};
\end{tikzpicture} %
\caption{test test}
\end{figure}
\end{document}
답변1
두 번째 줄에는 g
디센더가 있는 문자가 포함되어 있고 첫 번째 줄에는 없는 문자가 포함되어 있기 때문입니다. text depth
모든 노드에 일부를 추가하거나 \strut
모든 셀 내부에서 사용할 수 있습니다.
\documentclass[]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\matrix[
matrix of nodes,
anchor=north,
nodes={text depth=0.55ex}, %% <----------------------here
column 1/.style={nodes={anchor=base west,align=center}},
column 2/.style={nodes={anchor=base west,align=center}},
column 3/.style={nodes={anchor=base west,align=center}},
column 4/.style={nodes={anchor=base west,align=center}}
]
{ Some text& \\
Some text& Some longer text\\
Some text& Some text\\};
\end{tikzpicture} %
\caption{test test}
\end{figure}
\end{document}