From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/63693 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \definenamespace (was: The visual counter module) Date: Thu, 18 Nov 2010 23:12:09 +0100 Message-ID: References: <20101117191032.GD20635@aides> <8B256D52-298A-462A-9BDD-BBC4A5BF3B67@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: multipart/mixed; boundary="===============0735338879==" X-Trace: dough.gmane.org 1290118467 22062 80.91.229.12 (18 Nov 2010 22:14:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 18 Nov 2010 22:14:27 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Nov 18 23:14:21 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PJCkH-0004qy-FZ for gctc-ntg-context-518@m.gmane.org; Thu, 18 Nov 2010 23:14:21 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 73C48CA877; Thu, 18 Nov 2010 23:14:20 +0100 (CET) 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 wIwGdbLYa2eT; Thu, 18 Nov 2010 23:14:17 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 65FDDCA85F; Thu, 18 Nov 2010 23:14:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AA416CA867 for ; Thu, 18 Nov 2010 23:14:15 +0100 (CET) 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 FPH6f0brmidR for ; Thu, 18 Nov 2010 23:14:03 +0100 (CET) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id DED65CA85A for ; Thu, 18 Nov 2010 23:14:03 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oAIME2Ya016098 for ; Thu, 18 Nov 2010 23:14:03 +0100 Original-Received: by fxm20 with SMTP id 20so2101085fxm.14 for ; Thu, 18 Nov 2010 14:14:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:mime-version :content-type:subject:date:in-reply-to:to:references:message-id :x-mailer; bh=jJtdSORFhH+8GndnlGDaJQg7WmkUtguZGsKuRFDFIHk=; b=M6d3TiCCVGQ3MI+LLqxq9lo36scPOTrs6NIa2y1C0DGBFP86Lj0cT89yHj2IuUZQ+D ehJ2vGILsvrFRMciiKCxVPn/ofxUdhsVW0BiS+MnRhE4p/ALMUvPpMo6acbvqzuVZRs0 RBeOz/PTl67jmUhticUyCV5e3YtojQEregkFc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; b=q0fp7PkFUVFgQbsD0OA1Vlwq/72be5ANUwjdmzSFvnSSFv9EGVL4QNyi2TsbpqqQjG VjV4Ib2Pua/BGhj8YE3B7eJMLMm3Od0vhvVORtaZlNrdAFDbp6MVi6lUMP2FuEKjIlvs mWkNCPsTvmS0GjUP+2S1lm0z5HFoQP/pw6h0Y= Original-Received: by 10.223.96.76 with SMTP id g12mr65924fan.32.1290118442011; Thu, 18 Nov 2010 14:14:02 -0800 (PST) Original-Received: from [192.168.2.23] (p5B292FF6.dip.t-dialin.net [91.41.47.246]) by mx.google.com with ESMTPS id l14sm343128fan.33.2010.11.18.14.13.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 18 Nov 2010 14:14:01 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0dDwKe2Oo - 17d9bde6a517 - 20101118 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:63693 Archived-At: --===============0735338879== Content-Type: multipart/alternative; boundary=Apple-Mail-2-426000659 --Apple-Mail-2-426000659 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Am 18.11.2010 um 22:20 schrieb Aditya Mahajan: > Just a few points: >=20 >> The key =93command=93 creates a bunch of macros, besides the = =84\define...=93 >> commands to create new environment and commands with your code it = creates >> the following macros to access the values from your setup commands: >>=20 >> - \parameter >> - \namedparameter >> - \detokenizedparameter >=20 > In order to use these commads, you must set a value for = \current. For example, if you have >=20 > \define[one][width=3D10cm] >=20 > In order to access the value of width of "one", you must do: >=20 > \def\current{one} >=20 > \parameter{width} >=20 > (I do not remember the distinction between \parameter, > \namedparamter, and \detokenizedparameters). \parameter use the value from \current while = \namedparameter has two argument where the first argument is the name of a command or = environment created with \define. \detokenized... is important when you pass = values from tex to lua and the value contains a tex command, e.g. \thinspace = which is normally expanded in this case. >=20 >> The command key has like the setup key the two values yes and list, >> with =84command=3Dyes=93 you can write >>=20 >> \define[two][one] >=20 > I did not know that cloning was possible. The \defineenumeration = commands allows for >=20 > \defineenumeration[new][old][..=3D..] >=20 > This clones a selected options from old to new (using copyparamters) = and then sets the values of the third arguments. \copyparameters is only used for code which doesn=92t use the new = parameter command with the parent handling but this method isn=92t necessary in mkiv > Would it make sense to add support for >=20 > \define[two,three][one][..=3D..]? You can redefine \define or leave it out from \definenamespace. What=92s also is to write \define[clone][parent=3D\????parent]. >> For parent it=92s the best to give as argument always the same value >> as you defined for the namespace, e.g. for the fancybreak module >> one should write =84parent=3Dfancybreak=93. >=20 > I thought that you have to write "parent=3D\????fancybreak". That happens in the backend hidden from the user/author. Wolfgang --Apple-Mail-2-426000659 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
Just = a few points:

The key =93command=93 = creates a bunch of macros, besides the = =84\define...=93
commands to = create new environment and commands with your code it = creates
the following macros = to access the values from your setup = commands:

 - = \<Name>parameter
=  - \named<NAME>parameter
 - = \detokenized<NAME>parameter

In order to use = these commads, you must set a value for \current<name>. For = example, if you = have

\define<name>[one][width=3D10cm]

In order to = access the value of width of "one", you must = do:

\def\current<name>{one}

\<name>parameter{wid= th}

(I do not remember the distinction between = \<name>parameter,
\named<name>paramter, and = \detokenized<name>parameters).

=
\<name>parameter use the value from \current<name> = while \named<name>parameter
has two argument where the = first argument is the name of a command or environment
created = with \define<name>. \detokenized... is important when you pass = values
from tex to lua and the value contains a tex command, = e.g. \thinspace which
is normally expanded in this = case.


The command key has like the setup key the two values yes = and list,
with =84command=3Dyes=93= you can write

 \define<NAME>[two][one]

I did not know = that cloning was possible. The \defineenumeration commands allows = for

\defineenumeration[new][old][..=3D..]

This clones a = selected options from old to new (using copyparamters) and then sets the = values of the third = arguments.

\copyparameters is = only used for code which doesn=92t use the new parameter = command
with the parent handling but this method isn=92t = necessary in mkiv

Would it make = sense to add support = for

\define<name>[two,three][one][..=3D..]?

You can redefine \define<name> or leave = it out from \definenamespace.
What=92s also is to write = \define<name>[clone][parent=3D\????parent].

For parent it=92s the best = to give as argument always the same value
as you defined for the namespace, e.g. for the fancybreak = module
one should write = =84parent=3Dfancybreak=93.

I thought that you have = to write = "parent=3D\????fancybreak".

That = happens in the backend hidden from the = user/author.

Wolfgang

= = --Apple-Mail-2-426000659-- --===============0735338879== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0735338879==--