pgf-tikz / pgf

A Portable Graphic Format for TeX
https://pgf-tikz.github.io/
1.15k stars 109 forks source link

Fix broken example of simpledemo.lua to work with "simple demo layout" #1342

Open hansonchar opened 5 months ago

hansonchar commented 5 months ago

Motivation for this change

I tried out the example at 36.2.1 The Hello World of Graph Drawing but it didn't compile:

\documentclass{standalone}
\usepackage{fp,pgf,tikz,xcolor}
\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{simpledemo}
\begin{document}
\tikz [very simple demo layout]
  \graph { f -> c -> e -> a -> {b -> {c, d, f}, e -> b}};
\end{document}

It seems to me the culprit is the implementation in SimpleDemo.lua#L25-L39 differs from that in the documentation.

Checklist

hansonchar commented 5 months ago

The generated manual in pdf can be downloaded at here. I've also tested the changes locally and the example above now works.

I've subsequently forced push a better fix. Waiting for Github workflow to complete.