7

How do I use TikZ graphdrawing package with KTikZ+LuaLaTeX?

Putting the following code:

\usetikzlibrary{graphs} 

 \tikz [rounded corners]
\graph [layered layout, sibling distance=8mm, level distance=8mm]
{
 a -> {
b,
 c -> { d, e }
} ->
f ->
a
};

gives this error:

[LaTeX] Line 5: Package pgfkeys Error: I do not know the key '/tikz/graphs/layered layout' and I am going to ignore it. Perhaps you misspelled it.

6

You also need the graphdrawing library, and \usegdlibrary{layered}.

Make a new template; call it, say, "lualatex-graphdrawing-template.pgs":

\documentclass[border=1mm]{standalone}

\usepackage{tikz}
\usetikzlibrary{graphdrawing,graphs} 
\usegdlibrary{layered}


\begin{document}
<>
\end{document}

Then, in KTikZ, putting, with the above template selected, this code:

 \tikz [rounded corners]
\graph [layered layout, sibling distance=8mm, level distance=8mm]
{
 a -> {
b,
 c -> { d, e }
} ->
f ->
a
};

will render:

enter image description here

Also, remember that you need to set KTikZ to use lualatex for rendering, not pdflatex.

  • I think for KTikZ you need to fiddle with the options to change the compile engine. – percusse May 22 '14 at 21:25
  • @percusse Nope, Settings --> Configure KTikZ. – Torbjørn T. May 22 '14 at 21:45
  • OK replace options with settings :) – percusse May 22 '14 at 21:53

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.