Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Hans Hagen
On 3/19/2017 4:51 PM, Thomas A. Schmitz wrote: On 19.03.2017 16:30, Otared Kavian wrote: I would like to print in a text the values of a array computed in a \startluacode …. \stopluacode combination. How can I do it properly? Please have a look at the example below and its output, which is not

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Hans Hagen
On 3/19/2017 5:56 PM, Wolfgang Schuster wrote: Otared Kavian 19. März 2017 um 17:46via Postbox Hi Aditya, Thanks, as Thomas, Pablo and you mentioned the right way is to use context()

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Otared Kavian
Hi Wolfgang, Thanks for letting me know the command string.formatters[….]. It allows to avoid the concatenation, which is to avoid as Thomas points out. Now that I have solved the issue with the spurious space, I have one more question: how could one print the values (vecteuX[i],vecteurY[i])

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Wolfgang Schuster
Otared Kavian 19. März 2017 um 17:46via Postbox Hi Aditya, Thanks, as Thomas, Pablo and you mentioned the right way is to use context() instead of tex.print() Actually I just saw that

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Thomas A. Schmitz
On 19.03.2017 16:56, Pablo Rodriguez wrote: is there any reason not to use the following instead of your way below? for i = 1,n do tex.print("(" .. vecteurX[i] .. ", " .. vecteurY[i] .. ")\\par") end I don't think that this is a good approach. Refer to chapter 11.6 of "Programming in

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Otared Kavian
Hi Aditya, Thanks, as Thomas, Pablo and you mentioned the right way is to use context() instead of tex.print() Actually I just saw that one can also concatenate with context() as in: context("(" .. vecteurX[i] .. ", " .. vecteurY[i] .. ")\\par") which is equivalent to

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Otared Kavian
Hi Pablo, Thanks for your answer: actually I did not know that it is possible to concatenate so easily in lua… Your solution is indeed simpler than what I did and solves also the problem of the spurious space before the closing parenthesis. Best regards: OK > On 19 Mar 2017, at 16:56, Pablo

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Otared Kavian
Hi Thomas, Thanks for your answer. Indeed I did not know that I could use directly context(vecteurY[i]) Now this solves my problem! Best regards: OK > On 19 Mar 2017, at 16:51, Thomas A. Schmitz > wrote: > > On 19.03.2017 16:30, Otared Kavian wrote: >> I

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Aditya Mahajan
On Sun, 19 Mar 2017, Otared Kavian wrote: Hi, I would like to print in a text the values of a array computed in a \startluacode …. \stopluacode combination. How can I do it properly? Please have a look at the example below and its output, which is not satisfactory because the right

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Pablo Rodriguez
On 03/19/2017 04:30 PM, Otared Kavian wrote: > Hi, > > I would like to print in a text the values of a array computed in a > \startluacode …. \stopluacode combination. > How can I do it properly? Please have a look at the example below > and its output, which is not satisfactory because the right

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Thomas A. Schmitz
On 19.03.2017 16:30, Otared Kavian wrote: I would like to print in a text the values of a array computed in a \startluacode …. \stopluacode combination. How can I do it properly? Please have a look at the example below and its output, which is not satisfactory because the right parenthesis is

Re: [NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread josephcanedo
Hi, I think you can use tex.write() instead of tex.print() (pretty much the same as in lua io functions). Hope this helps Joseph De : Otared Kavian Envoyé le :dimanche 19 mars 2017 16:31 À : mailing list for ConTeXt users Objet :[NTG-context] How to use tex.print in ctxlua Hi, I would like

[NTG-context] How to use tex.print in ctxlua

2017-03-19 Thread Otared Kavian
Hi, I would like to print in a text the values of a array computed in a \startluacode …. \stopluacode combination. How can I do it properly? Please have a look at the example below and its output, which is not satisfactory because the right parenthesis is separated from the number by a space.