I have put together a language tree using the following code (MWE):
\documentclass[b5paper,11pt,twoside,one column,openright,draft]{memoir}
\usepackage{rotating}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\tikzset{every tree node/.style={align=center, anchor=north}} % to allow linebreaks
\begin{document}
\newlength{\egyptianlength}
\settowidth{\egyptianlength}{Egyptian}
\newlength{\msarabianlength}
\settowidth{\msarabianlength}{Modern South Arabian}
\newlength{\nwsemiticlength}
\settowidth{\nwsemiticlength}{Northwest Semitic}
\newlength{\canaanitelength}
\settowidth{\canaanitelength}{Canaanite}
\newlength{\pplength}
\settowidth{\pplength}{Phoenician/Punic}
\begin{figure}[p]
\begin{center}
\begin{turn}{90}
\begin{tikzpicture}
\tikzset{every tree node/.style={align=center,anchor=north,level distance=2\baselineskip}}
\tikzset{edge from parent/.style={draw,thick}}
\tikzset{level distance=2\baselineskip}
\Tree [.{Afro-Asiatic}
[.{\makebox[\egyptianlength][c]{Berber}} ]
[.{\makebox[\egyptianlength][c]{Chadic}} ]
[.{\makebox[\egyptianlength][c]{Egyptian}} ]
[.\node (Semitic) {\makebox[\egyptianlength][c]{Semitic}}; ]
[.{\makebox[\egyptianlength][c]{Cushitic}} ]
[.{\makebox[\egyptianlength][c]{Omotic}} ]
]
\node[below of=Semitic,yshift=-1.5em,xshift=-5.5em]{
\Tree [
[.{West Semitic}
[.{\makebox[\msarabianlength][c]{Ethiopian}} ]
[.\node (CentralSemitic) {\makebox[\msarabianlength][c]{Central Semitic}}; ]
[.{\makebox[\msarabianlength][c]{Modern South Arabian}} ]
]
[.{East Semitic}
Eblaite
Akkadian
]
]
};
\node[below of=CentralSemitic,yshift=-9.5em,xshift=-7.5em]{
\Tree [
[.{\makebox[\nwsemiticlength][c]{Old South Arabian}} ]
[.\node (NWSemitic) {{\makebox[\nwsemiticlength][c]{Northwest Semitic}}}; ]
[.{\makebox[\nwsemiticlength][c]{Arabic}} ]
]
};
\node[below of=NWSemitic,yshift=-13.75em,xshift=-8em]{
\Tree [
[.{\makebox[\canaanitelength][c]{Ugaritic}} ]
[.{\makebox[\canaanitelength][c]{Aramaic}} ]
[.\node (Canaanite) {{\makebox[\canaanitelength][c]{Canaanite}}}; ]
]
};
\node[below of=Canaanite,yshift=-17.75em,xshift=-3.1em]{
\Tree [
[.{\makebox[\pplength][c]{Phoenician/Punic}} ]
[.{\makebox[\pplength][c]{Moabite}} ]
[.{\makebox[\pplength][c]{Ammonite}} ]
[.{\makebox[\pplength][c]{Edomite}} ]
[.{\makebox[\pplength][c]{Hebrew}} ]
]
};
\end{tikzpicture}
\end{turn}
\end{center}
\caption{The Semitic languages in their Afro-Asiatic context}
\end{figure}
\end{document}
The fancy use of lengths and \makebox-es helps the tree not look so skewed. However, I have one problem, and one hope for 'a better way'…
Problem: the vertical distance between e.g. 'West Semitic' and 'Central Semitic' is much less (in terms of line length) than that between 'Central Semitic' and 'Northwest Semitic'.
Enhancement: it would be nice if the xshift and yshifts (which currently I determine by trial and error) could be made relative (i.e. drop down x from the baseline at the midpoint of the label text).
Any suggestions? I tried adjusting vertical distance based on info provided here but without success. Perhaps I'm not doing it properly….
Thanks!
Best Answer
This seems to be easier with standard
tikz
trees. In these node on a given level are evenly spaced and the vertical spacing is more uniform. You can adjust horizontal spacing in a sub-tree by settingsibling distance
:The paths all descend from a given point on the parent node, as I have specified
parent anchor=south
, rather than the standardborder
.I have specified
text height
andtext depth
to make sure nodes where the text has descenders are aligned with those where there are none.