1

In the following link is an example of the Quran Corpus with dependency graphs:

https://corpus.quran.com/treebank.jsp?chapter=112&verse=1

I am specifically looking at this part:

corpus-layout

It has:

  • word-position
  • transliteration
  • translation
  • arabic
  • Word types(noun, pronoun)
  • Syntactic relations

For the portion of: word-position, transliteration, translation, arabic

I found this answer: https://stackoverflow.com/questions/2907327/dual-line-bilingual-paragraph-in-latex/3150009#3150009

Which explains that I can use this .sty file and structure to create the word-for-word portion (see Q2 below). I have 2 questions:

  1. How can I create the word types and syntactic relations portions in Latex?
  2. The answer linked above is 11 years old. Is there an improved way to achieve word-for-word structures now?
ElCapistan
  • 23
  • 3

1 Answers1

4

You can get close with the tikz-dependency package

\documentclass{article}
\usepackage{tikz-dependency}
\begin{document}
\sffamily
\begin{dependency}[edge below, arc edge, text only label, label style={below}]
\begin{deptext}[column sep=.5cm, row sep=.5ex]
\&\&\&\&\\\textcolor{gray}{(112:1:4)} \& \textcolor{gray}{(112:1:3)} \& \textcolor{gray}{(112:1:2)} \& \& \textcolor{gray}{(112:1:1)}\\
\textcolor{cyan}{ahadun} \& \textcolor{cyan}{l-lahu} \& \textcolor{cyan}{huwa} \&  \& \textcolor{cyan}{qul}\\
the One. \& (is) Allah, \& ``He \&  \& Say,\\[3ex]
\textcolor{cyan}{\Huge A} \& \textcolor{teal}{\Huge B} \& \textcolor{darkgray}{\Huge C} \& \textcolor{lightgray}{\Huge D} \& \textcolor{green}{\Huge E}\\
\textcolor{cyan}{$\bullet$} \& \textcolor{teal}{$\bullet$} \& \textcolor{darkgray}{$\bullet$} \& \textcolor{lightgray}{$\bullet$} \& \textcolor{green}{$\bullet$}\\
\textcolor{cyan}{\large N} \& \textcolor{teal}{\large PN} \& \textcolor{darkgray}{\large PRON} \& \textcolor{lightgray}{\large PRON} \& \textcolor{green}{\large V}\\[6ex]
\noalign{\global\arrayrulewidth=.3mm}\cline{2-5}
\& \textcolor{teal}{$\bullet$} \&  \& \& \\
\& \textcolor{teal}{\large NS} \&  \& \& \\
\end{deptext}
\wordgroup[group style={draw=none}]{7}{1}{1}{a1}
\wordgroup[group style={draw=none}]{7}{2}{2}{a2}
\wordgroup[group style={draw=none}]{7}{3}{3}{a3}
\wordgroup[group style={draw=none}]{7}{4}{4}{a4}
\wordgroup[group style={draw=none}]{7}{5}{5}{a5}
\wordgroup[group style={draw=none}]{9}{2}{2}{b1}
\groupedge[edge style={cyan, thick}, label style={cyan}]{a1}{a2}{a}{4ex}
\groupedge[edge style={darkgray, thick}, label style={darkgray}]{a2}{a3}{b}{4ex}
\groupedge[edge style={cyan, thick}, label style={cyan}]{a4}{a5}{c}{4ex}
\groupedge[edge style={darkgray, thick}, label style={darkgray}]{b1}{a5}{d}{4ex}
\end{dependency}
\end{document}

enter image description here

If the website generates these though, it might make more sense to simply include them as images.

Dan
  • 3,699
  • Wow! Thank you so much. Can you tell me if you did this by hand or did you use some editor to handle most of the layout stuff? – ElCapistan Nov 15 '21 at 19:28
  • @ElCapistan I did it by hand. It is not too hard if you follow the documentation: https://ctan.math.illinois.edu/graphics/pgf/contrib/tikz-dependency/tikz-dependency-doc.pdf – Dan Nov 15 '21 at 19:30
  • is there any way to use an editor to handle many of the dependency drawings? Doing this for 800+ pages(13 line Qurans) might take a long time... – ElCapistan Nov 15 '21 at 19:35
  • @ElCapistan I don't know of any way to really automate this as I imagine each graph will be different. It might be easier to make the graphs with some external tool and then simply input them into LaTeX as images. – Dan Nov 15 '21 at 19:45