=7)
lvl >=7 not implemented
%elseif;(max=0)
%else;
%let;l1;%expr(lev-1)%in;
%let;l2;%if;(lev>=2)%expr(lev-2)%else;0%end;%in;
%let;l3;%if;(lev>=3)%expr(lev-3)%else;0%end;%in;
%if;(lev=max)
%let;sosf;%expr(sx*2)%in;
%let;sosm;%expr(sx*2+1)%in;
%if;nnn.has_parents;
%for;i;0;l1;
%apply;vbar(i, sx, max, 0)
%for;j;1;wid; %end;
%end;
╭%for;i;1;wid;─%end;%nn;
%apply;access(sosf, "nnn.father")%nn;
%end;
%for;i;0;l2;
%apply;vbar(i, sx, max, 0)
%for;j;1;wid; %end;
%end;
%let;ds;%expr(sx-sx/2*2)%in;
%if;(max>1)%if;(ds=0)╭%else;╰%end;%for;i;1;wid;─%end;%end;%nn;
%apply;access(sx, "nnn")%nn;
%if;nnn.has_parents;
%for;i;0;l1;
%apply;vbar(i, sx, max, 1)
%for;j;1;wid; %end;
%end;
╰%for;i;1;wid;─%end;%nn;
%apply;access(sosm, "nnn.mother")%nn;
%end;
%else;
%let;sosf;%expr(sx*2)%in;
%let;sosm;%expr(sx*2+1)%in;
%if;nnn.has_parents;%apply;displ_parent(max, lev+1, "nnn.father", sosf, wid)%nn;%end;
%if;(max=4)
%for;i;0;l2;
%if;(i=0 and (sx=5 or sx=6))│%else; %end;
%for;j;1;wid; %end;
%end;
%elseif;(max=5)
%for;i;0;l2;
%if;((i=0 and (sx=5 or sx=6 or (sx>=10 and sx<=13))) or
(i=1 and (sx=9 or sx=10 or sx=13 or sx=14)) )│%else; %end;
%for;j;1;wid; %end;
%end;
%elseif;(max=6)
%for;i;0;l2;
%if;((i=0 and (sx=5 or sx=6 or (sx>=10 and sx<=13) or (sx>=20 and sx<=27))) or
(i=1 and (sx=9 or sx=10 or sx=13 or sx=14 or
(sx>=18 and sx<=21) or (sx>=26 and sx<=29))) or
(i=2 and (sx=17 or sx=18 or sx=21 or sx=22 or
sx=25 or sx=26 or sx=29 or sx=30)))│%else; %end;
%for;j;1;wid; %end;
%end;
%end;
%let;ds;%expr(sx-sx/2*2)%in;
%if;(lev>1)%if;(ds=0)╭%else;╰%end;%for;i;1;wid;─%end;%end;%nn;
%apply;access(sx, "nnn")%nn;
%if;nnn.has_parents;%apply;displ_parent(max, lev+1, "nnn.mother", sosm, wid)%nn;%end;
%end;
%end;
%end;
%if;has_parents;
%let;evarvh;%if;(evar.vh!="")%evar.vh;%else;3%end;%in;
%let;evartw;%if;(evar.twidth!="")%evar.twidth;%else;10%end;%in;
%let;evars;%if;(evar.sosa="on")1%else;0%end;%in;
[*preview family tree]
%if;not cancel_links;
%end;
%if;(evarvh>0)
%apply;displ_parent(evarvh, 1, "self", 1, evartw)
%else;
%apply;access(1, "self")%nn;
%end;
%end;