TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is a small code.





Let's supposed that I know for example that \keys{BUG} and \keys{\return} don't work well. So I would like to redefine the commands \keys so as to use a partial home made solution during that the package will be repaired.

To do that I need to keep the trace of the original \keys macro in a command \@@@@keys for example. Then I could define my macro \keys that will take care of the arguments BUG and \return, or just reuse the original macro \keys. How can I do that ?

share|improve this question
up vote 5 down vote accepted

Something like this, however I did not check how \keys processes its input, I notice that it is not defined as a one parameter macro initially, it could do things with catcodes which here will not be possible. Perhaps though this does not happen, hence the proposed solution could be viable.

my keys

(standalone class used to produce cropped image)


\protected\def\keys #1{\in@{#1}{BUG,\return}%
                        \fi {#1}}
share|improve this answer
Good. I will keep that in my recipes. Thanks a lot ! – projetmbc Mar 15 '14 at 11:38
@projetmbc de rien. But in case \keys accepts an optional parameter, let me mention that the method here does not allow its use here with the patched version. – jfbu Mar 15 '14 at 12:21
The method only work for no-optional-argument macros ? – projetmbc Mar 15 '14 at 13:04
it works even for a macro with an optional argument as long as no use is made of an optional argument ... if you need to patch a macro with optional argument this can be done too. – jfbu Mar 15 '14 at 13:09
Cool. I will keep it in mind. – projetmbc Mar 15 '14 at 13:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.