From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82593 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: [***SPAM***] \defineenumeration options? Date: Tue, 21 May 2013 18:41:09 +0200 Message-ID: References: <519B95BF.6000802@telefonica.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: multipart/mixed; boundary="===============1171807062==" X-Trace: ger.gmane.org 1369154498 20388 80.91.229.3 (21 May 2013 16:41:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 May 2013 16:41:38 +0000 (UTC) Cc: Xan To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 21 18:41:39 2013 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 1Uepd5-000326-JA for gctc-ntg-context-518@m.gmane.org; Tue, 21 May 2013 18:41:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0624F101E8; Tue, 21 May 2013 18:41:39 +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 e9WJnFhNAnpf; Tue, 21 May 2013 18:41:33 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 4E256101E4; Tue, 21 May 2013 18:41:33 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D455B101E4 for ; Tue, 21 May 2013 18:41:31 +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 CePAyM7ozXyp for ; Tue, 21 May 2013 18:41:27 +0200 (CEST) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 2A40E101E0 for ; Tue, 21 May 2013 18:41:17 +0200 (CEST) Original-Received: from mail-ea0-x22d.google.com (mail-ea0-x22d.google.com [IPv6:2a00:1450:4013:c01::22d]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r4LGfCmp030828 for ; Tue, 21 May 2013 18:41:13 +0200 Original-Received: by mail-ea0-f173.google.com with SMTP id n15so559370ead.32 for ; Tue, 21 May 2013 09:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to:x-mailer; bh=MEngt0Tx2eXchzbG/VhTdZdhPHGM+JObnNX5CJMsvSQ=; b=NzlVNMi5Sy20B1l6KCSz137M7Drt/32UVtutUtlv8yKdAmgxDniEfFyG4QwNcqbPwa 6eRax8mIWGYKc7nbkowRio1EAkVILpRYzBLpNMRrH2P/jK/FXZetpwsUwvmj2R3VtRXS 4lcenp2+nk3SnA3kP4FbAI/WsnJ5RTBc5x30MDx5aHdGPi0TTadC5kl/UudILFLhBqiu nDRoEEjhuMO9hpPV2HMGaFABMYcn8odnasDbyWuQFr5+gvuWrpE25K+AsVuA8Q3iUBSM 5WkS+cobvIFrVuvV4f9mPh//kr3Cco7tm5AVnQeFwCmWutOGhjGUuaaNmk2QzOiHcc/f J51Q== X-Received: by 10.15.26.6 with SMTP id m6mr8570610eeu.4.1369154472725; Tue, 21 May 2013 09:41:12 -0700 (PDT) Original-Received: from keima.localdomain (nrbg-4d0751d7.pool.mediaWays.net. [77.7.81.215]) by mx.google.com with ESMTPSA id bp51sm4668672eeb.5.2013.05.21.09.41.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 May 2013 09:41:11 -0700 (PDT) In-Reply-To: <519B95BF.6000802@telefonica.net> X-Mailer: Apple Mail (2.1503) X-Bayes-Prob: 0.9588 (Score 4.7, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4013:c01::22d; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07JCEFdzO - 5b7d60c9f16f - 20130521 X-Scanned-By: CanIt (www . roaringpenguin . com) 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:82593 Archived-At: --===============1171807062== Content-Type: multipart/alternative; boundary="Apple-Mail=_B0447BBD-718E-45F2-A0C7-D8F0D94F6F0E" --Apple-Mail=_B0447BBD-718E-45F2-A0C7-D8F0D94F6F0E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Am 21.05.2013 um 17:41 schrieb Xan : > Hi, >=20 > I have two enumerations: >=20 > \defineenumeration > [exercici] You need a different name for the normal enumeration environment, e.g. = exercicidefault > = [alternative=3Dserried,text=3D{\startcolor[middlecyan]Exercici\stopcolor},= stopper=3D{.\space},left=3D{\bgroup},right=3D{\egroup},width=3Dfit,headsty= le=3D\ss] >=20 > \defineenumeration > [exercicivora] > = [alternative=3Dserried,text=3D{\startcolor[middlecyan]Exercici\stopcolor},= stopper=3D{.\space},left=3D{\bgroup\startframedtext[background=3Dscreen,fr= ame=3Doff,width=3Dbroad]},right=3D{\stopframedtext\egroup},width=3Dfit,hea= dstyle=3D\ss] >=20 >=20 > I just want to join into one: when I do \startexercici ... = \stopexercici ConTeXt do the first, and when I pass \startexercici[vora] = ... \stopexercici then do the second. That is, 'vora' as optional = argument. >=20 > How can I achieve that? You have to write you own version of the exercise environment which = chooses one the two enumerations dependent on the argument. \def\startexercici {\dosingleempty\dostartexercici} \def\dostartexercici[#1]% {\edef\currentexercici{#1}% \doifelse{\currentexercici}{vora} \startexercicivora \startexercicidefault} \def\stopexercici {\doifelse{\currentexercici}{vora} \stopexercicivora \stopexercicidefault} Wolfgang= --Apple-Mail=_B0447BBD-718E-45F2-A0C7-D8F0D94F6F0E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii dxpublica@telefonica.net>:=
=20 =20
Hi,

I have two enumerations:

\defineenumeration
  [exercici]
You need a different name for the normal = enumeration environment, e.g. 
  =
[alternative=3Dserried,text=3D{\startcolor[middlecyan]Exercici\stopcolor},=
stopper=3D{.\space},left=3D{\bgroup},right=3D{\egroup},width=3Dfit,headsty=
le=3D\ss]

\defineenumeration
  [exercicivora]
  =
[alternative=3Dserried,text=3D{\startcolor[middlecyan]Exercici\stopcolor},=
stopper=3D{.\space},left=3D{\bgroup\startframedtext[background=3Dscreen,fr=
ame=3Doff,width=3Dbroad]},right=3D{\stopframedtext\egroup},width=3Dfit,hea=
dstyle=3D\ss]


I just want to join into one: when I do \startexercici ...   =    \stopexercici ConTeXt do the first, and when I pass \startexercici[vora] ... \stopexercici then do the second. That is, 'vora' as optional argument.

How can I achieve that?

You = have to write you own version of the exercise environment which chooses one the two = enumerations dependent on the argument.

\def\startexercici
  = {\dosingleempty\dostartexercici}

\def\dostartexercici[#1]%
  = {\edef\currentexercici{#1}%
  =  \doifelse{\currentexercici}{vora}
    =  \startexercicivora
    =  \startexercicidefault}

\def\stopexercici
  = {\doifelse{\currentexercici}{vora}
    =  \stopexercicivora
    =  \stopexercicidefault}

Wolfgang
= --Apple-Mail=_B0447BBD-718E-45F2-A0C7-D8F0D94F6F0E-- --===============1171807062== 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 ___________________________________________________________________________________ --===============1171807062==--