Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap node name in \tikz@pp@name when passed to pgf gd #1119

Merged
merged 10 commits into from
Jan 11, 2022

Conversation

muzimuzhi
Copy link
Member

Motivation for this change

This PR consists of several parts, all gd related:

To me, checking internal states and more human-readable generated log lines (here .tlg) is preferable to seeing lengthy box content, so I introduce the pgfgd-debug.lua which adds debugging code to Lua functions in InterfaceToDisplay.

Todo or possible improvements:

  • Fully expand \tikz@pp@name{<node name>} before being passed to macros. Again a call for pgf's \exp_args:Nx and \exp_args:Nxx.
  • In pgfgd-regression-test.tex, how to input pgf-regression-test.tex which resides in support sub-directory of another test set?
  • Allow test files selectively turning on/off wrappers in pgfgd-debug.lua. Can be achieved with some higher-order functions written in Lua, is it?

Fixes #1087

Checklist

Please signoff your commits to explicitly state your agreement to the Developer Certificate of Origin. If that is not possible you may check the boxes below instead:

when tikz calls `\pgfgdedge`.

Signed-off-by: muzimuzhi <[email protected]>
The gd test set only runs on LuaTeX.

`pgfgd-debug.lua` adds debugging code to `InterfaceToDisplay` functions
which helps in checking tests based on states of display layer (Lua),
rather than box content.

Signed-off-by: muzimuzhi <[email protected]>
@muzimuzhi
Copy link
Member Author

  • Allow test files selectively turning on/off wrappers in pgfgd-debug.lua. Can be achieved with some higher-order functions written in Lua, is it?

\luafunction fits here. I got to know it from latex3/latex2e#536.

@hmenke
Copy link
Member

hmenke commented Jan 11, 2022

Sorry, now I broke the tests. I'll look in the evening at home why that happens.

\catcode`\@=11 % \makeatletter

% this macro should be used _after_ graphdrawing library is loaded
\def\pgfgdBeforeBeginDocument{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the test fails with

pgfgd-debug.lua:1: attempt to index a nil value (global 'pgf')

because when pgfgd-debug.lua is read in, the whole pgf is not loaded yet. This explains why the \pgfgdBeforeBeginDocument was introduced (and used after package loading and just before \begin{document}). For latex format only, \AtBeginDocument suffices but I more or less want(ed) a portable solution (not a strong opinion).

- Load `pgfgd-test.lua` after gd lib.
- Update test file (no prefix, no ending period).

Signed-off-by: muzimuzhi <[email protected]>
@hmenke hmenke merged commit 307703b into pgf-tikz:master Jan 11, 2022
@muzimuzhi
Copy link
Member Author

Now "Test suite" is successful. "Check commits" still fails because of b65622a I made on webpage to resolve merge conflicts.

A reminder: Now *.diff files, if exist, from both test sets are uploaded in a flattened structure. It would be more helpful if the corresponding .log files are uploaded too.

Oh this is already merged, so any "refactoring welcome" words is less useable.

@muzimuzhi muzimuzhi deleted the gd-name-prefix branch January 12, 2022 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Graph drawing doesn't work with name prefix
2 participants