ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* defining (new) macros with optional arguments
@ 2008-09-10  9:54 Goebel, Juergen
  2008-09-10 10:26 ` Thomas A. Schmitz
  0 siblings, 1 reply; 3+ messages in thread
From: Goebel, Juergen @ 2008-09-10  9:54 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 385 bytes --]

Hi,

Does something like \newcommand exist in ConTeXt? 
My questions aims especially at the optional argument
with a predefined value.  So, how do I realize 

\newcommand{\test}[2][A]{foo}

with ConTeXt. In the fine manual I found an index entry
\definecommand, but in the 'rest' of the manual it was
never mentioned (print and screen version alike)!

Regards,

Juergen

[-- Attachment #1.2: Type: text/html, Size: 1151 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: defining (new) macros with optional arguments
  2008-09-10  9:54 defining (new) macros with optional arguments Goebel, Juergen
@ 2008-09-10 10:26 ` Thomas A. Schmitz
  2008-09-10 10:36   ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas A. Schmitz @ 2008-09-10 10:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Sep 10, 2008, at 11:54 AM, Goebel, Juergen wrote:

> Hi,
>
> Does something like \newcommand exist in ConTeXt?
> My questions aims especially at the optional argument
> with a predefined value.  So, how do I realize
>
> \newcommand{\test}[2][A]{foo}
>
> with ConTeXt. In the fine manual I found an index entry
> \definecommand, but in the 'rest' of the manual it was
> never mentioned (print and screen version alike)!
>
> Regards,
>
> Juergen
>
No, we never define any commands... Err, in fact yes, sometimes we do.  
You want to read http://wiki.contextgarden.net/System_Macros ,  
especially http://wiki.contextgarden.net/System_Macros/Handling_Arguments

HTH

Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: defining (new) macros with optional arguments
  2008-09-10 10:26 ` Thomas A. Schmitz
@ 2008-09-10 10:36   ` Wolfgang Schuster
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2008-09-10 10:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Sep 10, 2008 at 12:26 PM, Thomas A. Schmitz
<thomas.schmitz@uni-bonn.de> wrote:
>
> On Sep 10, 2008, at 11:54 AM, Goebel, Juergen wrote:
>
>> Hi,
>>
>> Does something like \newcommand exist in ConTeXt?
>> My questions aims especially at the optional argument
>> with a predefined value.  So, how do I realize
>>
>> \newcommand{\test}[2][A]{foo}
>>
>> with ConTeXt. In the fine manual I found an index entry
>> \definecommand, but in the 'rest' of the manual it was
>> never mentioned (print and screen version alike)!
>>
>> Regards,
>>
>> Juergen
>>
> No, we never define any commands... Err, in fact yes, sometimes we do.
> You want to read http://wiki.contextgarden.net/System_Macros ,
> especially http://wiki.contextgarden.net/System_Macros/Handling_Arguments
>
> Thomas

http://wiki.contextgarden.net/Commands_with_optional_arguments

And we have also \define and \redefine but you can't use optional arguments
with them.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-10 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-10  9:54 defining (new) macros with optional arguments Goebel, Juergen
2008-09-10 10:26 ` Thomas A. Schmitz
2008-09-10 10:36   ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).