UPDATED, see edit history for completeness
I'm trying out the keycommand package but it's not working as expected. There seems to be some incompatibility with tables, but I've read and re-read the documentation and I can't figure out what it is.
I've built a minimal example of what I'm doing. It's using longtable, since those seem to work a little better than regular ones and since that is what I need it to work with (for now):
\documentclass{article}
\usepackage{longtable}
\usepackage{keycommand}
\newkeycommand\mycommand[first=one,second=2][1]{%
#1 \\
First: \commandkey{first} & second: \commandkey{second}%
}
\begin{document}
\begin{longtable}{ll}
\mycommand{hello} \\
\mycommand[first=1,second=two]{world!}
\end{longtable}
\end{document}
The problem is that instead of outputting the parameter values, it outputs the parameter names:
EXPECTED OUTPUT ACTUAL OUTPUT
*************** *************
hello hello
First: one second: 2 first: first second: second
world! world!
First: 1 second: two first: first second: second
Why does it do this? What can I do about it?


&s and\\s, it didn't even compile anymore... I'll keep trying some stuff and update if I find anything I think is useful. Thanks for the hint! – Tomas Aschan Jan 15 '13 at 23:06&s) but withlongtable(which is what I need) the MWE showed exactly the behavior I observe in my actual code. Would you mind taking a new look at this? – Tomas Aschan Jan 15 '13 at 23:20\newkeycommanddefined macros don't work across table columns. :( There are problems in timing: when you do\\, the local assignments performed at the call of\mycommandare lost. – egreg Jan 15 '13 at 23:32\commandkeyare local; the\\in the definition ends the group where these assignments are made andkeycommandsloses track of what the values should be, so it prints the key name. – egreg Jan 16 '13 at 00:06tabuof the same author. ;-) To be serious: I do not know, if this helps here, but reading the question title I remembered this bugfix by Joseph Wright. – Speravir Jan 16 '13 at 01:16