Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have to typeset some syllabic trees. They look like this:

A simple syllabic tree

I’m currently using the qtree package to typeset them, but I can’t figure out how to put all the last letters on the same level — like the red letters in the image above.

Here’s a code excerpt:

\Tree[.$\sigma$ [.A \ipa{Z} ] [.R [.N \ipa{e} ] [.Co N ] ] ]

And the output:

Output

So, /ʒ/, /e/ and /N/ should be on the same level. Is that possible? I have no problem migrating to TikZ — I only think that qtree is a more straightforward approach.

Just to make things clear, \ipa is a shorthand I created through \newcommand for \textipa , provided by the Rei Fukui’s fantastic tipa package.

share|improve this question

5 Answers 5

up vote 9 down vote accepted

Have a look at this thread, there are both tikz and tikz-qtree solutions there; this turns out to be very simple to do once you know the trick. Here's Alan Munn's final solution from there adapted for your particular question. (I didn't bother to try to get the IPA right.)

\documentclass{article}

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

\begin{document}

\begin{tikzpicture}[sibling
distance=10pt, level distance=20pt]

\Tree[.$\sigma$ [.A  [Z ] ] [.R [.N e ] [.Co N ] ] ]
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
This is actually much easier than Gonzalo’s answer. I’m going to accept this instead, although both are pretty good. As for the IPA, you just load the package tipa, and the command is \textipa — but I use \newcommand to shorten it to \ipa. I’ll add this piece of information in my question. –  rberaldo Jun 27 '11 at 14:56

Apparently, it is not possible, according to the qtree documentation:

Line up the text from all the leaf nodes on one horizontal line?

As far as I can tell, qtree’s design is incompatible with this style of tree. I’d love it if there was an easy way to give qtree this capability, but if there is, I haven’t figured it out.

You could use tikz instead:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{ipa}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
  [level 1/.style={sibling distance=15mm},
  level 2/.style={sibling distance=10mm}, 
  every node/.style={text height=0.5em,text depth=0em},
  level distance=8mm]
\node {$\sigma$}
child {node {A} 
  child { child {node {\ipa{Z}}}
  }
}
child {node {R}
  child {node {N} child {node {\ipa{e}}}}
  child {node {Co} child {node {N}}}
};
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
Thank you, that fits perfectly. I understand that there is a TikZ version of qtree, maybe it can be expanded to do this. –  rberaldo Jun 26 '11 at 20:16
3  
There's a simpler way to do this in tikz (see the link to a previous similar question, in my answer) -- add an extra child without adding a node at all. You don't have to worry about the formatting so much, that way. –  kgr Jun 26 '11 at 20:33
    
@kgr: right. Answer updated. Thank you. –  Gonzalo Medina Jun 26 '11 at 22:48

Try John Frampton's pst-asr package (requires pstricks). Used for "typesetting autosegmental representations"

The example the op provides can be seen (more or less) at pp. 26–27 in the documentation, and at the top of page 8 of the examples document except it is a more complex representation with the addition of timing slots. Highly recommended for the phonologist.

share|improve this answer

I just found another solution to this, involving the \vline command. Simply insert \vline as a parent node under the space you want to stretch (the example below is of a syllable structure diagram, but can be applied to anything), ie:

\Tree[.$\sigma$
 [.Onset
   [.{\vline height 3.3em} (C\textsubscript{1}) (C\textsubscript{2}) ]
 ]
 [.Rhyme
   [.(C\textsubscript{$\sigma$})
      [.Nucleus V\textsubscript{1}{ }(V\textsubscript{D}) ]
     [.Coda (C\textsubscript{3}) ] ]
 ]
]

enter image description here

You can specify the height and other properties of the vline to fit your particular tree. It seems this might be the simplest way, though perhaps not as elegant as the other solutions. Keep in mind that the \vline command and properties should be within curly braces.

share|improve this answer

To get that syllabic structure using pst-asr, the code is:

\newtier{tsy}
\asr[tsy=(sy) 3ex ($\sigma$)] |
    \@(0,ph){ʒ}\-(0,ts)
    \@(1,ph){e}\-(1,ts)
    \@(2,ph){N}\-(2,ts)
    \@(0,ts){A}\-(1,tsy)
    \@(1,ts){N}\-(1.5,sy)
    \@(2,ts){Co}\-(1.5,sy)
    \@(1.5,sy){R}\-(1,tsy)
    \@(1,tsy){$\sigma$}
\endasr

You have to add this in you preamble:

\usepackage{pstricks,pst-xkey,pst-asr,graphicx}
\newpsstyle{bigsyls}{extragap=.6ex,unitxgap=true,xgap=3.5ex,ts=0pt ($\times$),sy=5.5ex ($\sigma$) .7ex,ph=-4.5ex (pf)}
\newpsstyle{dashed}{linestyle=dashed,dash=3pt 2pt}
\newpsstyle{crossing}{xed=true,xedtype=\xedcirc,style=dashed}
\newpsstyle{dotted}{linestyle=dotted,linewidth=1.2pt,dotsep=1.6pt}
\def\feat#1{$\rm [#1]$}
\def\crossing{\pscircle[linestyle=solid,linewidth=.5pt](0,0){.7ex}}%
\newdimen\dimpuba
\newdimen\dimpubb
\def\TO{\quad$\rightarrow$\quad}
\tiershortcuts

The result is:

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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