3

When I render this with LuaLaTex:

\documentclass[border=4mm]{standalone}

\usepackage{tikz}
\usetikzlibrary{graphdrawing,graphs} 
\usegdlibrary{layered,trees,circular,force}

\begin{document}

\tikz \graph [spring layout,
edge quotes mid,
edges={nodes={font=\scriptsize, fill=white, sloped, inner sep=1pt}}]
 {
1 ->["Das"] 2 ->["ist"] 3 ->["das"] 4 ->["Haus"]
 2 ->["vom" near start] 5 ->["Ni"] 4 ->["ko" near start]
 1 ->["laus", orient=right] 5;
 };

\end{document}

I get this error:

Line 8: Package pgfkeys Error: I do not know the key '/tikz/"{Das}"' and I am going to ignore it. Perhaps you misspelled it.

Why?

1 Answer 1

4

You need to add the tikzlibrary called quotes to use that syntax.

\documentclass[border=2mm]{standalone}

\usepackage{tikz}
\usetikzlibrary{graphdrawing,graphs,quotes} % <-- new library added
\usegdlibrary{layered,trees,circular,force}

\begin{document}

\tikz \graph [spring layout,
edge quotes mid,
edges={nodes={font=\scriptsize, fill=white, sloped, inner sep=1pt}}]
 {
1 ->["Das"] 2 ->["ist"] 3 ->["das"] 4 ->["Haus"]
 2 ->["vom" near start] 5 ->["Ni"] 4 ->["ko" near start]
 1 ->["laus", orient=right] 5;
 };

\end{document}

enter image description here

You must log in to answer this question.

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