From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/43847 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: defining (new) macros with optional arguments Date: Wed, 10 Sep 2008 12:36:18 +0200 Message-ID: <115224fb0809100336n6bd70be1qd9cc23697933e18a@mail.gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1221043079 4292 80.91.229.12 (10 Sep 2008 10:37:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Sep 2008 10:37:59 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 10 12:38:55 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1KdN66-0002SA-1k for gctc-ntg-context-518@m.gmane.org; Wed, 10 Sep 2008 12:38:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D83601FEEA; Wed, 10 Sep 2008 12:37:51 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 16230-04-3; Wed, 10 Sep 2008 12:37:02 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4819B1FECC; Wed, 10 Sep 2008 12:37:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2A2491FEA7 for ; Wed, 10 Sep 2008 12:37:01 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18440-01-2 for ; Wed, 10 Sep 2008 12:36:22 +0200 (CEST) Original-Received: from yx-out-1718.google.com (yx-out-1718.google.com [74.125.44.153]) by ronja.ntg.nl (Postfix) with ESMTP id 925FA1FECF for ; Wed, 10 Sep 2008 12:36:20 +0200 (CEST) Original-Received: by yx-out-1718.google.com with SMTP id 3so1311724yxi.74 for ; Wed, 10 Sep 2008 03:36:19 -0700 (PDT) Original-Received: by 10.103.217.7 with SMTP id u7mr648297muq.102.1221042978541; Wed, 10 Sep 2008 03:36:18 -0700 (PDT) Original-Received: by 10.103.215.10 with HTTP; Wed, 10 Sep 2008 03:36:18 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:43847 Archived-At: On Wed, Sep 10, 2008 at 12:26 PM, Thomas A. Schmitz 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 ___________________________________________________________________________________