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

How can saying a song's name be a copyright violation?

What's the in-universe reasoning behind sorcerers needing material components?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Is it possible to create a QR code using text?

Detention in 1997

Plagiarism or not?

Alternative to sending password over mail?

Why didn't Boeing produce its own regional jet?

What does the expression "A Mann!" means

Determining Impedance With An Antenna Analyzer

Can I run a new neutral wire to repair a broken circuit?

How badly should I try to prevent a user from XSSing themselves?

Venezuelan girlfriend wants to travel the USA to be with me. What is the process?

Expand and Contract

Avoiding direct proof while writing proof by induction

Should I tell management that I intend to leave due to bad software development practices?

How writing a dominant 7 sus4 chord in RNA ( Vsus7 chord in the 1st inversion)

Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?

Assassin's bullet with mercury

How to show a landlord what we have in savings?

Can compressed videos be decoded back to their uncompresed original format?

Why is this clock signal connected to a capacitor to gnd?

Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?

What exploit Are these user agents trying to use?



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













32















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.)










share|improve this question
























  • 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#1b#1 defb#1c#1 defc#1d#1 and called ax; 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
















32















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.)










share|improve this question
























  • 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#1b#1 defb#1c#1 defc#1d#1 and called ax; 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














32












32








32


8






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.)










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 defined defa#1b#1 defb#1c#1 defc#1d#1 and called ax; 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


















  • 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#1b#1 defb#1c#1 defc#1d#1 and called ax; 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

















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#1b#1 defb#1c#1 defc#1d#1 and called ax; 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#1b#1 defb#1c#1 defc#1d#1 and called ax; 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











2 Answers
2






active

oldest

votes


















21














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.






share|improve 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 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: 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


















10














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:



documentclassarticle

usepackagepgfkeys
usepackage[silent]trace-pgfkeys

begindocument

pgfkeys/bla/.unknown/.code=blabla
pgfkeystracelevelverbose
pgfkeys/bla/nonexisting

enddocument


I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown, message expandafterunexpandedexpandaftermeaningpgfkeys@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 expandoncemeaningpgfkeys@code%. The full code of the patch command is as follows:



trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknownexpandafter%
Unknown handler code:\%
expandoncemeaningpgfkeys@code%






share|improve this answer

























  • 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 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











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
);



);













draft saved

draft discarded


















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









21














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.






share|improve 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 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: 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















21














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.






share|improve 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 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: 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













21












21








21







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.






share|improve 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.







share|improve this answer














share|improve this answer



share|improve this answer








edited 9 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 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: 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





    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











  • @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






  • 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











10














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:



documentclassarticle

usepackagepgfkeys
usepackage[silent]trace-pgfkeys

begindocument

pgfkeys/bla/.unknown/.code=blabla
pgfkeystracelevelverbose
pgfkeys/bla/nonexisting

enddocument


I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown, message expandafterunexpandedexpandaftermeaningpgfkeys@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 expandoncemeaningpgfkeys@code%. The full code of the patch command is as follows:



trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknownexpandafter%
Unknown handler code:\%
expandoncemeaningpgfkeys@code%






share|improve this answer

























  • 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 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















10














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:



documentclassarticle

usepackagepgfkeys
usepackage[silent]trace-pgfkeys

begindocument

pgfkeys/bla/.unknown/.code=blabla
pgfkeystracelevelverbose
pgfkeys/bla/nonexisting

enddocument


I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown, message expandafterunexpandedexpandaftermeaningpgfkeys@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 expandoncemeaningpgfkeys@code%. The full code of the patch command is as follows:



trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknownexpandafter%
Unknown handler code:\%
expandoncemeaningpgfkeys@code%






share|improve this answer

























  • 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 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













10












10








10







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:



documentclassarticle

usepackagepgfkeys
usepackage[silent]trace-pgfkeys

begindocument

pgfkeys/bla/.unknown/.code=blabla
pgfkeystracelevelverbose
pgfkeys/bla/nonexisting

enddocument


I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown, message expandafterunexpandedexpandaftermeaningpgfkeys@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 expandoncemeaningpgfkeys@code%. The full code of the patch command is as follows:



trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknownexpandafter%
Unknown handler code:\%
expandoncemeaningpgfkeys@code%






share|improve this answer















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:



documentclassarticle

usepackagepgfkeys
usepackage[silent]trace-pgfkeys

begindocument

pgfkeys/bla/.unknown/.code=blabla
pgfkeystracelevelverbose
pgfkeys/bla/nonexisting

enddocument


I investigated a bit and found the source of the error. In the second patch of pgfkeys@unknown, message expandafterunexpandedexpandaftermeaningpgfkeys@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 expandoncemeaningpgfkeys@code%. The full code of the patch command is as follows:



trace@patchcmd@tpgfkverbose@tpgfkpgfkeys@unknownexpandafter%
Unknown handler code:\%
expandoncemeaningpgfkeys@code%







share|improve this answer














share|improve this answer



share|improve this answer








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 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

















  • 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 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
















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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How should I use the fbox command correctly to avoid producing a Bad Box message?How to put a long piece of text in a box?How to specify height and width of fboxIs there an arrayrulecolor-like command to change the rule color of fbox?What is the command to highlight bad boxes in pdf?Why does fbox sometimes place the box *over* the graphic image?how to put the text in the boxHow to create command for a box where text inside the box can automatically adjust?how can I make an fbox like command with certain color, shape and width of border?how to use fbox in align modeFbox increase the spacing between the box and it content (inner margin)how to change the box height of an equationWhat is the use of the hbox in a newcommand command?

Doxepinum Nexus interni Notae | Tabula navigationis3158DB01142WHOa682390"Structural Analysis of the Histamine H1 Receptor""Transdermal and Topical Drug Administration in the Treatment of Pain""Antidepressants as antipruritic agents: A review"

Haugesund Nexus externi | Tabula navigationisHaugesund pagina interretialisAmplifica