On Wed, 23 Aug 2006, Pepe Barbe wrote:
In the ConTeXt manuales there is a reference to \definesomething as a way to create new commands(?)/variables(?). The truth is that I haven't bee able to truly understand if this is a generic example or I can define my own commands with this and how the syntax would be used. I would appreciate if anyone can clarify this to me.
You can use if for almost anything you want. This is how \define is defined :) \def\define#1% {\ifx#1\undefined \expandafter\def \else \message{[\noexpand#1is already defined]}% \expandafter\def\expandafter\gobbleddefinition \fi#1} Which basically means that \define\mymacro#1 is equivalent to \def\mymacro#1 but also checks if mymacro has already been defined. In general, it is a good idea to use \define for all your private macros to make sure that you do not redefine one of context's internal macros. Another way to ensure the same thing is to use CAPS for all your private macros. If you really want to redefine a macro that is already defined, you should use \redefine\macro.... you can also use \def\macro.... but \redefine gives you a warning message. Aditya