LaTeX snippets

Making beautiful syntax trees

Below is some LaTeX code for making a tree I used in my dissertation. Note the faded constituent and dotted dependency line, which indicate an operation that may or may not have been completed by the parser. (You may need to tweak the highlighted portions depending on your .sty file, document class, or typeface.)

% Author: Lauren M Ackerman
% Available: https://lmackerman.com/latex-snippets/
\documentclass{scrartcl}
\usepackage{tikz-qtree}

\begin{document}

\begin{tikzpicture}[baseline]
\tikzset{level distance=22pt}
\filldraw[fill=black!20!white, draw=black,dashed] (3.05,-3) circle [x radius=.6cm, y radius=1.4cm];
\Tree [.CP$_{matrix}$ [.CP [.C$'$ [.C Whenever ] [.TP [.DP \edge[roof];\node(he){s/he}; ] [.T$'$ [.T ] [.VP [.\node(v){V$'$}; [.V leaves ] \edge[black!25!white,thick];[.{\color{black!25!white}DP} \edge[black!25!white,thick];[.{\color{black!25!white}D$'$} \edge[black!25!white,thick];[.{\color{black!25!white}D} \edge[black!25!white];{\color{black!25!white}'s} ] ] ] ] ] ] ] ] ] [.C ] [.TP [.DP [.D$'$ [.\node(ant){D}; ] ] ] [.T$'$ [.T ] [.V$'$ [.V ] ] ] ] ] ] ]
\draw[dashed,->](he)..controls +(south:6) and +(south:7)..(ant);
\end{tikzpicture}

\end{document}

syntax tree for 'whenever s/he leaves [john's house]'

Just for fun: heart-shaped tittles

Below is some LaTeX code for replacing the dots above “i” and “j” (i.e., tittles) with tiny hearts.

% Author: Lauren M Ackerman
% Available: https://lmackerman.com/latex-snippets/
% Date: June 8, 2016
\documentclass{scrartcl}
\usepackage{tikz,pifont}

% Heart shape adapted from Alain Matthes: http://altermundus.fr/index.html
\newcommand{\heart}{\begin{tikzpicture}\draw[baseline,fill=black, scale=0.005] (4,1) ..controls +(120:2cm) and +(90:2cm) .. (0,1) .. controls +(-90:2cm) and +(90:3cm) .. (4,-5.5) .. controls +(90:3cm) and +(-90:2cm) ..(8,1) .. controls +(90:2cm) and +(60:2cm) .. (4,1);
\end{tikzpicture}}
\newcommand{\hearti}{$\i$\kern-.22em{$\textsuperscript{\textsuperscript{\textsubscript{\heart}}}$}\kern-.05em}
\newcommand{\heartj}{$\j$\kern-.22em{$\textsuperscript{\textsuperscript{\textsubscript{\heart}}}$}\kern-.05em}


\begin{document}
I \heartj ust love play\hearti ng w\hearti th \LaTeX.

I just love playing with \LaTeX.
\end{document}

'i just love playing with LaTeX' with and without heart shaped tittles

 

Advertisements