From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78445 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: Re: \define a command with square-bracket arguments Date: Thu, 27 Sep 2012 17:59:31 +0200 Message-ID: <506477E3.2050209@uni-bonn.de> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1348761582 18358 80.91.229.3 (27 Sep 2012 15:59:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Sep 2012 15:59:42 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Sep 27 17:59:47 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1THGV7-000810-BF for gctc-ntg-context-518@m.gmane.org; Thu, 27 Sep 2012 17:59:45 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2C2DF10200; Thu, 27 Sep 2012 17:59:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qNdWFeah95pK; Thu, 27 Sep 2012 17:59:34 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B0CCF101E5; Thu, 27 Sep 2012 17:59:34 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D62E7101E5 for ; Thu, 27 Sep 2012 17:59:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YSegPn+EnSKG for ; Thu, 27 Sep 2012 17:59:32 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id C9490101E2 for ; Thu, 27 Sep 2012 17:59:32 +0200 (CEST) Original-Received: from uni-bonn.de (mail.uni-bonn.de [131.220.15.113]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q8RFxVV1026617 for ; Thu, 27 Sep 2012 17:59:32 +0200 Original-Received: from [87.178.39.209] (account tschmit1@uni-bonn.de HELO [192.168.0.31]) by fe2.uni-bonn.de (CommuniGate Pro SMTP 5.4.4) with ESMTPSA id 26471431 for ntg-context@ntg.nl; Thu, 27 Sep 2012 17:59:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=131.220.15.113; country=DE; region=07; city=Bonn; latitude=50.7333; longitude=7.1000; http://maps.google.com/maps?q=50.7333,7.1000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RI4fXvko - 583b60a42a13 - 20120927 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:78445 Archived-At: On 09/27/2012 05:45 PM, Sietse Brouwer wrote: > Hi all, > > As I understand it, \define[2] is preferred over \def#1#2 because it > refuses to overwrite existing commands. > > \define[2]\mycommand{code code code} > defines a command to be invoked with > \mycommand{...}{...} > > Can I use \define, or a related command, to define a command that > takes square-bracket arguments, like so: > \mycommand[...][...] > ? > > When I type > \define[1][2]\mycommand{code code code} > that doesn't work. > > Cheers, > Sietse > _______ You know the wiki better than most, but I wonder: are you looking for this page? http://wiki.contextgarden.net/Commands_with_optional_arguments 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________