UPDATE: I opened a related question here.
I work in the field of linguistics and I sometimes need to analyze prefixes, affixes, and suffixes in words. It would be nice to be able to add notes to various parts of words using TikZ. So far, I can do almost what I would like. The problem is that I cannot put multiple parts of a word into separate nodes without an awkward space in between (making it look like multiple words) e.g. taivaissa should be one word (I would like to underline taiva, the root word, and put an explanation underneath and underline the suffix -issa, and also have an explanation underneath.
Criteria:
The solution should allow control over the distance from the bottom (or top depending on orientation) of the curly bracket (brace) to the description, in order to avoid potential overlapping when using long descriptions within the same word. (Ideally, the distance of the brace to word will also be variable as in the example below.)
The solution does not need to include the dependency-tikz package, I just use it here because it is an easy way to clearly and literally translate individual words. It would be a plus, however!
The Code:
\documentclass[]{beamer}
\usepackage{fontspec}
\usepackage{tikz-dependency}
% Klammern in Formeln
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}
\usepackage{xparse}
\NewDocumentCommand{\tikzbrace}{O{-2.5ex} m m O{} O{}}{%
\tikz[remember picture]\coordinate (left brace coord);%
#2%
\tikz[remember picture]\coordinate (right brace coord);%
\begin{tikzpicture}[remember picture,overlay,
transform canvas={yshift=#1}]
\draw [decoration={amplitude=1ex,brace},decorate,#4] %
(right brace coord) -- (left brace coord)
node [midway,below=1ex,font=\scriptsize,#5] {#3};
\end{tikzpicture}
}
\begin{document}
\begin{frame}{Satz 1}
\begin{dependency}[edge style={red,densely dotted}]
\begin{deptext}
\tikzbrace[-1ex]{Isae}{Vater} \& meidän, \& joka \& \tikzbrace[-1ex]{olet}{2Psg} \& \tikzbrace[-5ex]{taiva}{-\emph{issa}=pl (sg -\emph{ssa}) Inessiv, ähnlich Lokativ, e.g. talossa "in dem Haus"}issa,\\
\end{deptext}
\deproot[edge unit distance=1ex]{1}{Vater}
\deproot[edge unit distance=1ex]{2}{unserer}
\deproot[edge unit distance=1ex]{3}{wer}
\end{dependency}
\end{frame}
\end{document}