From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91961 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: What is a better way to do this macro? Date: Thu, 16 Jul 2015 21:03:15 +0200 Message-ID: <55A7FFF3.7080205@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1180732632==" X-Trace: ger.gmane.org 1437073458 9144 80.91.229.3 (16 Jul 2015 19:04:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jul 2015 19:04:18 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jul 16 21:04:04 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZFoRv-00048R-O8 for gctc-ntg-context-518@m.gmane.org; Thu, 16 Jul 2015 21:04:03 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 02C7C101E6 for ; Thu, 16 Jul 2015 21:04:03 +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 zgSYDszmjgll for ; Thu, 16 Jul 2015 21:03:58 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B206F10237 for ; Thu, 16 Jul 2015 21:03:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4A8BC101F6 for ; Thu, 16 Jul 2015 21:03:21 +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 65gfnas7OTlU for ; Thu, 16 Jul 2015 21:03:20 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 205FC101E6 for ; Thu, 16 Jul 2015 21:03:20 +0200 (CEST) Original-Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) by filter4-ams.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t6GJ3IFD029016 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 16 Jul 2015 21:03:18 +0200 Original-Received: by wibxm9 with SMTP id xm9so21396241wib.0 for ; Thu, 16 Jul 2015 12:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=vBUA75+r+h7quMhTiA9SfQj7g8vV+qkFo+czzYrVoZo=; b=H0fi6jK914alNw7wDxu/5CUL61lZcFc/LF0ok2U6s7/6BMHR5Soue+g6lFsa4C2uIm Ylwk6aIjfU7JUZ7/Yktfo7u21VIdJy08cVdq+1ytwsB4gZa4jzub5heGG7BDvLUfKiR1 byAgz50mcwEbElT/OvUuV0Je6MpKlWMUCWdHw/a9UEfp0/hj03blBu1iPZRixZckz9Fg /rFZL7vxz51lqnVfwuIovODZmcJ942BcdCtDKsyfVDQnnAMIu2zChwgHqWhrM0dGF9E5 qxcaCju7eQtaet91WS3BkX5Qs+hYZSKy6pgaWFkx4WNYEn3eRFUc9usJyeSjWxcb8tGP kKZA== X-Received: by 10.194.86.130 with SMTP id p2mr20467676wjz.99.1437073398494; Thu, 16 Jul 2015 12:03:18 -0700 (PDT) Original-Received: from keima.localdomain (x2f2a6d7.dyn.telefonica.de. [2.242.166.215]) by smtp.googlemail.com with ESMTPSA id lv8sm14499538wjb.41.2015.07.16.12.03.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jul 2015 12:03:17 -0700 (PDT) User-Agent: Postbox 4.0.1 (Macintosh/20150514) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::22d; country=BE; region=Brussels Capital; city=Brussels; latitude=50.8466; longitude=4.3528; http://maps.google.com/maps?q=50.8466,4.3528&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01OR73iVX - bff56793fa8f - 20150716 (trained as not-spam) Received-SPF: pass (filter4-ams.mf.surf.net: domain of schuster.wolfgang@gmail.com designates 2a00:1450:400c:c05::22d as permitted sender) receiver=filter4-ams.mf.surf.net; client-ip=2a00:1450:400c:c05::22d; envelope-from=; helo=mail-wi0-x22d.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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" Xref: news.gmane.org gmane.comp.tex.context:91961 Archived-At: This is a multi-part message in MIME format. --===============1180732632== Content-Type: multipart/alternative; boundary="------------050100080007060702070208" This is a multi-part message in MIME format. --------------050100080007060702070208 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Idris Samawi Hamid =D8=A7=D8=AF=D8=B1=D9=8A=D8=B3 =D8=B3=D9=85=D8=A7=D9= =88=D9=8A =D8=AD=D8=A7=D9=85=D8=AF > 16. Juli 2015 20:49 > Dear gang, > > Consider the following (also attached): > > =3D=3D=3D=3D=3Dchoice-cs.tex=3D=3D=3D=3D > \def\CHOICE#1#2{\leavevmode\vbox{\tabskip=3D0pt\everycr=3D{} > \halign{\strut\hfil##\hfil\cr#1\cr#2\cr}}} > > \setuppagenumber[state=3Dstop] > \setupwhitespace[big] > > \starttext > (One~* Two~* Three~* Four) is even. > > (\CHOICE{x}{One}~* \CHOICE{1}{Two}~* \CHOICE{x}{Three}~*=20 > \CHOICE{2}{Four}) is even. > \stoptext > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > What is best way to define the \CHOICE macro without low-level TeX=20 > commands, only high-level ConTeXt commands? Thanks in advance and You can use the \framed command. \define[2]\ChoiceOne =20 {\dontleavehmode\framed[frame=3Doff,location=3Dbottom,align=3Dmiddle,offs= et=3D0pt]{#1\\#2}} \defineframed[ChoiceTwo][frame=3Doff,location=3Dbottom,align=3Dmiddle,off= set=3D0pt] \starttext (\ChoiceOne{x}{One}~* \ChoiceOne{1}{Two}~* \ChoiceOne{x}{Three}~*=20 \ChoiceOne{2}{Four}) is even. (\ChoiceTwo{x\\One}~* \ChoiceTwo{1\\Two}~* \ChoiceTwo{x\\Three}~*=20 \ChoiceTwo{2\\Four}) is even. \stoptext Wolfgang --------------050100080007060702070208 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
= =20 16. Juli 2015=20 20:49
Dear gang,

Consider the following (also attached):

=3D=3D=3D=3D=3Dchoice-cs.tex=3D=3D=3D=3D
\def\CHOICE#1#2{\leavevmode\vbox{\tabskip=3D0pt\everycr=3D{}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 \halign{\strut\hfil##\hfil\cr#1\cr#2\cr}}}

\setuppagenumber[state=3Dstop]
\setupwhitespace[big]

\starttext
(One~* Two~* Three~* Four) is even.

(\CHOICE{x}{One}~* \CHOICE{1}{Two}~* \CHOICE{x}{Three}~*=20 \CHOICE{2}{Four}) is even.
\stoptext
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

What is best way to define the \CHOICE macro without low-level TeX=20 commands, only high-level ConTeXt commands? Thanks in advance and
You can use the \framed command.

\define[2]\ChoiceOne
=C2=A0=20 {\dontleavehmode\framed[frame=3Doff,location=3Dbottom,align=3Dmiddle,offs= et=3D0pt]{#1\\#2}}

\defineframed[ChoiceTwo][frame=3Doff,location=3Dbottom,align=3Dmiddle,off= set=3D0pt]

\starttext

(\ChoiceOne{x}{One}~* \ChoiceOne{1}{Two}~* \ChoiceOne{x}{Three}~*=20 \ChoiceOne{2}{Four}) is even.

(\ChoiceTwo{x\\One}~* \ChoiceTwo{1\\Two}~* \ChoiceTwo{x\\Three}~*=20 \ChoiceTwo{2\\Four}) is even.

\stoptext

Wolfgang
--------------050100080007060702070208-- --===============1180732632== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1180732632==--