3

I'm new here and I only recently started to use LaTeX.

This is what I'm trying to achieve:

enter image description here

Notice the vertical lines and the oblique lines. Vertical lines represent headedness.

This is what I'm able to do:

enter image description here

This is the code:

\documentclass[12pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{tipa}
\usepackage{tikz-qtree}

\begin{tikzpicture}[baseline]
\tikzset{frontier/.style={distance from root=100pt}}
\Tree
[.Pwd [.Ft [.$\sigma$ [.æ ] ] [.$\sigma$ [.l ] [.\textipa{\textschwa} ] ] ] [.Ft [.$\sigma$ [.b ] [. æ ] ] [.$\sigma$ [.m ] [.\textipa{\textschwa} ]] ] ]

\end{tikzpicture}
\end{document}

Edit: I have a new problem concerning this issue:

enter image description here

I would like the 'á' to be aligned with the mora ($\mu$), the syllable ($\sigma$), the Foot (Ft) and the Prosodic word (Pwd). The 's' should be on the left (like it right now) but without going over.

Here is the code:

\begin{forest}
for tree={s sep=0, inner sep=0.8mm, l=0, parent anchor=south, child anchor=north} 
[Pwd [Ft, calign=first [$\sigma$, calign=center [s, tier=word ] [$\mu$ [\'a, tier=word, name=C ] ] [$\mu$, name=B] [$\mu$ [t , name=D ] ] ] [$\sigma$, name=A [$\mu$ [u, tier=word ] ] ] ] ]
\draw[-] (D.north)--(A.south);
\draw[-] (C.north)--(B.south);
\end{forest}
\end{document}

Thank you

5

If you consider switching to forest, then you only need to set the appropriate calign keys. (forest has IMHO many advantages over tikz-qtree and is based on tikz, so you can use all tikz stuff, too.)

\documentclass{article}
\usepackage[edges]{forest}
\usepackage{tipa}
\begin{document}
\begin{forest}
for tree={parent anchor=south,where level={1}{calign=first}{calign=last}}
[Pwd 
 [Ft 
  [$\sigma$ 
   [\ae ] 
  ] 
  [$\sigma$ 
   [l ] 
   [\textipa{\textschwa} 
   ] 
  ] 
 ] 
 [Ft 
  [$\sigma$ 
   [b ] 
   [\ae ] 
  ] 
  [$\sigma$ 
   [m ] 
   [\textipa{\textschwa} 
   ]
  ] 
 ] 
]
\end{forest}
\end{document}

enter image description here

  • Is there a way to make lines meet (and touch) at every node with Forest? I have tried to use it but could not figure this one out. – Scharl Apr 12 at 16:19
  • @Scharl Sure, just add parent anchor=south. I edited the answer accordingly. – user121799 Apr 12 at 16:34
5

It is not so difficult with TIkZ's matrix:

\documentclass[tikz]{standalone}
\usepackage{tipa}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of nodes,nodes={minimum width=.8cm}] {%
    & & & & PWd & &\\[2em]
    Ft & & & & Ft & &\\[2em]
    $\sigma$ & & $\sigma$ & & $\sigma$ & & $\sigma$\\[2em]
    \`\ae & l & \textipa{\textschwa} & b & \'\ae & m & \textipa{\textschwa}\\
};
\draw (m-2-1.north) -- (m-1-5.south) -- (m-2-5.north);
\draw (m-3-1.north) -- (m-2-1.south) -- (m-3-3.north);
\draw (m-3-5.north) -- (m-2-5.south) -- (m-3-7.north);
\draw (m-4-1.north) -- (m-3-1.south);
\draw (m-4-2.north) -- (m-3-3.south) -- (m-4-3.north);
\draw (m-4-4.north) -- (m-3-5.south) -- (m-4-5.north);
\draw (m-4-6.north) -- (m-3-7.south) -- (m-4-7.north);
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.