tikz 행렬 정렬이 약간 벗어남

tikz 행렬 정렬이 약간 벗어남

비슷한 제목의 게시물이 많다는 것을 알고 있지만 왠지 관련이 있을 것 같은 게시물을 찾을 수 없었습니다. 다음은 모든 행의 거리가 균일할 것으로 예상되는 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}

여기에 이미지 설명을 입력하세요

관련 정보