4

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?

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

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.