I was wondering if there is any package for text annotation in Latex like Brat.

This is the kind of result I would like to obtain in a figure:

enter image description here

Is there a way to achieve that by using brat or some other libraries, without drawing it with inkscape and converting it to svg, or with tikz?

All solutions and hints accepted!


1 Answer 1


Just for fun, since I didn't know the tikz-dependency package percusse cited in his comment.


\begin{dependency}[label style={draw=white}]
\begin{deptext}[column sep=1em,
row 2/.style={nodes={fill=cyan!16, draw=white}}]
PRP \& VBD \& NNP \& NNP \&[2.5em] POS \& NN \&[-.5em] .\\[1.6ex]
It \& was \& Jesse \& Bear \& 's \& birthday \& . \\
\depedge[edge unit distance=2.5ex]{6}{1}{nsubj}
\depedge[edge unit distance=2.3ex]{6}{2}{cop}
\wordgroup[group style={fill=cyan!40, draw=cyan, inner sep=0pt}]{1}{1}{1}{a}
\wordgroup[group style={fill=green!40, draw=green, inner sep=0pt}]{1}{2}{2}{b}
\wordgroup[group style={fill=blue!40, draw=blue, inner sep=0pt}]{1}{3}{3}{c}
\wordgroup[group style={fill=blue!40, draw=blue, inner sep=0pt}]{1}{4}{4}{d}
\wordgroup[group style={fill=violet!40, draw=violet, inner sep=0pt}]{1}{5}{5}{e}
\wordgroup[group style={fill=blue!40, draw=blue, inner sep=0pt}]{1}{6}{6}{f}
\wordgroup[group style={fill=red!40, draw=red, inner sep=0pt}]{1}{7}{7}{g}
\foreach \ind in {1,..., 7}{
\draw[blue,decorate,decoration={brace}] (\wordref{2}{\ind}.north west)-- (\wordref{2}{\ind}.north east);}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .