范围内的节点

范围内的节点

我有以下代码:

\documentclass[a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{float}
\usepackage[justification=centering]{caption}
\usepackage{mathtools}
\usepackage[pdftex]{graphicx}
\usepackage{setspace}
\usepackage[usenames, dvipsnames, pdftex]{xcolor}
\usepackage[utf8]{inputenc}     % Support for french language
\usepackage{wordlike}
\usepackage{txfonts}
\usepackage{tipa}

\usepackage{pgfplots}
\usetikzlibrary{arrows,shadows,positioning}

\begin{document}
    \setlength{\tabcolsep}{2pt}

    \begin{figure}[H]
        \centering
        \begin{tikzpicture}
        [
            node distance = 8mm and 8mm,
            Node/.style={minimum size = 0.5cm, inner sep = 0pt},
        ]

        \node[Node] (1) {Phonèmes};
        \node[Node] (2) [below left = of 1] {Semi-consonnes};
        \node[Node] (3) [left       = of 2] {Voyelles};
        \node[Node] (4) [below right= of 1] {Consonnes};
        \node[Node] (5) [below left = of 3] {Orales};
        \node[Node] (6) [right      = of 5] {Nasales};
        \node[Node] (7) [below left = 8mm and 25mm of 4] {Liquides};
        \node[Node] (8) [right      = 12mm of 7] {Nasales};
        \node[Node] (9) [right      = of 8] {Fricatives};
        \node[Node] (10)[right      = of 9] {Occlusives};

        %\begin{scope}[below of=2, yshift=3cm]
            \node[align=left] (11)[below      = of 5] { 
                                                        \begin{tabular} {l l}
                                                            \multicolumn{2}{c}{}\\
                                                            i&(I)\\
                                                            e&(EI)\\
                                                            $\epsilon$&(AI)\\
                                                            a&(A)\\
                                                            \textipa{O}&(O)\\
                                                            u&(OU)\\
                                                            y&(U)\\
                                                            $\varphi$&(EU)\\
                                                            \oe&(\OE)\\
                                                            \textipa{@}&(E)\\
                                                            o&(AU)\\
                                                            a&(A) % Must verify
                                                        \end{tabular}
                                                      };

            \node[align=left] (12)[below      = of 6] {
                                                        \begin{tabular} {l l}
                                                            \multicolumn{2}{c}{}\\
                                                            $\tilde{\epsilon}$&(IN)\\
                                                            $\tilde{\text{\oe}}$&(UN)\\
                                                            \\
                                                            $\tilde{\text{a}}$&(AN)\\
                                                            $\tilde{\supset}$&(ON)
                                                        \end{tabular}
                                                      };

            \node[align=left] (13)[below = of 2] {
                                                        \begin{tabular} {l l}
                                                            %\multicolumn{2}{c}{}\\
                                                            j&(Y)\\
                                                            w&(W)\\
                                                            y&(UI)
                                                        \end{tabular}
                                                      };

            \node[align=left] (14) [below     = of 7] {
                                                        \begin{tabular} {l l}
                                                            \multicolumn{2}{c}{}\\
                                                            l&(L)\\
                                                            R&(R)
                                                        \end{tabular}
                                                      };

            \node[align=left] (15) [below     = of 8] {
                                                        \begin{tabular} {l l}
                                                            \multicolumn{2}{c}{}\\
                                                            m&(M)\\
                                                            n&(N)\\ % To be verified
                                                            \textltailn&(GN)
                                                        \end{tabular}
                                                    };

            \node[align=left] (16) [right = -3mm of 15] {
                                                        \begin{tabular}{l l}
                                                            \multicolumn{2}{c}{Voisées}\\
                                                            v & (V)\\
                                                            z & (Z)\\
                                                            \textipa{Z} & (J)
                                                        \end{tabular}
                                                    };

            \node[align=left] (16) [below right = 8mm and -9mm of 9] {
                                                        \begin{tabular}{l l}
                                                            \multicolumn{2}{c}{Non-voisées}\\
                                                            f & (F)\\
                                                            s & (S)\\
                                                            \textipa{S} & (CH)\\
                                                        \end{tabular}
                                                        };


            \node[align=left] (16) [below right = 8mm and -13mm of 10] {
                                                        \begin{tabular}{l l}
                                                            \multicolumn{2}{c}{Voisées}\\
                                                            b & (B)\\
                                                            d & (D)\\
                                                            g & (G)
                                                        \end{tabular}
                                                  };


            \node[align=left] (16) [right = -3mm of 16] {
                                                        \begin{tabular}{l l}
                                                            \multicolumn{2}{c}{Non-voisées}\\
                                                            p & (P)\\
                                                            t & (T)\\
                                                            k & (K)
                                                        \end{tabular}
                                                   };
        %\end{scope}

        \draw[-stealth, thick]
            (1.south) edge  (2.north)
            (1.south) edge  (3.north)
            (1.south) edge  (4.north)
            (3.south) edge (5.north)
            (3.south) edge (6.north)
            (4.south) edge (7.north)
            (4.south) edge (8.north)
            (4.south) edge (9.north)
            (4.south) to (10.north);
        \end{tikzpicture}

        \caption{Phonèmes de la langue française}
    \end{figure}
\end{document}

代码给出以下内容: 法语音素

我遇到的问题是,我想将“Semi-consonnes”下面的字符与所有其他字符垂直对齐。因此,我决定使用范围来放置所有字母节点(范围命令已在代码中注释),但垂直对齐不起作用。

欢迎提出任何意见或建议,提前致谢

答案1

改编:

  • 使用\usetikzlibrary{calc}来计算节点 13 的位置below =0pt of $(2 |- 12.north)$
  • 或者没有calc:(\node[align=left,anchor=north] (13) at (12.north -|2)正如 Torbjørn T. 在评论中所建议的那样)
  • 我用红色 ( ) 绘制了两个节点 (12 和 13) 的框架draw=red,以便您可以看到它是如何对齐的。

代码:

\documentclass[a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{float}
\usepackage[justification=centering]{caption}
\usepackage{mathtools}
\usepackage[pdftex]{graphicx}
\usepackage{setspace}
\usepackage[usenames, dvipsnames, pdftex]{xcolor}
\usepackage[utf8]{inputenc}     % Support for french language
\usepackage{wordlike}
\usepackage{txfonts}
\usepackage{tipa}

\usepackage{pgfplots}
\usetikzlibrary{arrows, shadows, positioning, calc}

\begin{document}
    \setlength{\tabcolsep}{2pt}

    \begin{figure}[H]
        \centering
        \begin{tikzpicture}
        [
            node distance = 8mm and 8mm,
            Node/.style={minimum size = 0.5cm, inner sep = 0pt},
        ]

        \node[Node] (1) {Phonèmes};
        \node[Node] (2) [below left = of 1] {Semi-consonnes};
        \node[Node] (3) [left       = of 2] {Voyelles};
        \node[Node] (4) [below right= of 1] {Consonnes};
        \node[Node] (5) [below left = of 3] {Orales};
        \node[Node] (6) [right      = of 5] {Nasales};
        \node[Node] (7) [below left = 8mm and 25mm of 4] {Liquides};
        \node[Node] (8) [right      = 12mm of 7] {Nasales};
        \node[Node] (9) [right      = of 8] {Fricatives};
        \node[Node] (10)[right      = of 9] {Occlusives};

        %\begin{scope}[below of=2, yshift=3cm]
        \node[align=left] (11)[below = of 5] { 
            \begin{tabular} {l l}
                \multicolumn{2}{c}{}\\
                i&(I)\\
                e&(EI)\\
                $\epsilon$&(AI)\\
                a&(A)\\
                \textipa{O}&(O)\\
                u&(OU)\\
                y&(U)\\
                $\varphi$&(EU)\\
                \oe&(\OE)\\
                \textipa{@}&(E)\\
                o&(AU)\\
                a&(A) % Must verify
            \end{tabular}
            };

        \node[align=left, draw=red] (12)[below = of 6] {
            \begin{tabular} {l l}
                \multicolumn{2}{c}{}\\
                $\tilde{\epsilon}$&(IN)\\
                $\tilde{\text{\oe}}$&(UN)\\
                \\
                $\tilde{\text{a}}$&(AN)\\
                $\tilde{\supset}$&(ON)
            \end{tabular}
        };

        \node[align=left, draw=red] (13) [below =0pt of $(2 |- 12.north)$] {
            \begin{tabular} {l l}
                \multicolumn{2}{c}{}\\
                j&(Y)\\
                w&(W)\\
                y&(UI)
            \end{tabular}
        };

        \node[align=left] (14) [below     = of 7] {
            \begin{tabular} {l l}
                \multicolumn{2}{c}{}\\
                l&(L)\\
                R&(R)
            \end{tabular}
        };

        \node[align=left] (15) [below     = of 8] {
            \begin{tabular} {l l}
                \multicolumn{2}{c}{}\\
                m&(M)\\
                n&(N)\\ % To be verified
                \textltailn&(GN)
            \end{tabular}
        };

        \node[align=left] (16) [right = -3mm of 15] {
            \begin{tabular}{l l}
                \multicolumn{2}{c}{Voisées}\\
                v & (V)\\
                z & (Z)\\
                \textipa{Z} & (J)
            \end{tabular}
        };

        \node[align=left] (16) [below right = 8mm and -9mm of 9] {
            \begin{tabular}{l l}
                \multicolumn{2}{c}{Non-voisées}\\
                f & (F)\\
                s & (S)\\
                \textipa{S} & (CH)\\
            \end{tabular}
        };

        \node[align=left] (16) [below right = 8mm and -13mm of 10] {
            \begin{tabular}{l l}
                \multicolumn{2}{c}{Voisées}\\
                b & (B)\\
                d & (D)\\
                g & (G)
            \end{tabular}
        };

        \node[align=left] (16) [right = -3mm of 16] {
            \begin{tabular}{l l}
                \multicolumn{2}{c}{Non-voisées}\\
                p & (P)\\
                t & (T)\\
                k & (K)
            \end{tabular}
        };
        %\end{scope}

        \draw[-stealth, thick]
            (1.south) edge  (2.north)
            (1.south) edge  (3.north)
            (1.south) edge  (4.north)
            (3.south) edge (5.north)
            (3.south) edge (6.north)
            (4.south) edge (7.north)
            (4.south) edge (8.north)
            (4.south) edge (9.north)
            (4.south) to (10.north);
        \end{tikzpicture}

        \caption{Phonèmes de la langue française}
    \end{figure}
\end{document}

结果:

在此处输入图片描述

相关内容