pgf-tikz / pgf

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

Fix missing inclusion of libraries in graphdrawing examples #1335

Open hansonchar opened 1 month ago

hansonchar commented 1 month ago

Motivation for this change

Some of the examples at https://tikz.dev/gd-trees and https://tikz.dev/gd-usage-tikz don't currently compile with lualatex.

Checklist

Testing

Changes tested successfully on Apple M2.

$ lualatex --version
This is LuaHBTeX, Version 1.18.0 (TeX Live 2024)
Development id: 7611

Prior to this change, the example code would fail with the following log message:

...
! Package pgf Error: Unknown arrow tip kind 'Stealth'.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.78 \tikz [>={Stealth[round,sep]}]

Local building of build/doc/pgfmanual.pdf

export tagname=$(git describe --abbrev=0 --tags)
export revision=$(git describe --tags)
export tagdate=$(git log -n 1 "$tagname" --pretty=format:%cs)
export revisiondate=$(git log -n 1 "$revision" --pretty=format:%cs)
l3build tag --date "$tagdate" "$tagname"
l3build doc -q
Mo-Gul commented 3 weeks ago

Sorry @muzimuzhi, took a bit longer, but now I have shed some light again into this issue.

@hansonchar is right that there are missing occurrences of needed libraries. All of that started in issue #640. But at some point a question arose which (unfortunately) never was answered. So the work didn't continue.

When I remember correctly, the most important point why the work didn't continue was, that the extract.lua isn't able to also extract the "example"/"examples" in the Lua documentation (like the ones modified in the PR). This would help a lot, because it would enable (semi-)automatic testing. Unfortunately I don't have any clue about Lua programming :(

There are much more examples lacking libraries. See e.g. PR #883 which isn't merged yet (reason unknown anymore). And there is also https://github.com/Mo-Gul/pgf/commit/af40f010b33ecf01e95c1a228149e1ad179f8902 which could be cherry-picked. And it is very likely that there will be missing even more. If only extract.lua would handle these examples, too ... ;)

Please also note that the "extractor scripts" (Bash version and PowerShell version) need to be adapted to work after the "flattening of the file structure" ...

hansonchar commented 3 weeks ago

This PR is tangentially related to https://github.com/pgf-tikz/pgf/pull/1339

I think we can make small, incremental changes iteratively, instead of blocking these changes (that absolutely improve the pgfmanual) on the basis of the lack of a perfect solution.

What do you think?

In any case, I'll try to take a look at the extractor script problems later on. One step/issue at a time.

hansonchar commented 1 week ago

As an interesting trivia, I think I've found where the name Kellermann originated from. Till Tantau's implementation of the Tree Layouts follows the paper "A. Brüggemann-Klein, D. Wood, Drawing trees nicely with TEX, Electronic Publishing, 2(2), 101–115, 1989.", and "Kellermann" with double n's are given in Figure 10-12 in that paper, where "Kellermann" has a total occurrence of five times.