2

I'm fairly new to LaTeX/TikZ and I have written a python script that generates .tex files for our dependency graphs.

The problem is that I encountered two errors or warnings when I compile these .tex files with pdflatex to PDF. They are generated but the following message comes up:

! Dimension too large.
<recently read> \pgf@xa 

l.167 ...art, below, sloped] {nsubj}(3token.south)
                                                  ;
? 
! Dimension too large.
<recently read> \pgf@xa 

l.168 ...art, below, sloped] {nsubj}(3token.south)
                                                  ;
? 

I guess it is the arrows that I'm trying to draw at the bottom of the text tokens but I can't see why they don't work in this case and do in other files. It is just the case in 2 of 660 files, so I don't see where this error is coming from.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{graphs, positioning, arrows.meta}
\begin{document}
\tikzset{token/.style={
rectangle,
minimum size=8mm,
very thick,
draw=green!50,
text height=4ex,
text depth=1ex,
node distance=0.5,
font=\sffamily\huge
}}
\tikzset
{root/.style={
font =\sffamily,
circle,
minimum size=10mm,
very thick,
draw = black,
top color = white,
bottom color = black!20
}}
\tikzset{knot/.style={
font =\sffamily,
rectangle,
minimum size=6mm,
rounded corners=3mm,
very thick,
draw = black,
top color = white,
bottom color = black!20
}}
\tikzset{label/.style={
font=\sffamily\LARGE,
thick
}}
\def\hoch{4}
\begin{tikzpicture}
%TOKEN NODES
\node (1token) [token, below] at (0,0) {(1)BMPs};
\node (2token) [token, right=of 1token] {(2)are};
\node (3token) [token, right=of 2token] {(3)members};
\node (4token) [token, right=of 3token] {(4)of};
\node (5token) [token, right=of 4token] {(5)the};
\node (6token) [token, right=of 5token] {(6)transforming};
\node (7token) [token, right=of 6token] {(7)growth};
\node (8token) [token, right=of 7token] {(8)factor};
\node (9token) [token, right=of 8token] {(9)-};
\node (10token) [token, right=of 9token] {(10)beta};
\node (11token) [token, right=of 10token] {(11)(};
\node (12token) [token, right=of 11token] {(12)TGF};
\node (13token) [token, right=of 12token] {(13)-};
\node (14token) [token, right=of 13token] {(14)beta};
\node (15token) [token, right=of 14token] {(15))};
\node (16token) [token, right=of 15token] {(16)family};
\node (17token) [token, right=of 16token] {(17)that};
\node (18token) [token, right=of 17token] {(18)bind};
\node (19token) [token, right=of 18token] {(19)to};
\node (20token) [token, right=of 19token] {(20)type};
\node (21token) [token, right=of 20token] {(21)II};
\node (22token) [token, right=of 21token] {(22)and};
\node (23token) [token, right=of 22token] {(23)type};
\node (24token) [token, right=of 23token] {(24)I};
\node (25token) [token, right=of 24token] {(25)serine};
\node (26token) [token, right=of 25token] {(26)-};
\node (27token) [token, right=of 26token] {(27)threonine};
\node (28token) [token, right=of 27token] {(28)kinase};
\node (29token) [token, right=of 28token] {(29)receptors};
\node (30token) [token, right=of 29token] {(30),};
\node (31token) [token, right=of 30token] {(31)and};
\node (32token) [token, right=of 31token] {(32)transduce};
\node (33token) [token, right=of 32token] {(33)signals};
\node (34token) [token, right=of 33token] {(34)through};
\node (35token) [token, right=of 34token] {(35)Smad};
\node (36token) [token, right=of 35token] {(36)and};
\node (37token) [token, right=of 36token] {(37)non-Smad};
\node (38token) [token, right=of 37token] {(38)signalling};
\node (39token) [token, right=of 38token] {(39)pathways};
\node (40token) [token, right=of 39token] {(40).};
%ANCHOR NODES
\node (1) [knot, above=0.1cm+0*\hoch cm of 1token] {1};
\node (2) [knot, above=0.1cm+0*\hoch cm of 2token] {2};
\node (3) [knot, above=0.1cm+6*\hoch cm of 3token] {3};
\node (4) [knot, above=0.1cm+0*\hoch cm of 4token] {4};
\node (5) [knot, above=0.1cm+0*\hoch cm of 5token] {5};
\node (6) [knot, above=0.1cm+0*\hoch cm of 6token] {6};
\node (7) [knot, above=0.1cm+0*\hoch cm of 7token] {7};
\node (8) [knot, above=0.1cm+1*\hoch cm of 8token] {8};
\node (9) [knot, above=0.1cm+0*\hoch cm of 9token] {9};
\node (10) [knot, above=0.1cm+2*\hoch cm of 10token] {10};
\node (11) [knot, above=0.1cm+0*\hoch cm of 11token] {11};
\node (12) [knot, above=0.1cm+0*\hoch cm of 12token] {12};
\node (13) [knot, above=0.1cm+0*\hoch cm of 13token] {13};
\node (14) [knot, above=0.1cm+1*\hoch cm of 14token] {14};
\node (15) [knot, above=0.1cm+0*\hoch cm of 15token] {15};
\node (16) [knot, above=0.1cm+3*\hoch cm of 16token] {16};
\node (17) [knot, above=0.1cm+0*\hoch cm of 17token] {17};
\node (18) [knot, above=0.1cm+5*\hoch cm of 18token] {18};
\node (19) [knot, above=0.1cm+0*\hoch cm of 19token] {19};
\node (20) [knot, above=0.1cm+4*\hoch cm of 20token] {20};
\node (21) [knot, above=0.1cm+0*\hoch cm of 21token] {21};
\node (22) [knot, above=0.1cm+0*\hoch cm of 22token] {22};
\node (23) [knot, above=0.1cm+1*\hoch cm of 23token] {23};
\node (24) [knot, above=0.1cm+0*\hoch cm of 24token] {24};
\node (25) [knot, above=0.1cm+0*\hoch cm of 25token] {25};
\node (26) [knot, above=0.1cm+0*\hoch cm of 26token] {26};
\node (27) [knot, above=0.1cm+1*\hoch cm of 27token] {27};
\node (28) [knot, above=0.1cm+0*\hoch cm of 28token] {28};
\node (29) [knot, above=0.1cm+2*\hoch cm of 29token] {29};
\node (30) [knot, above=0.1cm+0*\hoch cm of 30token] {30};
\node (31) [knot, above=0.1cm+0*\hoch cm of 31token] {31};
\node (32) [knot, above=0.1cm+3*\hoch cm of 32token] {32};
\node (33) [knot, above=0.1cm+0*\hoch cm of 33token] {33};
\node (34) [knot, above=0.1cm+0*\hoch cm of 34token] {34};
\node (35) [knot, above=0.1cm+2*\hoch cm of 35token] {35};
\node (36) [knot, above=0.1cm+0*\hoch cm of 36token] {36};
\node (37) [knot, above=0.1cm+0*\hoch cm of 37token] {37};
\node (38) [knot, above=0.1cm+0*\hoch cm of 38token] {38};
\node (39) [knot, above=0.1cm+1*\hoch cm of 39token] {39};
\node (40) [knot, above=0.1cm+0*\hoch cm of 40token] {40};
%ROOT NODE
\node[root,above=1*\hoch cm of 3] (0) {ROOT};
%EDGES WITH LABELS
\draw[-,black,thick](0) -- node[label,near end,above,sloped] {root}(3);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {conj:and}(32);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {nsubj}(1);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {cop}(2);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {punct}(40);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {nmod:of}(10);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {ref}(17);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {acl:relcl}(18);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {cc}(31);
\draw[-,black,thick](8) -- node[label,near end,above,sloped] {compound}(7);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {case}(4);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {det}(5);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {amod}(6);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {compound}(8);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {punct}(9);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {appos}(14);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {punct}(15);
\draw[-,black,thick](14) -- node[label,near end,above,sloped] {punct}(11);
\draw[-,black,thick](14) -- node[label,near end,above,sloped] {compound}(12);
\draw[-,black,thick](14) -- node[label,near end,above,sloped] {punct}(13);
\draw[-,black,thick](16) -- node[label,near end,above,sloped] {conj}(29);
\draw[-,black,thick](18) -- node[label,near end,above,sloped] {xcomp}(20);
\draw[-,black,thick](18) -- node[label,near end,above,sloped] {cc}(22);
\draw[-,black,thick](20) -- node[label,near end,above,sloped] {nsubj}(16);
\draw[-,black,thick](20) -- node[label,near end,above,sloped] {aux}(19);
\draw[-,black,thick](20) -- node[label,near end,above,sloped] {dobj}(21);
\draw[-,black,thick](23) -- node[label,near end,above,sloped] {compound}(24);
\draw[-,black,thick](27) -- node[label,near end,above,sloped] {compound}(25);
\draw[-,black,thick](27) -- node[label,near end,above,sloped] {punct}(26);
\draw[-,black,thick](29) -- node[label,near end,above,sloped] {compound}(27);
\draw[-,black,thick](29) -- node[label,near end,above,sloped] {compound}(28);
\draw[-,black,thick](29) -- node[label,near end,above,sloped] {punct}(30);
\draw[-,black,thick](29) -- node[label,near end,above,sloped] {compound}(23);
\draw[-,black,thick](32) -- node[label,near end,above,sloped] {dobj}(33);
\draw[-,black,thick](32) -- node[label,near end,above,sloped] {nmod:through}(35);
\draw[-,black,thick](35) -- node[label,near end,above,sloped] {case}(34);
\draw[-,black,thick](35) -- node[label,near end,above,sloped] {cc}(36);
\draw[-,black,thick](35) -- node[label,near end,above,sloped] {conj:and}(39);
\draw[-,black,thick](39) -- node[label,near end,above,sloped] {amod}(37);
\draw[-,black,thick](39) -- node[label,near end,above,sloped] {compound}(38);
%BACK RELATION EDGES WITH LABELS
\draw[-{Latex[length=5mm,red]}, red](20token.south) to[out = -150, in =-30] node[label, near start, below, sloped] {nsubj}(3token.south);
\draw[-{Latex[length=5mm,red]}, red](18token.south) to[out = -150, in =-30] node[label, near start, below, sloped] {nsubj}(3token.south);
%HELP EDGES
\draw[-,dotted,black!80,thick] (3token) -- (3);
\draw[-,dotted,black!80,thick] (8token) -- (8);
\draw[-,dotted,black!80,thick] (10token) -- (10);
\draw[-,dotted,black!80,thick] (14token) -- (14);
\draw[-,dotted,black!80,thick] (16token) -- (16);
\draw[-,dotted,black!80,thick] (18token) -- (18);
\draw[-,dotted,black!80,thick] (20token) -- (20);
\draw[-,dotted,black!80,thick] (23token) -- (23);
\draw[-,dotted,black!80,thick] (27token) -- (27);
\draw[-,dotted,black!80,thick] (29token) -- (29);
\draw[-,dotted,black!80,thick] (32token) -- (32);
\draw[-,dotted,black!80,thick] (35token) -- (35);
\draw[-,dotted,black!80,thick] (39token) -- (39);
\end{tikzpicture}
\end{document}
3
  • This usually occurs when something is divided with a very small number leading to overflow. Such as a path is too short and you would like to place and arrow which involves fraction of the path computations or a node to be placed along this path.
    – percusse
    Aug 3, 2017 at 9:20
  • @percusse In this case, the “near end” nodes placed on many edges might be the source of the problem. But that's still strange, since all those nodes seem to have at least 0.1 cm between them. Anyway, maybe trying to replace “near end” and stuff by pos = <number between zero and one> would be an idea. Or putting more distance between the nodes. If it makes the figure to large, maybe the scale option could then squeeze it back.
    – Alice M.
    Aug 3, 2017 at 11:32
  • By the way, there is a tikz library for dependency graphs: tex.stackexchange.com/questions/50128/…
    – Alice M.
    Aug 3, 2017 at 11:46

1 Answer 1

1

? I could compile your code by removing [out = -150, in =-30] for the edges linking 20token.south to 3token.south and 18token.south to 3token.south respectively, but I have no idea why that worked. And it might be flawed since I had to change the arrow type because I do not seem to have the meta sublibrary or something.

Maybe the chosen angles produce a large curve that goes too far away. There are parameters like looseness or max distance that could prevent this from happening. Check the manual of pgf for more info. Maybe using bend left or bend right instead of specified in and out angles would be more robust in your case, too.

Edit: bending the edge seemed to cause problems anyway in my case, so I went with a different approach:

\draw[->, red, rounded corners = 0.5cm]
    (20token.south) -- ++(0, -1cm)
    -- node[label, near start, below, sloped] {nsubj}
    ($(3token.south) + (0, -1cm)$) -- (3token.south);
\draw[->, red, rounded corners = 0.5cm]
    (18token.south) -- ++(0, -2cm)
    -- node[label, near start, below, sloped] {nsubj}
    ($(3token.south) + (0, -2cm)$) -- (3token.south);

Notes: (1) You will have to put back your custom arrow tips. (2) The $blabla$ computations need the calc tikz library (not the calc latex package).

enter image description here

Random suggestion: Since you're loading the positioning library, you can use angles as anchors:

\draw[->, red, rounded corners = 0.5cm]
    (20token.south) -- ++(0, -1cm)
    -- node[label, near start, below, sloped] {nsubj}
    ($(3token.260) + (0, -1cm)$) -- (3token.260);
\draw[->, red, rounded corners = 0.5cm]
    (18token.south) -- ++(0, -2cm)
    -- node[label, near start, below, sloped] {nsubj}
    ($(3token.220) + (0, -2cm)$) -- (3token.220);

In this example, the two arrows end up in slightly different places instead of crashing into each other:

enter image description here

Complete code, but without the fancy arrows that I unfortunately cannot use:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{graphs, positioning, arrows, calc}
\begin{document}
\tikzset{token/.style={
rectangle,
minimum size=8mm,
very thick,
draw=green!50,
text height=4ex,
text depth=1ex,
node distance=0.5,
font=\sffamily\huge
}}
\tikzset
{root/.style={
font =\sffamily,
circle,
minimum size=10mm,
very thick,
draw = black,
top color = white,
bottom color = black!20
}}
\tikzset{knot/.style={
font =\sffamily,
rectangle,
minimum size=6mm,
rounded corners=3mm,
very thick,
draw = black,
top color = white,
bottom color = black!20
}}
\tikzset{label/.style={
font=\sffamily\LARGE,
thick
}}
\def\hoch{4}
\begin{tikzpicture}
%TOKEN NODES
\node (1token) [token, below] at (0,0) {(1)BMPs};
\node (2token) [token, right=of 1token] {(2)are};
\node (3token) [token, right=of 2token] {(3)members};
\node (4token) [token, right=of 3token] {(4)of};
\node (5token) [token, right=of 4token] {(5)the};
\node (6token) [token, right=of 5token] {(6)transforming};
\node (7token) [token, right=of 6token] {(7)growth};
\node (8token) [token, right=of 7token] {(8)factor};
\node (9token) [token, right=of 8token] {(9)-};
\node (10token) [token, right=of 9token] {(10)beta};
\node (11token) [token, right=of 10token] {(11)(};
\node (12token) [token, right=of 11token] {(12)TGF};
\node (13token) [token, right=of 12token] {(13)-};
\node (14token) [token, right=of 13token] {(14)beta};
\node (15token) [token, right=of 14token] {(15))};
\node (16token) [token, right=of 15token] {(16)family};
\node (17token) [token, right=of 16token] {(17)that};
\node (18token) [token, right=of 17token] {(18)bind};
\node (19token) [token, right=of 18token] {(19)to};
\node (20token) [token, right=of 19token] {(20)type};
\node (21token) [token, right=of 20token] {(21)II};
\node (22token) [token, right=of 21token] {(22)and};
\node (23token) [token, right=of 22token] {(23)type};
\node (24token) [token, right=of 23token] {(24)I};
\node (25token) [token, right=of 24token] {(25)serine};
\node (26token) [token, right=of 25token] {(26)-};
\node (27token) [token, right=of 26token] {(27)threonine};
\node (28token) [token, right=of 27token] {(28)kinase};
\node (29token) [token, right=of 28token] {(29)receptors};
\node (30token) [token, right=of 29token] {(30),};
\node (31token) [token, right=of 30token] {(31)and};
\node (32token) [token, right=of 31token] {(32)transduce};
\node (33token) [token, right=of 32token] {(33)signals};
\node (34token) [token, right=of 33token] {(34)through};
\node (35token) [token, right=of 34token] {(35)Smad};
\node (36token) [token, right=of 35token] {(36)and};
\node (37token) [token, right=of 36token] {(37)non-Smad};
\node (38token) [token, right=of 37token] {(38)signalling};
\node (39token) [token, right=of 38token] {(39)pathways};
\node (40token) [token, right=of 39token] {(40).};
%ANCHOR NODES
\node (1) [knot, above=0.1cm+0*\hoch cm of 1token] {1};
\node (2) [knot, above=0.1cm+0*\hoch cm of 2token] {2};
\node (3) [knot, above=0.1cm+6*\hoch cm of 3token] {3};
\node (4) [knot, above=0.1cm+0*\hoch cm of 4token] {4};
\node (5) [knot, above=0.1cm+0*\hoch cm of 5token] {5};
\node (6) [knot, above=0.1cm+0*\hoch cm of 6token] {6};
\node (7) [knot, above=0.1cm+0*\hoch cm of 7token] {7};
\node (8) [knot, above=0.1cm+1*\hoch cm of 8token] {8};
\node (9) [knot, above=0.1cm+0*\hoch cm of 9token] {9};
\node (10) [knot, above=0.1cm+2*\hoch cm of 10token] {10};
\node (11) [knot, above=0.1cm+0*\hoch cm of 11token] {11};
\node (12) [knot, above=0.1cm+0*\hoch cm of 12token] {12};
\node (13) [knot, above=0.1cm+0*\hoch cm of 13token] {13};
\node (14) [knot, above=0.1cm+1*\hoch cm of 14token] {14};
\node (15) [knot, above=0.1cm+0*\hoch cm of 15token] {15};
\node (16) [knot, above=0.1cm+3*\hoch cm of 16token] {16};
\node (17) [knot, above=0.1cm+0*\hoch cm of 17token] {17};
\node (18) [knot, above=0.1cm+5*\hoch cm of 18token] {18};
\node (19) [knot, above=0.1cm+0*\hoch cm of 19token] {19};
\node (20) [knot, above=0.1cm+4*\hoch cm of 20token] {20};
\node (21) [knot, above=0.1cm+0*\hoch cm of 21token] {21};
\node (22) [knot, above=0.1cm+0*\hoch cm of 22token] {22};
\node (23) [knot, above=0.1cm+1*\hoch cm of 23token] {23};
\node (24) [knot, above=0.1cm+0*\hoch cm of 24token] {24};
\node (25) [knot, above=0.1cm+0*\hoch cm of 25token] {25};
\node (26) [knot, above=0.1cm+0*\hoch cm of 26token] {26};
\node (27) [knot, above=0.1cm+1*\hoch cm of 27token] {27};
\node (28) [knot, above=0.1cm+0*\hoch cm of 28token] {28};
\node (29) [knot, above=0.1cm+2*\hoch cm of 29token] {29};
\node (30) [knot, above=0.1cm+0*\hoch cm of 30token] {30};
\node (31) [knot, above=0.1cm+0*\hoch cm of 31token] {31};
\node (32) [knot, above=0.1cm+3*\hoch cm of 32token] {32};
\node (33) [knot, above=0.1cm+0*\hoch cm of 33token] {33};
\node (34) [knot, above=0.1cm+0*\hoch cm of 34token] {34};
\node (35) [knot, above=0.1cm+2*\hoch cm of 35token] {35};
\node (36) [knot, above=0.1cm+0*\hoch cm of 36token] {36};
\node (37) [knot, above=0.1cm+0*\hoch cm of 37token] {37};
\node (38) [knot, above=0.1cm+0*\hoch cm of 38token] {38};
\node (39) [knot, above=0.1cm+1*\hoch cm of 39token] {39};
\node (40) [knot, above=0.1cm+0*\hoch cm of 40token] {40};
%ROOT NODE
\node[root,above=1*\hoch cm of 3] (0) {ROOT};
%EDGES WITH LABELS
\draw[-,black,thick](0) -- node[label,near end,above,sloped] {root}(3);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {conj:and}(32);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {nsubj}(1);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {cop}(2);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {punct}(40);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {nmod:of}(10);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {ref}(17);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {acl:relcl}(18);
\draw[-,black,thick](3) -- node[label,near end,above,sloped] {cc}(31);
\draw[-,black,thick](8) -- node[label,near end,above,sloped] {compound}(7);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {case}(4);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {det}(5);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {amod}(6);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {compound}(8);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {punct}(9);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {appos}(14);
\draw[-,black,thick](10) -- node[label,near end,above,sloped] {punct}(15);
\draw[-,black,thick](14) -- node[label,near end,above,sloped] {punct}(11);
\draw[-,black,thick](14) -- node[label,near end,above,sloped] {compound}(12);
\draw[-,black,thick](14) -- node[label,near end,above,sloped] {punct}(13);
\draw[-,black,thick](16) -- node[label,near end,above,sloped] {conj}(29);
\draw[-,black,thick](18) -- node[label,near end,above,sloped] {xcomp}(20);
\draw[-,black,thick](18) -- node[label,near end,above,sloped] {cc}(22);
\draw[-,black,thick](20) -- node[label,near end,above,sloped] {nsubj}(16);
\draw[-,black,thick](20) -- node[label,near end,above,sloped] {aux}(19);
\draw[-,black,thick](20) -- node[label,near end,above,sloped] {dobj}(21);
\draw[-,black,thick](23) -- node[label,near end,above,sloped] {compound}(24);
\draw[-,black,thick](27) -- node[label,near end,above,sloped] {compound}(25);
\draw[-,black,thick](27) -- node[label,near end,above,sloped] {punct}(26);
\draw[-,black,thick](29) -- node[label,near end,above,sloped] {compound}(27);
\draw[-,black,thick](29) -- node[label,near end,above,sloped] {compound}(28);
\draw[-,black,thick](29) -- node[label,near end,above,sloped] {punct}(30);
\draw[-,black,thick](29) -- node[label,near end,above,sloped] {compound}(23);
\draw[-,black,thick](32) -- node[label,near end,above,sloped] {dobj}(33);
\draw[-,black,thick](32) -- node[label,near end,above,sloped] {nmod:through}(35);
\draw[-,black,thick](35) -- node[label,near end,above,sloped] {case}(34);
\draw[-,black,thick](35) -- node[label,near end,above,sloped] {cc}(36);
\draw[-,black,thick](35) -- node[label,near end,above,sloped] {conj:and}(39);
\draw[-,black,thick](39) -- node[label,near end,above,sloped] {amod}(37);
\draw[-,black,thick](39) -- node[label,near end,above,sloped] {compound}(38);
%BACK RELATION EDGES WITH LABELS
\draw[->, red, rounded corners = 0.5cm]
    (20token.south) -- ++(0, -1cm)
    -- node[label, near start, below, sloped] {nsubj}
    ($(3token.310) + (0, -1cm)$) -- (3token.310);
\draw[->, red, rounded corners = 0.5cm]
    (18token.south) -- ++(0, -2cm)
    -- node[label, near start, below, sloped] {nsubj}
    ($(3token.230) + (0, -2cm)$) -- (3token.230);
%HELP EDGES
\draw[-,dotted,black!80,thick] (3token) -- (3);
\draw[-,dotted,black!80,thick] (8token) -- (8);
\draw[-,dotted,black!80,thick] (10token) -- (10);
\draw[-,dotted,black!80,thick] (14token) -- (14);
\draw[-,dotted,black!80,thick] (16token) -- (16);
\draw[-,dotted,black!80,thick] (18token) -- (18);
\draw[-,dotted,black!80,thick] (20token) -- (20);
\draw[-,dotted,black!80,thick] (23token) -- (23);
\draw[-,dotted,black!80,thick] (27token) -- (27);
\draw[-,dotted,black!80,thick] (29token) -- (29);
\draw[-,dotted,black!80,thick] (32token) -- (32);
\draw[-,dotted,black!80,thick] (35token) -- (35);
\draw[-,dotted,black!80,thick] (39token) -- (39);
\end{tikzpicture}
\end{document}

There's still a severe lack of indentation, but I guess it's not meant to be read by human beings since you generate that automatically.

3
  • It's generally better to include the complete code for your example, even if you also highlight specific parts of it in your explanation. (E.g. just put 'Complete code' and the code at the end of the post or something.) If you don't have arrows.meta, you have a very old version of PGF/TikZ and should consider updating your TeX distribution.
    – cfr
    Aug 3, 2017 at 12:10
  • @cfr I'm using the version in Ubuntu's repositories, so yeah I guess it's getting a bit old. But that's seldom a problem for what I do. As for the answer, I'll add the code, but it feels weird since I only modified two lines (three if you count the inclusion of calc). Furthermore, if this is automatically generated code, the topic creator will have no real use for the complete corrected code and will just use it as inspiration to change his program.
    – Alice M.
    Aug 3, 2017 at 12:13
  • @AliceM. thank you a thousand times, your answer is exactly solving my problem. I implemented this piece of code into my python automation and it looks even better than before. So the only question i still have, is can i automate the two anchors with 3token.220 and respectively 3token.260 or is this a pixel anchor because in my automated code i don't know how the token text will look like it could also be just a commata? thank you so far!
    – Marcolen
    Aug 4, 2017 at 10:51

You must log in to answer this question.

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