tikz-qtree의 자동 세그먼트 표현

tikz-qtree의 자동 세그먼트 표현

이것이 내가 달성하고 싶은 것입니다

'mu'에서 'a'로 연결

이:

'O'에서 'l'로 연결

하지만 내가 tikz-qtree로 만들 수 있었던 것은 다음과 같습니다.

\documentclass[12pt,a4]{article}
\usepackage[utf8]{inputenc}
\usepackage{tipa,tikz,tikz-qtree}
\begin{document}

\begin{tikzpicture} [baseline]
\tikzset{frontier/.style={distance from root=90pt}}
\Tree
[.$\sigma$ [.O [ p ] ]
[.R [.$\mu$ a ] [.$\mu$ : ] ] ]
\end{tikzpicture}
\begin{tikzpicture} [baseline]
\tikzset{frontier/.style={distance from root=90pt}}
\Tree
[.$\sigma$ [.O [ p ] ]
[.R [.$\mu$ a ]  ] ]
\end{tikzpicture}

이:

\begin{tikzpicture}[baseline]
\tikzset{frontier/.style={distance from root=90pt}}
\Tree
[.$\sigma$ [.O [ l ] ]
[.R [.$\mu$ a ] [.$\mu$ l ] ] ]
\end{tikzpicture}
\begin{tikzpicture} [baseline]
\tikzset{frontier/.style={distance from root=90pt}}
\Tree
[.$\sigma$ [.O [ : ] ]
[.R [.$\mu$ a ] [ l ] ] ]
\end{tikzpicture}
\end{document}

어떤 렌더링:

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

그리고

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

여기서 중요한 부분은 나뭇잎에서 둘 이상의 부모로 연결하는 것입니다(선을 점선으로 만드는 옵션도 있으면 좋을 것입니다). 이제 pst-asr은 내가 원하는 것을 제대로 달성하지 못합니다. 내가 모라스('무')를 갖는 것이 중요합니다. (또한 pstricks 패키지이므로 DVIPSPDF로 조판해야 함을 의미합니다.) 나는 약간의 포리스트 패키지(특히 포리스트-GP1)를 시도했지만 원하는 대로 작동하도록 만들 수 없습니다. 마지막으로 일부에서는 자일링을 권장했지만 해당 패키지를 사용하기가 매우 어렵다고 생각합니다.

어떤 권장 사항이 있습니까?

감사해요.

답변1

실제로, 당신은 확실히 올바른 길을 가고 있었습니다. 코드에 몇 가지 사소한 추가 사항이 잘 작동합니다. 이는 이름을 지정할 수 있는 s와 ing의 좌표로 사용되는 이름을 tikz-qtree.sty사용할 수 있다는 사실을 기반으로 합니다 . 두 번째 예는 두 나무 사이에 선이 그려져 두 나무가 서로 옆에 나타날 수 있도록 해야 한다는 점에서 조금 더 복잡합니다. 양을 변경하여 두 번째 나무의 위치를 ​​조정할 수 있습니다 .\node\draw\begin{scope}...\end{scope}xshift

\documentclass{article}

\usepackage{tikz}
\usepackage{tikz-qtree}

\begin{document}

\begin{tikzpicture} [baseline]
\begin{scope}
\Tree
[.$\sigma$ [.O [ p ] ]
[.R [.$\mu$ \node[red](a){a}; ] \node(m){$\mu$}; ] ]
\draw (m.south) -- (a.north);
\end{scope}
\begin{scope}[xshift=0.65in]
\tikzset{frontier/.style={distance from root=90pt}}
\Tree
[.$\sigma$ [.O [ p ] ]
[.R [.$\mu$ a ]  ] ]
\end{scope}
\end{tikzpicture}

\begin{tikzpicture}[baseline]
\begin{scope}
\Tree
[.$\sigma$ [.O [ l ] ]
[.R [.$\mu$ a ] [.$\mu$ \node(l){l}; ] ] ]
\end{scope}
\begin{scope}[xshift=0.75in]
\Tree
[.$\sigma$ [.\node(O){O};  ]
[.R [.$\mu$ a ] [ l ] ] ]
\draw[dashed] (O.south) -- (l.north);
\end{scope}
\end{tikzpicture}

\end{document}

결과는 다음과 같습니다.

최신 출력.

답변2

이것은 으로 하기가 훨씬 쉽습니다 forest. phantom옵션을 사용하여 나무를 나란히 배치할 수 있으며 , 각 음절은 팬텀 노드의 딸이므로 다중 도메인 분기에 대한 노드 이름을 지정할 수 있습니다. 이 선은 일반 TikZ 명령으로 그려지기 때문에 관련 하위 팬텀도 만들어야 합니다. [dashed]일반 TiKZ 옵션을 사용하여 라인에 장식(예: )을 추가할 수 있습니다 . 다음은 해결된 두 가지 예입니다.

syll먼저 언어학에서 흔히 볼 수 있는 것처럼 노드 연결을 단단하게 만드는 스타일을 설정했습니다 . 또한 세그먼트가 서로 정렬되고 분기가 세그먼트 계층으로 확장되기를 원하기 때문에 모든 하위 노드를 계층에 할당했습니다 seg. 나는 또한 음절과 모라에 대한 몇 가지 매크로를 만들었습니다.

\documentclass{article}
\usepackage{forest}
\newcommand{\syl}{$\sigma$}
\newcommand{\mor}{$\mu$}
\forestset{syll/.style=
   {for tree={parent anchor=south,child anchor=north,
              align=center,inner sep=0pt,
              where n children=0{tier=seg}{}}}}
\begin{document}
\begin{forest}syll
[,phantom, s sep=1em
[\syl [O [p,tier=seg ]]
      [R [\mor [a,name=aa] ] [\mor,name=M [,phantom] ]]]
[\syl [O [p,tier=seg ]]
      [R [\mor [a] ]]]
]
\draw (M.south) -- (aa.north);
\end{forest}

\begin{forest}syll
[,phantom, s sep=1em
[\syl [O [l ]]
      [R [\mor [a]] [\mor [l,name=LL]]]]
[\syl [O,name=O [,phantom] ]
      [R [\mor [a] [l]]]]
]
\draw[dashed] (O.south) -- (LL.north);
\end{forest}


\end{document}

코드 출력

답변3

pst-asr에서 원하는 것을 얻을 수 있으며 XeTeX를 사용하면 문제가 없습니다(어쨌든 언어학에 권장됩니다). 지금은 컴퓨터 앞에 있지 않으니 나중에 코딩하고 출력해보세요!

편집하다

코드는 다음과 같습니다.

\documentclass{article}

\usepackage{pst-asr}
    \psset{everyasr=\tiershortcuts}
    \newpsstyle{dashed}{linestyle=dashed,dash=3pt 2pt}

\begin{document}

\newtier{con}
\psset{con=7ex (O)}
\newtier{sig}
\psset{sig=13ex (O)}
\asr[reptype=nots, sy=2ex ($\mu$)] |
    \@(0,ph){p}
    \@(1,ph){a}
    \@(3,ph){p}
    \@(4,ph){a}
    \@(1,sy){$\mu$}\-(1,ph)
    \@(2,sy){$\mu$}\-(1,ph)
    \@(4,sy){$\mu$}\-(4,ph)
    \@(0,con){O}\-(0,ph)
    \@(1,con){R}\-(1,sy)\-(2,sy)
    \@(3,con){O}\-(3,ph)
    \@(4,con){R}\-(4,sy)
    \@(.5,sig){$\sigma$}\-(0,con)\-(1,con)
    \@(3.5,sig){$\sigma$}\-(3,con)\-(4,con)
\endasr

\bigskip

\asr[reptype=nots, sy=2ex ($\mu$)] |
    \@(0,ph){l}
    \@(1,ph){a}
    \@(2,ph){l}
    \@(4,ph){a}
    \@(5,ph){l}
    \@(1,sy){$\mu$}\-(1,ph)
    \@(2,sy){$\mu$}\-(2,ph)
    \@(4,sy){$\mu$}\-(4,ph)
    \@(0,con){O}\-(0,ph)
    \@(1,con){R}\-(1,sy)\-(2,sy)
    \@(3,con){O}\-[style=dashed](2,ph)
    \@(4,con){R}\-(4,sy)\-(5,ph)
    \@(.5,sig){$\sigma$}\-(0,con)\-(1,con)
    \@(3.5,sig){$\sigma$}\-(3,con)\-(4,con)
\endasr

\end{document}

그리고 출력.

산출

관련 정보