3

I try to make the following table:

enter image description here

And for this I made just a simple table

\begin{longtable}{cccc cccc cccc cccc}
  {ho}  & {ha}  & {he}  & {hi}  & {bo}  & {ba}  & {be}  & {bi}  & {ko}  & {ka}  & {ke}  & {ki}  & {do}  & {da}  & {de}  & {di} \\
\end{longtable}

But, then, how to connect consones of a same “boplet” with half circles, and how to connect vowels with the uppers connectors?

It seems that there is no solution with tables, and I have to make it with TikZ. Anyway, what is the solution for this rendering?

Color and font isn’t important at all, is just used here as example to show.

  • 1
    What is the logic behind the arcs at the intersections. Look e.g. at the very left part of the green line. Why is there an arc when it crosses the red line but none when it crosses the blue line? (i am asking because I was playing with these things here but one can only succeed IMHO when there are clear rules.) – user121799 Oct 1 '18 at 15:33
  • Ow, @marmot, it’s just because I forget to put an arc in all intersections, just this :P. But, yes normally it have to be an arc in all intersections. – fauve Oct 1 '18 at 17:06
3

Here is a proposal. The connections are drawn by the macro

\Connect{<start>}{<end>}{<level>}{<color>}{<label>}

and here is the MWE.

\documentclass[border=3.14mm,standalone]{standalone}
\usepackage{tikz-dependency}
\usetikzlibrary{intersections} 
\newcounter{depaths}
\newif\ifIntersect
\tikzset{every picture/.append style={execute at begin picture={%
\xdef\LstPaths{}% may be unnecessary
\setcounter{depaths}{0}}}}
\newcommand{\Connect}[6][]{
\stepcounter{depaths}%\typeout{new\space path\space\thedepaths}
\draw[name path=dep connect \thedepaths-tmp,color=#5,#1](\wordref{1}{#2}.70) 
-- ++ (0,0.3+0.3*#4) coordinate (aux-\thedepaths-1)  -| 
(\wordref{1}{#3}.70) coordinate[pos=0.5] (aux-\thedepaths-2);
\ifnum#3>#2
  \node[anchor=south east,font=\tiny\sffamily,inner sep=1pt] at (aux-\thedepaths-1) {#6};
\else
  \node[anchor=south east,font=\tiny\sffamily,inner sep=1pt] at (aux-\thedepaths-2) {#6};
\fi
\ifnum\thedepaths>1  
  \foreach \Y [count=\X] in \LstPaths
  {\Intersectfalse
  %\typeout{checking\space intersection\space with\space path\space \X}
  \path[name intersections={of=dep connect \thedepaths-tmp and dep
  connect \X-tmp,total=\t}] \pgfextra{%\typeout{\t:\Y}
  \ifnum\t>0
  \global\Intersecttrue
  %\typeout{paths\space\X\space and\space\thedepaths \space\space have\space common\space points}
  \fi};  
  \foreach \V [count=\W] in \Y
  {\ifcase\W % no 0
  \or % 1 boring
  \or % 2
   \ifnum\V=#2
    %\typeout{case2-2}
    \global\Intersectfalse
   \fi
   \ifnum\V=#3
    %\typeout{case2-3}
    \global\Intersectfalse
   \fi
  \or
   \ifnum\V=#3
    %\typeout{case3-3}
    \global\Intersectfalse
   \fi
   \ifnum\V=#2
    %\typeout{case3-2}
    \global\Intersectfalse
   \fi
  \or
   \ifnum\V=#4
    %\typeout{case4}
    \global\Intersectfalse
   \fi
  \fi}  
  \ifIntersect
    \foreach [count=\ZZ] \XX in \Y
      {\ifnum\ZZ=5
      \xdef\oldcolor{\XX}
      \fi}
    \node[circle,fill=white,inner sep=0pt,outer sep=0pt,minimum size=2mm] (aux-int) at (intersection-1){};
    \draw[\oldcolor] (aux-int.west) -- (aux-int.east);
   \draw[white,double=#5] (aux-int.south) to[out=30,in=-30] (aux-int.north);
   %\typeout{real\space intersection\space of\space path\space \thedepaths\space with\space path\space \X}
  \fi
  }
\fi
\ifnum\thedepaths=1
  \xdef\LstPaths{{\thedepaths,#2,#3,#4,#5}}
\else
  \xdef\LstPaths{\LstPaths,{\thedepaths,#2,#3,#4,#5}}
\fi
}
\begin{document}
\begin{dependency}
\begin{deptext}[column sep=1pt]
{ho}  \& {ha}  \& {he}  \& {hi}  \& {bo}  \& {ba}  \& {be}  \& {bi}  \& {ko}  \& {ka}  \& {ke}  \& {ki}  \& {do}  \& {da}  \& {de}  \& {di} \\
\end{deptext}
\Connect{1}{13}{1}{red}{range 3}
\Connect{5}{13}{1}{red}{}
\Connect{9}{13}{1}{red}{}
\Connect{2}{14}{2}{cyan}{range 2}
\Connect{6}{14}{2}{cyan}{}
\Connect{10}{14}{2}{cyan}{}
\Connect{3}{15}{3}{green!60!black}{range 1}
\Connect{7}{15}{3}{green!60!black}{}
\Connect{11}{15}{3}{green!60!black}{}
\Connect{4}{16}{4}{orange}{range 0}
\Connect{8}{16}{4}{orange}{}
\Connect{12}{16}{4}{orange}{}
\foreach \Z [count=\n starting from 0,evaluate=\Z as \Zmax using
{int(\Z+2)},evaluate=\Z as \Ztest using {int(\Z+1)}] in {1,5,9,13}
{\foreach \X [evaluate=\X as \Y using {int(\X+1)}] in {\Z,...,\Zmax}
{\ifnum\X=\Ztest
\draw (\wordref{1}{\X}.-110) to[out=-90,in=-90] node[midway,below,font=\small\sffamily]{\n}  (\wordref{1}{\Y}.-110)
;
\else
\draw (\wordref{1}{\X}.-110) to[out=-90,in=-90] (\wordref{1}{\Y}.-110);
\fi
}
}
\end{dependency}
\end{document}

enter image description here

  • Ow, it’s not bad. But the top connectors have to point directly on the vowels (o, a, e, i), and the lowers connectors have to point on the consones (h, b, k, d). – fauve Oct 1 '18 at 21:01
  • 1
    @fauve I updated the answer. – user121799 Oct 1 '18 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.