How do I debug pgfkeys?How to list all known pgfkeys?LaTeX3 versus pure LuaHow to best debug...
Examples of smooth manifolds admitting inbetween one and a continuum of complex structures
Can a virus destroy the BIOS of a modern computer?
How would I stat a creature to be immune to everything but the Magic Missile spell? (just for fun)
CAST throwing error when run in stored procedure but not when run as raw query
How to tell a function to use the default argument values?
How dangerous is XSS?
Assassin's bullet with mercury
Intersection Puzzle
What exploit Are these user agents trying to use?
How did the Super Star Destroyer Executor get destroyed exactly?
Determining Impedance With An Antenna Analyzer
How much of data wrangling is a data scientist's job?
Detention in 1997
How can saying a song's name be a copyright violation?
Why didn't Miles's spider sense work before?
What does the expression "A Mann!" means
Plagiarism or not?
How does a predictive coding aid in lossless compression?
Is it inappropriate for a student to attend their mentor's dissertation defense?
What's the in-universe reasoning behind sorcerers needing material components?
Little known, relatively unlikely, but scientifically plausible, apocalyptic (or near apocalyptic) events
How seriously should I take size and weight limits of hand luggage?
iPad being using in wall mount battery swollen
A category-like structure without composition?
How do I debug pgfkeys?
How to list all known pgfkeys?LaTeX3 versus pure LuaHow to best debug LaTeX?“Z-level” in TikZHow can I force TikZ pin angle?Checkers board in TikZ.How to change the level distance in tikz-qtree for one level only?How to know the status of a style? defined? empty?Accessing a style property in TikZ?How to best debug LaTeX?hyperref incorrect links: how to debug?pgfkeys - .is family handlerBack-linking of pgfkeyspgfkeys pass font commandRead other pgfkeys' valueHow to obtain enough debug information?Inheriting pgfkeysReset pgfkeys / Delete pgfkeysOrder dependent pgfkeys
I'm sure if you're reading this question you are already familiar with my love for pgfkeys
. However, it is absolutely impossible to debug: tracingmacros
is a total mess, with every key expanding to dozens of complex internal macros. I would like to be able to debug it the same way I can debug a program built by hand using def
: watch the keys absorb their arguments, expand their values or execute their code, and proceed to the next key. I don't care how pgfk@try
or whatever is defined, only that it looks for a key and does or doesn't find it, acting accordingly.
Currently, I debug by intimidation: tracingmacros=1
and lots of scrolling plus a bit of pattern recognition for the repetitive macro noise. It's too much to hope that there is some way of coercing pgfkeys
into producing nicer output; it would require the author to have hand-coded a selectively populated call stack. I'm wondering, though, if anyone else familiar with this package could tell me how they figure out what's going on with their keys.
Related: How to best debug LaTeX? (by Yossi Farjoun; not coincidentally, this question is also really his, from a recent chat conversation.)
macros debugging pgfkeys
add a comment |
I'm sure if you're reading this question you are already familiar with my love for pgfkeys
. However, it is absolutely impossible to debug: tracingmacros
is a total mess, with every key expanding to dozens of complex internal macros. I would like to be able to debug it the same way I can debug a program built by hand using def
: watch the keys absorb their arguments, expand their values or execute their code, and proceed to the next key. I don't care how pgfk@try
or whatever is defined, only that it looks for a key and does or doesn't find it, acting accordingly.
Currently, I debug by intimidation: tracingmacros=1
and lots of scrolling plus a bit of pattern recognition for the repetitive macro noise. It's too much to hope that there is some way of coercing pgfkeys
into producing nicer output; it would require the author to have hand-coded a selectively populated call stack. I'm wondering, though, if anyone else familiar with this package could tell me how they figure out what's going on with their keys.
Related: How to best debug LaTeX? (by Yossi Farjoun; not coincidentally, this question is also really his, from a recent chat conversation.)
macros debugging pgfkeys
Do you mean something a bit more advanced than the.show value
and so forth? You want to "watch it in action"?
– Loop Space
Nov 13 '11 at 19:02
@Andrew: Yes, exactly. Like if I defineddefa#1{b#1} defb#1{c#1} defc#1{d#1}
and calleda{x}
;tracingmacros=1
would show each macro's replacement text and its argument, one after the other. I want that for "logical" keys, not literal key-handling macros.
– Ryan Reich
Nov 13 '11 at 19:10
2
Given the deafening silence on this one, and the number of votes, I think you have an opportunity here to provide a very useful tool: a pgfkeys debugging extension. I think that will a few little extra bits of code here and there, you could successfully trace all the important action and not get overwhelmed by the unnecessary stuff.
– Loop Space
Nov 26 '11 at 19:31
@Andrew: I was thinking the same thing. I believe this can be achieved by defining some tracing keys withpgfkeys
itself, actually, that would get called in the same manner as handlers. I will think more about this in December once the quarter ends.
– Ryan Reich
Nov 26 '11 at 23:51
You may take a look into the key filtering suite which ships with pgfkeys.Its purpose it to present EACH key to some "filter" to decide if the key is to be processed. I suppose that you can easily write some sort of "inspection" key. It has advanced support to handle all available key types.
– Christian Feuersänger
Feb 9 '12 at 17:29
add a comment |
I'm sure if you're reading this question you are already familiar with my love for pgfkeys
. However, it is absolutely impossible to debug: tracingmacros
is a total mess, with every key expanding to dozens of complex internal macros. I would like to be able to debug it the same way I can debug a program built by hand using def
: watch the keys absorb their arguments, expand their values or execute their code, and proceed to the next key. I don't care how pgfk@try
or whatever is defined, only that it looks for a key and does or doesn't find it, acting accordingly.
Currently, I debug by intimidation: tracingmacros=1
and lots of scrolling plus a bit of pattern recognition for the repetitive macro noise. It's too much to hope that there is some way of coercing pgfkeys
into producing nicer output; it would require the author to have hand-coded a selectively populated call stack. I'm wondering, though, if anyone else familiar with this package could tell me how they figure out what's going on with their keys.
Related: How to best debug LaTeX? (by Yossi Farjoun; not coincidentally, this question is also really his, from a recent chat conversation.)
macros debugging pgfkeys
I'm sure if you're reading this question you are already familiar with my love for pgfkeys
. However, it is absolutely impossible to debug: tracingmacros
is a total mess, with every key expanding to dozens of complex internal macros. I would like to be able to debug it the same way I can debug a program built by hand using def
: watch the keys absorb their arguments, expand their values or execute their code, and proceed to the next key. I don't care how pgfk@try
or whatever is defined, only that it looks for a key and does or doesn't find it, acting accordingly.
Currently, I debug by intimidation: tracingmacros=1
and lots of scrolling plus a bit of pattern recognition for the repetitive macro noise. It's too much to hope that there is some way of coercing pgfkeys
into producing nicer output; it would require the author to have hand-coded a selectively populated call stack. I'm wondering, though, if anyone else familiar with this package could tell me how they figure out what's going on with their keys.
Related: How to best debug LaTeX? (by Yossi Farjoun; not coincidentally, this question is also really his, from a recent chat conversation.)
macros debugging pgfkeys
macros debugging pgfkeys
edited Apr 13 '17 at 12:35
Community♦
1
1
asked Nov 13 '11 at 18:42
Ryan ReichRyan Reich
31.5k7100160
31.5k7100160
Do you mean something a bit more advanced than the.show value
and so forth? You want to "watch it in action"?
– Loop Space
Nov 13 '11 at 19:02
@Andrew: Yes, exactly. Like if I defineddefa#1{b#1} defb#1{c#1} defc#1{d#1}
and calleda{x}
;tracingmacros=1
would show each macro's replacement text and its argument, one after the other. I want that for "logical" keys, not literal key-handling macros.
– Ryan Reich
Nov 13 '11 at 19:10
2
Given the deafening silence on this one, and the number of votes, I think you have an opportunity here to provide a very useful tool: a pgfkeys debugging extension. I think that will a few little extra bits of code here and there, you could successfully trace all the important action and not get overwhelmed by the unnecessary stuff.
– Loop Space
Nov 26 '11 at 19:31
@Andrew: I was thinking the same thing. I believe this can be achieved by defining some tracing keys withpgfkeys
itself, actually, that would get called in the same manner as handlers. I will think more about this in December once the quarter ends.
– Ryan Reich
Nov 26 '11 at 23:51
You may take a look into the key filtering suite which ships with pgfkeys.Its purpose it to present EACH key to some "filter" to decide if the key is to be processed. I suppose that you can easily write some sort of "inspection" key. It has advanced support to handle all available key types.
– Christian Feuersänger
Feb 9 '12 at 17:29
add a comment |
Do you mean something a bit more advanced than the.show value
and so forth? You want to "watch it in action"?
– Loop Space
Nov 13 '11 at 19:02
@Andrew: Yes, exactly. Like if I defineddefa#1{b#1} defb#1{c#1} defc#1{d#1}
and calleda{x}
;tracingmacros=1
would show each macro's replacement text and its argument, one after the other. I want that for "logical" keys, not literal key-handling macros.
– Ryan Reich
Nov 13 '11 at 19:10
2
Given the deafening silence on this one, and the number of votes, I think you have an opportunity here to provide a very useful tool: a pgfkeys debugging extension. I think that will a few little extra bits of code here and there, you could successfully trace all the important action and not get overwhelmed by the unnecessary stuff.
– Loop Space
Nov 26 '11 at 19:31
@Andrew: I was thinking the same thing. I believe this can be achieved by defining some tracing keys withpgfkeys
itself, actually, that would get called in the same manner as handlers. I will think more about this in December once the quarter ends.
– Ryan Reich
Nov 26 '11 at 23:51
You may take a look into the key filtering suite which ships with pgfkeys.Its purpose it to present EACH key to some "filter" to decide if the key is to be processed. I suppose that you can easily write some sort of "inspection" key. It has advanced support to handle all available key types.
– Christian Feuersänger
Feb 9 '12 at 17:29
Do you mean something a bit more advanced than the
.show value
and so forth? You want to "watch it in action"?– Loop Space
Nov 13 '11 at 19:02
Do you mean something a bit more advanced than the
.show value
and so forth? You want to "watch it in action"?– Loop Space
Nov 13 '11 at 19:02
@Andrew: Yes, exactly. Like if I defined
defa#1{b#1} defb#1{c#1} defc#1{d#1}
and called a{x}
; tracingmacros=1
would show each macro's replacement text and its argument, one after the other. I want that for "logical" keys, not literal key-handling macros.– Ryan Reich
Nov 13 '11 at 19:10
@Andrew: Yes, exactly. Like if I defined
defa#1{b#1} defb#1{c#1} defc#1{d#1}
and called a{x}
; tracingmacros=1
would show each macro's replacement text and its argument, one after the other. I want that for "logical" keys, not literal key-handling macros.– Ryan Reich
Nov 13 '11 at 19:10
2
2
Given the deafening silence on this one, and the number of votes, I think you have an opportunity here to provide a very useful tool: a pgfkeys debugging extension. I think that will a few little extra bits of code here and there, you could successfully trace all the important action and not get overwhelmed by the unnecessary stuff.
– Loop Space
Nov 26 '11 at 19:31
Given the deafening silence on this one, and the number of votes, I think you have an opportunity here to provide a very useful tool: a pgfkeys debugging extension. I think that will a few little extra bits of code here and there, you could successfully trace all the important action and not get overwhelmed by the unnecessary stuff.
– Loop Space
Nov 26 '11 at 19:31
@Andrew: I was thinking the same thing. I believe this can be achieved by defining some tracing keys with
pgfkeys
itself, actually, that would get called in the same manner as handlers. I will think more about this in December once the quarter ends.– Ryan Reich
Nov 26 '11 at 23:51
@Andrew: I was thinking the same thing. I believe this can be achieved by defining some tracing keys with
pgfkeys
itself, actually, that would get called in the same manner as handlers. I will think more about this in December once the quarter ends.– Ryan Reich
Nov 26 '11 at 23:51
You may take a look into the key filtering suite which ships with pgfkeys.Its purpose it to present EACH key to some "filter" to decide if the key is to be processed. I suppose that you can easily write some sort of "inspection" key. It has advanced support to handle all available key types.
– Christian Feuersänger
Feb 9 '12 at 17:29
You may take a look into the key filtering suite which ships with pgfkeys.Its purpose it to present EACH key to some "filter" to decide if the key is to be processed. I suppose that you can easily write some sort of "inspection" key. It has advanced support to handle all available key types.
– Christian Feuersänger
Feb 9 '12 at 17:29
add a comment |
2 Answers
2
active
oldest
votes
I have written a draft of a package that traces pgfkeys
. I have tested it as much as I can stand, and it seems both to work and to be useful, but I am reluctant to publish it on CTAN before giving it a beta run. Therefore I am making it available only on my own website (no longer available) for now. It consists (for now) just of a .sty
file with a comment block at the top describing how it works.
I would really appreciate any comments you might have, so I'm going to open up a second answer (CW) for feature requests and bug reports. Perhaps it's selfish, but I want reputation from this answer.
1
In the latest issue of TUGboat (volume 32, number 3) there is an article on '(La)TeX coding standards' and the apparent lack of cooperation among developers. I too, by omission, have been guilty of this. The 'etoolbox' and 'ltxkeys' packages have internal tracing and debugging features. Might it not be better asking the pgf team to consider integrating your code into theirs and acknowledging you? Aside: why does 'add comment' drop my @Ryan Reich?
– Ahmed Musa
Feb 9 '12 at 14:49
Note: Actually, only thepatchcmd
command of etoolbox package has the internal tracing utility.
– Ahmed Musa
Feb 9 '12 at 15:14
@Ahmed The tracing mode ofpatchcmd
was actually very useful for me, as it revealed a catcode change I needed to make in order to use it in my setup code. I have tried to imitate its style, in fact.
– Ryan Reich
Feb 9 '12 at 18:15
@Ahmed: I have also considered asking the PGF people to support this package. If not by actually merging it, at least by putting in dummy tokens everywhere in their code so it is easier and less fragile to patch in my tracing text.
– Ryan Reich
Feb 9 '12 at 22:33
1
@AhmedMusa Re your aside: If only one user (besides you), i.e. the author of the post, has so far been involved in the comments to the post, it is clear that he or she is the one addressed. And since the post owner is also always notified of comments to their post, the SE system doesn’t deem such an@
-notification necessary and removes it.
– doncherry
May 2 '13 at 0:40
add a comment |
I will reply to items below in the chatroom trace-pgfkeys.
Feature requests
(added by Andrew Stacey) I'd like to sometimes see the values that are being passed around. As a first case, when a key uses
/.store in
I'd like to know what was being stored in what.(Andrew Stacey again) I'd like to be able to follow particular keys, or families of keys. Looking at the output from this package, there's an awful lot going on! Often, I'm just interested in tracing how one piece works.
Bugs
- Processing an unknown key with a defined unknown handler (in the unknown key's path) in the verbose mode yields an error.
Here's a M(N)WE:
documentclass{article}
usepackage{pgfkeys}
usepackage[silent]{trace-pgfkeys}
begin{document}
pgfkeys{/bla/.unknown/.code=blabla}
pgfkeystracelevel{verbose}
pgfkeys{/bla/nonexisting}
end{document}
I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown
, message expandafterunexpandedexpandafter{meaningpgfkeys@code}%
introduces an expandafter
, which becomes the first expandafter
of pgfkeys@unknown
. Further patches of pgfkeys@unknown
are therefore done in this place. The solution is to replace the offending message by expandonce{meaningpgfkeys@code}%
. The full code of the patch command is as follows:
trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknown{expandafter}{%
Unknown handler code:\%
expandonce{meaningpgfkeys@code}%
}
Hmm, this could get messy (in terms of replying to stuff)! I admit it was only my first spin with your code and I didn't try all of the gears. ... Idea: have a dedicated chat room for this package. It works well for the Tex-SX stuff (youcould use that one if you like).
– Loop Space
Feb 9 '12 at 21:54
Excellent idea! I have created one.
– Ryan Reich
Feb 9 '12 at 21:59
As the chat room is not active anymore, I have added the bug report into the answer. I also support the feature request(s) by @AndrewStacey. (The first one about values is actually easy to achieve. I can add the code if anyone's interested.)
– Sašo Živanović
Apr 27 '16 at 16:14
I hope @RyanReich reads this as I believe it's time to put this fantastic package to ctan!
– Sašo Živanović
Apr 27 '16 at 16:16
@SašoŽivanović Thank you. I considered doing this a long time ago but the package is quite version-specific topgfkeys
, and therefore increasingly dated. In addition, these days I don't do any TeX at all. Are you interested in maintaining it?
– Ryan Reich
Apr 27 '16 at 17:22
|
show 4 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f34712%2fhow-do-i-debug-pgfkeys%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have written a draft of a package that traces pgfkeys
. I have tested it as much as I can stand, and it seems both to work and to be useful, but I am reluctant to publish it on CTAN before giving it a beta run. Therefore I am making it available only on my own website (no longer available) for now. It consists (for now) just of a .sty
file with a comment block at the top describing how it works.
I would really appreciate any comments you might have, so I'm going to open up a second answer (CW) for feature requests and bug reports. Perhaps it's selfish, but I want reputation from this answer.
1
In the latest issue of TUGboat (volume 32, number 3) there is an article on '(La)TeX coding standards' and the apparent lack of cooperation among developers. I too, by omission, have been guilty of this. The 'etoolbox' and 'ltxkeys' packages have internal tracing and debugging features. Might it not be better asking the pgf team to consider integrating your code into theirs and acknowledging you? Aside: why does 'add comment' drop my @Ryan Reich?
– Ahmed Musa
Feb 9 '12 at 14:49
Note: Actually, only thepatchcmd
command of etoolbox package has the internal tracing utility.
– Ahmed Musa
Feb 9 '12 at 15:14
@Ahmed The tracing mode ofpatchcmd
was actually very useful for me, as it revealed a catcode change I needed to make in order to use it in my setup code. I have tried to imitate its style, in fact.
– Ryan Reich
Feb 9 '12 at 18:15
@Ahmed: I have also considered asking the PGF people to support this package. If not by actually merging it, at least by putting in dummy tokens everywhere in their code so it is easier and less fragile to patch in my tracing text.
– Ryan Reich
Feb 9 '12 at 22:33
1
@AhmedMusa Re your aside: If only one user (besides you), i.e. the author of the post, has so far been involved in the comments to the post, it is clear that he or she is the one addressed. And since the post owner is also always notified of comments to their post, the SE system doesn’t deem such an@
-notification necessary and removes it.
– doncherry
May 2 '13 at 0:40
add a comment |
I have written a draft of a package that traces pgfkeys
. I have tested it as much as I can stand, and it seems both to work and to be useful, but I am reluctant to publish it on CTAN before giving it a beta run. Therefore I am making it available only on my own website (no longer available) for now. It consists (for now) just of a .sty
file with a comment block at the top describing how it works.
I would really appreciate any comments you might have, so I'm going to open up a second answer (CW) for feature requests and bug reports. Perhaps it's selfish, but I want reputation from this answer.
1
In the latest issue of TUGboat (volume 32, number 3) there is an article on '(La)TeX coding standards' and the apparent lack of cooperation among developers. I too, by omission, have been guilty of this. The 'etoolbox' and 'ltxkeys' packages have internal tracing and debugging features. Might it not be better asking the pgf team to consider integrating your code into theirs and acknowledging you? Aside: why does 'add comment' drop my @Ryan Reich?
– Ahmed Musa
Feb 9 '12 at 14:49
Note: Actually, only thepatchcmd
command of etoolbox package has the internal tracing utility.
– Ahmed Musa
Feb 9 '12 at 15:14
@Ahmed The tracing mode ofpatchcmd
was actually very useful for me, as it revealed a catcode change I needed to make in order to use it in my setup code. I have tried to imitate its style, in fact.
– Ryan Reich
Feb 9 '12 at 18:15
@Ahmed: I have also considered asking the PGF people to support this package. If not by actually merging it, at least by putting in dummy tokens everywhere in their code so it is easier and less fragile to patch in my tracing text.
– Ryan Reich
Feb 9 '12 at 22:33
1
@AhmedMusa Re your aside: If only one user (besides you), i.e. the author of the post, has so far been involved in the comments to the post, it is clear that he or she is the one addressed. And since the post owner is also always notified of comments to their post, the SE system doesn’t deem such an@
-notification necessary and removes it.
– doncherry
May 2 '13 at 0:40
add a comment |
I have written a draft of a package that traces pgfkeys
. I have tested it as much as I can stand, and it seems both to work and to be useful, but I am reluctant to publish it on CTAN before giving it a beta run. Therefore I am making it available only on my own website (no longer available) for now. It consists (for now) just of a .sty
file with a comment block at the top describing how it works.
I would really appreciate any comments you might have, so I'm going to open up a second answer (CW) for feature requests and bug reports. Perhaps it's selfish, but I want reputation from this answer.
I have written a draft of a package that traces pgfkeys
. I have tested it as much as I can stand, and it seems both to work and to be useful, but I am reluctant to publish it on CTAN before giving it a beta run. Therefore I am making it available only on my own website (no longer available) for now. It consists (for now) just of a .sty
file with a comment block at the top describing how it works.
I would really appreciate any comments you might have, so I'm going to open up a second answer (CW) for feature requests and bug reports. Perhaps it's selfish, but I want reputation from this answer.
edited 8 mins ago
Henri Menke
77.2k8170284
77.2k8170284
answered Feb 7 '12 at 6:42
Ryan ReichRyan Reich
31.5k7100160
31.5k7100160
1
In the latest issue of TUGboat (volume 32, number 3) there is an article on '(La)TeX coding standards' and the apparent lack of cooperation among developers. I too, by omission, have been guilty of this. The 'etoolbox' and 'ltxkeys' packages have internal tracing and debugging features. Might it not be better asking the pgf team to consider integrating your code into theirs and acknowledging you? Aside: why does 'add comment' drop my @Ryan Reich?
– Ahmed Musa
Feb 9 '12 at 14:49
Note: Actually, only thepatchcmd
command of etoolbox package has the internal tracing utility.
– Ahmed Musa
Feb 9 '12 at 15:14
@Ahmed The tracing mode ofpatchcmd
was actually very useful for me, as it revealed a catcode change I needed to make in order to use it in my setup code. I have tried to imitate its style, in fact.
– Ryan Reich
Feb 9 '12 at 18:15
@Ahmed: I have also considered asking the PGF people to support this package. If not by actually merging it, at least by putting in dummy tokens everywhere in their code so it is easier and less fragile to patch in my tracing text.
– Ryan Reich
Feb 9 '12 at 22:33
1
@AhmedMusa Re your aside: If only one user (besides you), i.e. the author of the post, has so far been involved in the comments to the post, it is clear that he or she is the one addressed. And since the post owner is also always notified of comments to their post, the SE system doesn’t deem such an@
-notification necessary and removes it.
– doncherry
May 2 '13 at 0:40
add a comment |
1
In the latest issue of TUGboat (volume 32, number 3) there is an article on '(La)TeX coding standards' and the apparent lack of cooperation among developers. I too, by omission, have been guilty of this. The 'etoolbox' and 'ltxkeys' packages have internal tracing and debugging features. Might it not be better asking the pgf team to consider integrating your code into theirs and acknowledging you? Aside: why does 'add comment' drop my @Ryan Reich?
– Ahmed Musa
Feb 9 '12 at 14:49
Note: Actually, only thepatchcmd
command of etoolbox package has the internal tracing utility.
– Ahmed Musa
Feb 9 '12 at 15:14
@Ahmed The tracing mode ofpatchcmd
was actually very useful for me, as it revealed a catcode change I needed to make in order to use it in my setup code. I have tried to imitate its style, in fact.
– Ryan Reich
Feb 9 '12 at 18:15
@Ahmed: I have also considered asking the PGF people to support this package. If not by actually merging it, at least by putting in dummy tokens everywhere in their code so it is easier and less fragile to patch in my tracing text.
– Ryan Reich
Feb 9 '12 at 22:33
1
@AhmedMusa Re your aside: If only one user (besides you), i.e. the author of the post, has so far been involved in the comments to the post, it is clear that he or she is the one addressed. And since the post owner is also always notified of comments to their post, the SE system doesn’t deem such an@
-notification necessary and removes it.
– doncherry
May 2 '13 at 0:40
1
1
In the latest issue of TUGboat (volume 32, number 3) there is an article on '(La)TeX coding standards' and the apparent lack of cooperation among developers. I too, by omission, have been guilty of this. The 'etoolbox' and 'ltxkeys' packages have internal tracing and debugging features. Might it not be better asking the pgf team to consider integrating your code into theirs and acknowledging you? Aside: why does 'add comment' drop my @Ryan Reich?
– Ahmed Musa
Feb 9 '12 at 14:49
In the latest issue of TUGboat (volume 32, number 3) there is an article on '(La)TeX coding standards' and the apparent lack of cooperation among developers. I too, by omission, have been guilty of this. The 'etoolbox' and 'ltxkeys' packages have internal tracing and debugging features. Might it not be better asking the pgf team to consider integrating your code into theirs and acknowledging you? Aside: why does 'add comment' drop my @Ryan Reich?
– Ahmed Musa
Feb 9 '12 at 14:49
Note: Actually, only the
patchcmd
command of etoolbox package has the internal tracing utility.– Ahmed Musa
Feb 9 '12 at 15:14
Note: Actually, only the
patchcmd
command of etoolbox package has the internal tracing utility.– Ahmed Musa
Feb 9 '12 at 15:14
@Ahmed The tracing mode of
patchcmd
was actually very useful for me, as it revealed a catcode change I needed to make in order to use it in my setup code. I have tried to imitate its style, in fact.– Ryan Reich
Feb 9 '12 at 18:15
@Ahmed The tracing mode of
patchcmd
was actually very useful for me, as it revealed a catcode change I needed to make in order to use it in my setup code. I have tried to imitate its style, in fact.– Ryan Reich
Feb 9 '12 at 18:15
@Ahmed: I have also considered asking the PGF people to support this package. If not by actually merging it, at least by putting in dummy tokens everywhere in their code so it is easier and less fragile to patch in my tracing text.
– Ryan Reich
Feb 9 '12 at 22:33
@Ahmed: I have also considered asking the PGF people to support this package. If not by actually merging it, at least by putting in dummy tokens everywhere in their code so it is easier and less fragile to patch in my tracing text.
– Ryan Reich
Feb 9 '12 at 22:33
1
1
@AhmedMusa Re your aside: If only one user (besides you), i.e. the author of the post, has so far been involved in the comments to the post, it is clear that he or she is the one addressed. And since the post owner is also always notified of comments to their post, the SE system doesn’t deem such an
@
-notification necessary and removes it.– doncherry
May 2 '13 at 0:40
@AhmedMusa Re your aside: If only one user (besides you), i.e. the author of the post, has so far been involved in the comments to the post, it is clear that he or she is the one addressed. And since the post owner is also always notified of comments to their post, the SE system doesn’t deem such an
@
-notification necessary and removes it.– doncherry
May 2 '13 at 0:40
add a comment |
I will reply to items below in the chatroom trace-pgfkeys.
Feature requests
(added by Andrew Stacey) I'd like to sometimes see the values that are being passed around. As a first case, when a key uses
/.store in
I'd like to know what was being stored in what.(Andrew Stacey again) I'd like to be able to follow particular keys, or families of keys. Looking at the output from this package, there's an awful lot going on! Often, I'm just interested in tracing how one piece works.
Bugs
- Processing an unknown key with a defined unknown handler (in the unknown key's path) in the verbose mode yields an error.
Here's a M(N)WE:
documentclass{article}
usepackage{pgfkeys}
usepackage[silent]{trace-pgfkeys}
begin{document}
pgfkeys{/bla/.unknown/.code=blabla}
pgfkeystracelevel{verbose}
pgfkeys{/bla/nonexisting}
end{document}
I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown
, message expandafterunexpandedexpandafter{meaningpgfkeys@code}%
introduces an expandafter
, which becomes the first expandafter
of pgfkeys@unknown
. Further patches of pgfkeys@unknown
are therefore done in this place. The solution is to replace the offending message by expandonce{meaningpgfkeys@code}%
. The full code of the patch command is as follows:
trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknown{expandafter}{%
Unknown handler code:\%
expandonce{meaningpgfkeys@code}%
}
Hmm, this could get messy (in terms of replying to stuff)! I admit it was only my first spin with your code and I didn't try all of the gears. ... Idea: have a dedicated chat room for this package. It works well for the Tex-SX stuff (youcould use that one if you like).
– Loop Space
Feb 9 '12 at 21:54
Excellent idea! I have created one.
– Ryan Reich
Feb 9 '12 at 21:59
As the chat room is not active anymore, I have added the bug report into the answer. I also support the feature request(s) by @AndrewStacey. (The first one about values is actually easy to achieve. I can add the code if anyone's interested.)
– Sašo Živanović
Apr 27 '16 at 16:14
I hope @RyanReich reads this as I believe it's time to put this fantastic package to ctan!
– Sašo Živanović
Apr 27 '16 at 16:16
@SašoŽivanović Thank you. I considered doing this a long time ago but the package is quite version-specific topgfkeys
, and therefore increasingly dated. In addition, these days I don't do any TeX at all. Are you interested in maintaining it?
– Ryan Reich
Apr 27 '16 at 17:22
|
show 4 more comments
I will reply to items below in the chatroom trace-pgfkeys.
Feature requests
(added by Andrew Stacey) I'd like to sometimes see the values that are being passed around. As a first case, when a key uses
/.store in
I'd like to know what was being stored in what.(Andrew Stacey again) I'd like to be able to follow particular keys, or families of keys. Looking at the output from this package, there's an awful lot going on! Often, I'm just interested in tracing how one piece works.
Bugs
- Processing an unknown key with a defined unknown handler (in the unknown key's path) in the verbose mode yields an error.
Here's a M(N)WE:
documentclass{article}
usepackage{pgfkeys}
usepackage[silent]{trace-pgfkeys}
begin{document}
pgfkeys{/bla/.unknown/.code=blabla}
pgfkeystracelevel{verbose}
pgfkeys{/bla/nonexisting}
end{document}
I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown
, message expandafterunexpandedexpandafter{meaningpgfkeys@code}%
introduces an expandafter
, which becomes the first expandafter
of pgfkeys@unknown
. Further patches of pgfkeys@unknown
are therefore done in this place. The solution is to replace the offending message by expandonce{meaningpgfkeys@code}%
. The full code of the patch command is as follows:
trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknown{expandafter}{%
Unknown handler code:\%
expandonce{meaningpgfkeys@code}%
}
Hmm, this could get messy (in terms of replying to stuff)! I admit it was only my first spin with your code and I didn't try all of the gears. ... Idea: have a dedicated chat room for this package. It works well for the Tex-SX stuff (youcould use that one if you like).
– Loop Space
Feb 9 '12 at 21:54
Excellent idea! I have created one.
– Ryan Reich
Feb 9 '12 at 21:59
As the chat room is not active anymore, I have added the bug report into the answer. I also support the feature request(s) by @AndrewStacey. (The first one about values is actually easy to achieve. I can add the code if anyone's interested.)
– Sašo Živanović
Apr 27 '16 at 16:14
I hope @RyanReich reads this as I believe it's time to put this fantastic package to ctan!
– Sašo Živanović
Apr 27 '16 at 16:16
@SašoŽivanović Thank you. I considered doing this a long time ago but the package is quite version-specific topgfkeys
, and therefore increasingly dated. In addition, these days I don't do any TeX at all. Are you interested in maintaining it?
– Ryan Reich
Apr 27 '16 at 17:22
|
show 4 more comments
I will reply to items below in the chatroom trace-pgfkeys.
Feature requests
(added by Andrew Stacey) I'd like to sometimes see the values that are being passed around. As a first case, when a key uses
/.store in
I'd like to know what was being stored in what.(Andrew Stacey again) I'd like to be able to follow particular keys, or families of keys. Looking at the output from this package, there's an awful lot going on! Often, I'm just interested in tracing how one piece works.
Bugs
- Processing an unknown key with a defined unknown handler (in the unknown key's path) in the verbose mode yields an error.
Here's a M(N)WE:
documentclass{article}
usepackage{pgfkeys}
usepackage[silent]{trace-pgfkeys}
begin{document}
pgfkeys{/bla/.unknown/.code=blabla}
pgfkeystracelevel{verbose}
pgfkeys{/bla/nonexisting}
end{document}
I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown
, message expandafterunexpandedexpandafter{meaningpgfkeys@code}%
introduces an expandafter
, which becomes the first expandafter
of pgfkeys@unknown
. Further patches of pgfkeys@unknown
are therefore done in this place. The solution is to replace the offending message by expandonce{meaningpgfkeys@code}%
. The full code of the patch command is as follows:
trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknown{expandafter}{%
Unknown handler code:\%
expandonce{meaningpgfkeys@code}%
}
I will reply to items below in the chatroom trace-pgfkeys.
Feature requests
(added by Andrew Stacey) I'd like to sometimes see the values that are being passed around. As a first case, when a key uses
/.store in
I'd like to know what was being stored in what.(Andrew Stacey again) I'd like to be able to follow particular keys, or families of keys. Looking at the output from this package, there's an awful lot going on! Often, I'm just interested in tracing how one piece works.
Bugs
- Processing an unknown key with a defined unknown handler (in the unknown key's path) in the verbose mode yields an error.
Here's a M(N)WE:
documentclass{article}
usepackage{pgfkeys}
usepackage[silent]{trace-pgfkeys}
begin{document}
pgfkeys{/bla/.unknown/.code=blabla}
pgfkeystracelevel{verbose}
pgfkeys{/bla/nonexisting}
end{document}
I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown
, message expandafterunexpandedexpandafter{meaningpgfkeys@code}%
introduces an expandafter
, which becomes the first expandafter
of pgfkeys@unknown
. Further patches of pgfkeys@unknown
are therefore done in this place. The solution is to replace the offending message by expandonce{meaningpgfkeys@code}%
. The full code of the patch command is as follows:
trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknown{expandafter}{%
Unknown handler code:\%
expandonce{meaningpgfkeys@code}%
}
edited Apr 27 '16 at 16:12
community wiki
6 revs, 3 users 50%
Sašo Živanović
Hmm, this could get messy (in terms of replying to stuff)! I admit it was only my first spin with your code and I didn't try all of the gears. ... Idea: have a dedicated chat room for this package. It works well for the Tex-SX stuff (youcould use that one if you like).
– Loop Space
Feb 9 '12 at 21:54
Excellent idea! I have created one.
– Ryan Reich
Feb 9 '12 at 21:59
As the chat room is not active anymore, I have added the bug report into the answer. I also support the feature request(s) by @AndrewStacey. (The first one about values is actually easy to achieve. I can add the code if anyone's interested.)
– Sašo Živanović
Apr 27 '16 at 16:14
I hope @RyanReich reads this as I believe it's time to put this fantastic package to ctan!
– Sašo Živanović
Apr 27 '16 at 16:16
@SašoŽivanović Thank you. I considered doing this a long time ago but the package is quite version-specific topgfkeys
, and therefore increasingly dated. In addition, these days I don't do any TeX at all. Are you interested in maintaining it?
– Ryan Reich
Apr 27 '16 at 17:22
|
show 4 more comments
Hmm, this could get messy (in terms of replying to stuff)! I admit it was only my first spin with your code and I didn't try all of the gears. ... Idea: have a dedicated chat room for this package. It works well for the Tex-SX stuff (youcould use that one if you like).
– Loop Space
Feb 9 '12 at 21:54
Excellent idea! I have created one.
– Ryan Reich
Feb 9 '12 at 21:59
As the chat room is not active anymore, I have added the bug report into the answer. I also support the feature request(s) by @AndrewStacey. (The first one about values is actually easy to achieve. I can add the code if anyone's interested.)
– Sašo Živanović
Apr 27 '16 at 16:14
I hope @RyanReich reads this as I believe it's time to put this fantastic package to ctan!
– Sašo Živanović
Apr 27 '16 at 16:16
@SašoŽivanović Thank you. I considered doing this a long time ago but the package is quite version-specific topgfkeys
, and therefore increasingly dated. In addition, these days I don't do any TeX at all. Are you interested in maintaining it?
– Ryan Reich
Apr 27 '16 at 17:22
Hmm, this could get messy (in terms of replying to stuff)! I admit it was only my first spin with your code and I didn't try all of the gears. ... Idea: have a dedicated chat room for this package. It works well for the Tex-SX stuff (youcould use that one if you like).
– Loop Space
Feb 9 '12 at 21:54
Hmm, this could get messy (in terms of replying to stuff)! I admit it was only my first spin with your code and I didn't try all of the gears. ... Idea: have a dedicated chat room for this package. It works well for the Tex-SX stuff (youcould use that one if you like).
– Loop Space
Feb 9 '12 at 21:54
Excellent idea! I have created one.
– Ryan Reich
Feb 9 '12 at 21:59
Excellent idea! I have created one.
– Ryan Reich
Feb 9 '12 at 21:59
As the chat room is not active anymore, I have added the bug report into the answer. I also support the feature request(s) by @AndrewStacey. (The first one about values is actually easy to achieve. I can add the code if anyone's interested.)
– Sašo Živanović
Apr 27 '16 at 16:14
As the chat room is not active anymore, I have added the bug report into the answer. I also support the feature request(s) by @AndrewStacey. (The first one about values is actually easy to achieve. I can add the code if anyone's interested.)
– Sašo Živanović
Apr 27 '16 at 16:14
I hope @RyanReich reads this as I believe it's time to put this fantastic package to ctan!
– Sašo Živanović
Apr 27 '16 at 16:16
I hope @RyanReich reads this as I believe it's time to put this fantastic package to ctan!
– Sašo Živanović
Apr 27 '16 at 16:16
@SašoŽivanović Thank you. I considered doing this a long time ago but the package is quite version-specific to
pgfkeys
, and therefore increasingly dated. In addition, these days I don't do any TeX at all. Are you interested in maintaining it?– Ryan Reich
Apr 27 '16 at 17:22
@SašoŽivanović Thank you. I considered doing this a long time ago but the package is quite version-specific to
pgfkeys
, and therefore increasingly dated. In addition, these days I don't do any TeX at all. Are you interested in maintaining it?– Ryan Reich
Apr 27 '16 at 17:22
|
show 4 more comments
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f34712%2fhow-do-i-debug-pgfkeys%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you mean something a bit more advanced than the
.show value
and so forth? You want to "watch it in action"?– Loop Space
Nov 13 '11 at 19:02
@Andrew: Yes, exactly. Like if I defined
defa#1{b#1} defb#1{c#1} defc#1{d#1}
and calleda{x}
;tracingmacros=1
would show each macro's replacement text and its argument, one after the other. I want that for "logical" keys, not literal key-handling macros.– Ryan Reich
Nov 13 '11 at 19:10
2
Given the deafening silence on this one, and the number of votes, I think you have an opportunity here to provide a very useful tool: a pgfkeys debugging extension. I think that will a few little extra bits of code here and there, you could successfully trace all the important action and not get overwhelmed by the unnecessary stuff.
– Loop Space
Nov 26 '11 at 19:31
@Andrew: I was thinking the same thing. I believe this can be achieved by defining some tracing keys with
pgfkeys
itself, actually, that would get called in the same manner as handlers. I will think more about this in December once the quarter ends.– Ryan Reich
Nov 26 '11 at 23:51
You may take a look into the key filtering suite which ships with pgfkeys.Its purpose it to present EACH key to some "filter" to decide if the key is to be processed. I suppose that you can easily write some sort of "inspection" key. It has advanced support to handle all available key types.
– Christian Feuersänger
Feb 9 '12 at 17:29