Re: [NTG-context] Simple command with variable number of arguments

2014-05-24 Thread Jeong Dal
Dear Hans, Here is the file in my desktop. The reason I didn’t define “sgn” in the function “uppertri” is that it is inherited from the call of “determinant’. However, I put “sgn=1” so that the function “uppertri” works independently. I checked the function “uppertri” and found that it worked

[NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Matthias Weber
Dear All, I would like to define a command that expands \vector{2,4} % or vector[2,4] if that’s easier to \startpmatrix \NC 2 \NR \NC 4 \NR \stoppmatrix and more generally \vector{2,4,1,7} to \startpmatrix \NC 2 \NR \NC 4 \NR \NC 1 \NR \NC 7 \NR \stoppmatrix Any hints how to achieve

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Otared Kavian
Hi, Some time ago Wolfgang S. gave a solution to a similar problem: maybe this can help you. begin \def\somemacro#1% {\def\dosomemacro##1{Execute ##1, }% \processcommalist[#1]\dosomemacro} \starttext \somemacro{A,B,C} \somemacro{E,F} \stoptext end Best regards: OK On 23 May

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Matthias Weber
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’d like to use the example you posted but without the last comma so that in the example below I get

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Aditya Mahajan
On Fri, 23 May 2014, Matthias Weber wrote: Dear All, I would like to define a command that expands \vector{2,4} % or vector[2,4] if that’s easier to \startpmatrix \NC 2 \NR \NC 4 \NR \stoppmatrix and more generally \vector{2,4,1,7} to \startpmatrix \NC 2 \NR \NC 4 \NR \NC 1 \NR \NC 7

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Matthias Weber
Thanks Aditya,but out of the box the following\usemodule[simplematrix]\definesimplematrix[MATRIX][fence=bracket]\starttext\startformula\MATRIX{1,2,3}\MATRIX{1;2;3}\stopformula\stoptextgives me texshop_image.pdf Description: Adobe PDF document MatthiasOn May 23, 2014, at 6:56 AM, Aditya Mahajan

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Aditya Mahajan
On May 23, 2014, at 7:14 AM, Matthias Weber matwe...@indiana.edu wrote: Thanks Aditya, but out of the box the following \usemodule[simplematrix] \definesimplematrix[MATRIX][fence=bracket] \starttext \startformula \MATRIX{1,2,3} \MATRIX{1;2;3} \stopformula \stoptext

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread luigi scarso
On Fri, May 23, 2014 at 11:54 AM, Matthias Weber matwe...@indiana.eduwrote: Dear All, I would like to define a command that expands \vector{2,4} % or vector[2,4] if that’s easier to \startpmatrix \NC 2 \NR \NC 4 \NR \stoppmatrix and more generally \vector{2,4,1,7} to

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Matthias Weber
Indeed - I should have checked, I tried this with the TeXLive version. With the current beta it works. Thank! Matthias On May 23, 2014, at 7:37 AM, Aditya Mahajan adit...@umich.edu wrote: Strange. What version of context are you using? Aditya signature.asc Description: Message

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Matthias Weber
Thanks Luigi! Now I have a lot to play with… Matthias On May 23, 2014, at 7:44 AM, luigi scarso luigi.sca...@gmail.com wrote: On Fri, May 23, 2014 at 11:54 AM, Matthias Weber matwe...@indiana.edu wrote: Dear All, I would like to define a command that expands \vector{2,4} % or

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Jeong Dal
...@gmail.com To: mailing list for ConTeXt users ntg-context@ntg.nl Subject: Re: [NTG-context] Simple command with variable number of arguments Message-ID: CAG5iGsCadu33Hw=hphmde+wp1b_fcpjn0caxwjaso+vnqbj...@mail.gmail.com Content-Type: text/plain; charset=utf-8 On Fri, May 23

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Hans Hagen
Message: 1 Date: Fri, 23 May 2014 13:44:30 +0200 From: luigi scarso luigi.sca...@gmail.com To: mailing list for ConTeXt users ntg-context@ntg.nl Subject: Re: [NTG-context] Simple command with variable number of arguments Message-ID: CAG5iGsCadu33Hw=hphmde+wp1b_fcpjn0caxwjaso+vnqbj

Re: [NTG-context] Simple command with variable number of arguments

2014-05-23 Thread Jeong Dal
Dear Hans, Thank you for checking and enhancing. I also got an error at “uppertri” as you point out. The version that I have sent is one in my notebook which may be different from that in the desktop at school. When I made a class material, it worked fine. I have to check it and send it to you