From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/87517 Path: news.gmane.org!not-for-mail From: Matthias Weber Newsgroups: gmane.comp.tex.context Subject: Re: Simple command with variable number of arguments Date: Fri, 23 May 2014 06:55:04 -0400 Message-ID: References: <6EAF5FDE-7BE4-4766-B683-FA9994227A04@indiana.edu> <88224861-86DA-4A37-BEDC-66F9A3F822D4@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: multipart/mixed; boundary="===============0199069458==" X-Trace: ger.gmane.org 1400842537 25571 80.91.229.3 (23 May 2014 10:55:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 May 2014 10:55:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri May 23 12:55:32 2014 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 1Wnn8L-0006ah-Cr for gctc-ntg-context-518@m.gmane.org; Fri, 23 May 2014 12:55:29 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E083710221 for ; Fri, 23 May 2014 12:55:28 +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 JrL+MSm488uw for ; Fri, 23 May 2014 12:55:28 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 29AFA101EC for ; Fri, 23 May 2014 12:55:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4D670101EE for ; Fri, 23 May 2014 12:55:20 +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 rKLx0TWnwQbn for ; Fri, 23 May 2014 12:55:18 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id AFE23101EC for ; Fri, 23 May 2014 12:55:10 +0200 (CEST) Original-Received: from hartman.uits.indiana.edu (hartman.uits.indiana.edu [129.79.1.194]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s4NAt70f029142 for ; Fri, 23 May 2014 12:55:09 +0200 X-IronPort-AV: E=Sophos;i="4.98,893,1392181200"; d="asc'?scan'208";a="140934687" Original-Received: from mssg-relay.indiana.edu ([129.79.1.73]) by irpt-internal-relay.indiana.edu with ESMTP; 23 May 2014 06:55:06 -0400 Original-Received: from hartman.uits.indiana.edu (hartman.uits.indiana.edu [129.79.1.194]) by mssg-relay.indiana.edu (8.14.7/8.14.4/IU Messaging Team) with ESMTP id s4NAsuUE016055 for ; Fri, 23 May 2014 06:55:05 -0400 X-IronPort-AV: E=Sophos;i="4.98,893,1392181200"; d="asc'?scan'208";a="73213401" Original-Received: from candy.uits.indiana.edu (HELO mail-relay.iu.edu) ([129.79.1.201]) by irpt-internal-relay.indiana.edu with ESMTP; 23 May 2014 06:55:05 -0400 Original-Received: from [172.27.35.85] (c-98-223-200-195.hsd1.in.comcast.net [98.223.200.195]) (authenticated bits=0) by mail-relay.iu.edu (8.14.7/8.14.4/IU Messaging Team) with ESMTP id s4NAt5KF002207 for ; Fri, 23 May 2014 06:55:05 -0400 In-Reply-To: <88224861-86DA-4A37-BEDC-66F9A3F822D4@gmail.com> X-Mailer: Apple Mail (2.1874) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=129.79.1.194; country=US; region=Indiana; city=Bloomington; latitude=39.1653; longitude=-86.5264; http://maps.google.com/maps?q=39.1653,-86.5264&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QM5mT7DT - ad43b4462904 - 20140523 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:87517 Archived-At: --===============0199069458== Content-Type: multipart/signed; boundary="Apple-Mail=_A1D8EFC8-15BC-4091-8B2F-FCEA3FB9EBE6"; protocol="application/pgp-signature"; micalg=pgp-sha512 --Apple-Mail=_A1D8EFC8-15BC-4091-8B2F-FCEA3FB9EBE6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Thanks Otared, that looks very promising. My attempt to wrap the arguments with \NC \NR = fails, though. It looks like only the first argument is used, and I am clearly missing = something. Also, I=92d like to use the example you posted but without the last = comma so that in the example below I get (4,5) instead of (4,5,). Matthias \definemathmatrix [pmatrix] [left=3D{\left(\,},right=3D{\,\right)}] =20 \def\docolumnvector#1{\NC#1\NR} =20 \def\columnvector#1 {\startpmatrix \processcommalist[#1]\docolumnvector \stoppmatrix} \def\dorowvector#1{#1,} =20 \def\rowvector#1 {\startpmatrix \processcommalist[#1]\dorowvector \stoppmatrix} \starttext \startformula \columnvector{1,2,3} \stopformula \startformula \rowvector{4,5} \stopformula \stoptext On May 23, 2014, at 6:08 AM, Otared Kavian wrote: > Hi, >=20 > Some time ago Wolfgang S. gave a solution to a similar problem: maybe = this can help you. >=20 > %%%% begin > \def\somemacro#1% > {\def\dosomemacro##1{Execute ##1, }% > \processcommalist[#1]\dosomemacro} >=20 > \starttext > \somemacro{A,B,C} >=20 > \somemacro{E,F} > \stoptext > %%%% end >=20 > Best regards: OK >=20 > On 23 May 2014, at 11:54, Matthias Weber wrote: >=20 >> Dear All, >>=20 >> I would like to define a command that expands=20 >>=20 >> \vector{2,4} % or vector[2,4] if that=92s easier >>=20 >> to >>=20 >> \startpmatrix >> \NC 2 \NR >> \NC 4 \NR >> \stoppmatrix >>=20 >> and more generally >>=20 >> \vector{2,4,1,7} >>=20 >> to >>=20 >> \startpmatrix >> \NC 2 \NR >> \NC 4 \NR >> \NC 1 \NR >> \NC 7 \NR >> \stoppmatrix >>=20 >> Any hints how to achieve this? >>=20 >> Thanks, >>=20 >> Matthias >> = __________________________________________________________________________= _________ >> If your question is of interest to others as well, please add an = entry to the Wiki! >>=20 >> 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 >> = __________________________________________________________________________= _________ >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_A1D8EFC8-15BC-4091-8B2F-FCEA3FB9EBE6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTfykIAAoJELjBb0GFETaxK5AP/jgjbbJBz0d+q9vpGCahpldl GZWIJITuDdTqoPgR/+fDsGmMAa72UfOytYPVtePePxgJSIbWqaTBtQTwItJPahNi Yf+jJkfH7lXQtfreqtHysWBAwpLRuYxrIMpSS9+kZnmuXNj1dxJ2cW50wVqyBB09 EAzm5YHqx6WVK8VdY9dGIe058hDxQMkaXsFHqzrOnzXTknZ8di0oJEiQLA9hDmza hAW5IFcTLDEdzwXaZIQsON1HVB3muZPX3Q0Y7iwzyFYn0PaEzt+En98dnxzzKIHY 23GrtzbRLuKLF5Uon5Ajw1wJ54273D8VeYBl8Pm6tGdQ4Arxs6NTae8/9tGO1WGw ceDbHbN4FUFXmrr8ElJKRRdmZOzTpvh254qbfUv3oyf1QyuCiGLWTKAhUoSB1Tb9 stKXMkgk8fKa6QW4aY89ksVCF7n+gNbNV0sVfQ2agtwfF3W9GpcIL+JZ/fs/bzh1 Ovw13HPi5KiEcY3l8jRZdZuSHyIiBaHc6HWz64+7HJlWeN53uIDNTkYEBkBLYCyw biRTMv3OrE8ow4SC+udcy4+1kyeyF3cBTkzvV7zvEtnXxdUalgj7Td8GAJ8/t0Fa rQHS33+hlf2oI+GIQNWV42aYIaKIWWZQRpwb99A+/StQKJyEOcWZXnUPcuEsPZl2 D85r+SnjodH5Vp9I23dX =KVgs -----END PGP SIGNATURE----- --Apple-Mail=_A1D8EFC8-15BC-4091-8B2F-FCEA3FB9EBE6-- --===============0199069458== 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 ___________________________________________________________________________________ --===============0199069458==--