[NTG-context] Re: Question about building an array of values with Lua
Otared Kavian schrieb am 24.08.2023 um 01:04: Hi Fabrice, As Wolfgang points out, it is indeed possible to fill-in your table with Lua: maybe you were wondering how to fill the columns 2, 3 and 4. In this case you need to use the Lua function math.mod as in the following, which is a completed version of what Wolfgang sent: I guess I completely missed the units digit part :) %% begin filling-with-lua.tex \starttext \startluacode context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = "black" } context.startxrow{ background = "color", backgroundcolor = "lightgray" } context.startxcell{ nx = 4 } context("Units digit of") context.stopxcell() context.stopxrow() context.startxrow() context.startxcell{ width = "1cm" } context.im("a") context.stopxcell() context.startxcell{ width = "1cm" } context.im("a^2") context.stopxcell() context.startxcell{ width = "1cm" } context.im("b") context.stopxcell() context.startxcell{ width = "1cm" } context.im("2b^2") context.stopxcell() context.stopxrow() for i = 0,9 do context.startxrow() for j = 1,4 do context.startxcell() if j == 1 then context(i) elseif j == 2 then context(math.mod(i*i,10)) elseif j == 3 then context(i) else context(math.mod(2*i*i,10)) end context.stopxcell() end context.stopxrow() end I would drop the column check in this case. for i = 0,9 do context.startxrow() context.startxcell() context(i) context.stopxcell() context.startxcell() context(math.mod(i*i,10)) context.stopxcell() context.startxcell() context(i) context.stopxcell() context.startxcell() context(math.mod(2*i*i,10)) context.stopxcell() context.stopxrow() end Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Question about building an array of values with Lua
Hi Fabrice, As Wolfgang points out, it is indeed possible to fill-in your table with Lua: maybe you were wondering how to fill the columns 2, 3 and 4. In this case you need to use the Lua function math.mod as in the following, which is a completed version of what Wolfgang sent: %% begin filling-with-lua.tex \starttext \startluacode context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = "black" } context.startxrow{ background = "color", backgroundcolor = "lightgray" } context.startxcell{ nx = 4 } context("Units digit of") context.stopxcell() context.stopxrow() context.startxrow() context.startxcell{ width = "1cm" } context.im("a") context.stopxcell() context.startxcell{ width = "1cm" } context.im("a^2") context.stopxcell() context.startxcell{ width = "1cm" } context.im("b") context.stopxcell() context.startxcell{ width = "1cm" } context.im("2b^2") context.stopxcell() context.stopxrow() for i = 0,9 do context.startxrow() for j = 1,4 do context.startxcell() if j == 1 then context(i) elseif j == 2 then context(math.mod(i*i,10)) elseif j == 3 then context(i) else context(math.mod(2*i*i,10)) end context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext %% end filling-with-lua.tex Best regards: Otared > On 23 Aug 2023, at 17:48, Wolfgang Schuster > wrote: > > Fabrice Couvreur schrieb am 23.08.2023 um 19:28: >> Hi, >> I'm trying to fill an array using lua. So far it works but then I don't know >> if it's possible. > > Where do you have problems (look into cld-mkiv.pdf for hins)? > > \starttext > > \startluacode > context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = > "black" } > context.startxrow{ background = "color", backgroundcolor = "lightgray" } > context.startxcell{ nx = 4 } > context("Units digit of") > context.stopxcell() > context.stopxrow() > context.startxrow() > context.startxcell{ width = "1cm" } > context.im("a") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("a^2") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("b") > context.stopxcell() > context.startxcell{ width = "1cm" } > context.im("2b^2") > context.stopxcell() > context.stopxrow() > for i = 0,9 do > context.startxrow() > for j = 1,4 do > context.startxcell() > if j == 1 then > context(i) > end > context.stopxcell() > end > context.stopxrow() > end > context.stopxtable() > \stopluacode > > \stoptext > > Wolfgang > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ Otared Kavian e-mail: ota...@gmail.com Phone: +33 6 88 26 70 95 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: An strange error with section and page
Xavier B. schrieb am 23.08.2023 um 15:02: Wolfgang, I detect something extrange: when I use \startexercici \stopexercici (see [https://repo.or.cz/apunts-espa-matematiques.git/blob/HEAD:/ng-entorn-minimal.conTeXt]) in some cases there is an *undesired* indent (see attachment image). I saw the source [https://repo.or.cz/apunts-espa-matematiques.git/blob/HEAD:/ng-aritmetica-problemes-nombres-fraccions.conTeXt] which is the first time it happens. I don't see anything weird. Can you please help me? I found the problem but I have to discuss it with Hans. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Question about building an array of values with Lua
Fabrice Couvreur schrieb am 23.08.2023 um 19:28: Hi, I'm trying to fill an array using lua. So far it works but then I don't know if it's possible. Where do you have problems (look into cld-mkiv.pdf for hins)? \starttext \startluacode context.startxtable{ align = "middle,lohi", bodyfont = "9pt", framecolor = "black" } context.startxrow{ background = "color", backgroundcolor = "lightgray" } context.startxcell{ nx = 4 } context("Units digit of") context.stopxcell() context.stopxrow() context.startxrow() context.startxcell{ width = "1cm" } context.im("a") context.stopxcell() context.startxcell{ width = "1cm" } context.im("a^2") context.stopxcell() context.startxcell{ width = "1cm" } context.im("b") context.stopxcell() context.startxcell{ width = "1cm" } context.im("2b^2") context.stopxcell() context.stopxrow() for i = 0,9 do context.startxrow() for j = 1,4 do context.startxcell() if j == 1 then context(i) end context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Question about building an array of values with Lua
Hi, I'm trying to fill an array using lua. So far it works but then I don't know if it's possible. Thanks Fabrice \startluacode context.startxtable({"align={middle,lohi},bodyfont=9pt,framecolor=black"}) context.startxrow({"background=color, backgroundcolor=lightgray"}) context.startxcell({"nx=4"}) context("Units digit of") context.stopxcell() context.stopxrow() context.startxrow() context.startxcell({"width=1cm"}) context("\\im{a}") context.stopxcell() context.startxcell({"width=1cm"}) context("\\im{a²}") context.stopxcell() context.startxcell({"width=1cm"}) context("\\im{b}") context.stopxcell() context.startxcell({"width=1cm"}) context("\\im{2b²}") context.stopxcell() context.stopxrow() for i = 0, 9 do context.startxrow() context.startxcell() context(i) context.stopxcell() context.stopxrow() end context.stopxtable() \stopluacode ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Attention: Notice to registered participants of the meeting
Dear participants of the meeting! Due to technical difficulties, we likely didn't get one registration, so we don't know who is coming. Don't worry we've counted you in and it can be a surprise visit, still we would prefer to know where to send instructions, what room you have requested, etc. Please check the list, and if you don't find yourself in the list, please, register again. Sorry for the inconvenience, Jano We have registrations of: Hans Hagen Ton Otten Taco Hoekwater Jano Kula Massimiliano Farinella Tomáš Hála Harald Koenig Henning Hraban Ramm Wolfgang Schuster Egaras Šakuras Jean-Michel Hufflen Pavneet Arora Willi Egger Michael Guravage Ryszard Kubiak ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Fallbacks for design sizes in the current typescripts regime
Hi Vincent, On Aug 22, 2023, 2:56 PM -0600, Vincent Hennebert , wrote: I don’t know about its quality, but Adobe makes the Source Serif font available under the SIL Open Font License, with 5 optical sizes and 6 weights. I’m working on a typescript file that allows to use all those variants, would be happy to contribute it if that’s useful. Many thanks for sharing this useful resource. Looking forward to trying out your typescript collection for Adobe Source Serif if/when you make it available. Best wishes Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: An strange error with section and page
On Tue, 22 Aug 2023 20:06:52 +0200 Wolfgang Schuster ha escrit: > While the solution here is to convert all subject headings to subsubject > (be sure to also take care > of even lower section) a quick way to fix the page break is to disable > the page-value for subject, > look at the commented line in the example how this can be done. > > begin example > \setuphead[section][page=yes] > %\setuphead[subject][page=no] > Thank you VERY much. You solved my problem Xavier ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: MAPS nr 53
On 22.08.23 21:16, Hans Hagen wrote: On 8/22/2023 8:24 PM, Keith McKay wrote: Would it be possible to list the contents to whet our appetites? the successive chapters are basically the long articles that taco wrote about mp fundamentals for ctx meetings / journal + one extra Hans I just got mine in the mail and hope that Taco is reading this: wow, this is really amazing. Very helpful and gently didactic, really an excellent read. This will keep me busy for a long time. Thanks, Taco! Thomas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Re: Better option for a macro with lots of arguments
On 8/23/2023 4:12 AM, Andres Conrado Montoya wrote: I have been using the following macro to add a bunch of sections to the start of chapters in a book, it works but I think is kind of weak: %%% \define[7]\metadatos{ \startsection[title={Resumen}] #1 \stopsection \startsection[title={Palabras clave}] #2 \stopsection \start \language[en] \startsection[title={Abstract}] #3 \stopsection \startsection[title={Keywords}] #4 \stopsection \stop \startsection[title={¿Cómo citar este capítulo? / How to cite this book?}] \startsubsection[title={Apa}] #5 \stopsubsection \startsubsection[title={Chicago}] #6 \stopsubsection \startsubsection[title={MLA}] #7 \stopsubsection \stopsection } \starttext % Then I call the macro like this: \metadatos{spanish abstract \input knuth}{some, comma, separated, keywords, in, spanish}{english abstract \input knuth}{same, comma, separated, keywords, in, english}{Apa citation style for this article}{Chicago citation style for this article}{MLA citation style for this article} \stoptext %%% I've been exploring different ways to do it better, but with not much luck, I was thinking something based in key=value assignments? setups? datasets? Not really sure, but If you know a better solution or point me in the direction of something I can use to replace that macro, it would be greatly appreciated. \startsetups [document:start] \doifdocumentvariable {englishabstract} { \startsection[title={Resumen}] \documentvariable{englishabstract} \stopsection } \doifdocumentvariable {spanisabstract} { \startsection[title={Palabras clave}] \documentvariable{spanishabstract} \stopsection } ... \stopsetups \startbuffer english ... \stopbuffer \startbuffer spanish ... \stopbuffer \startsetups [document:stop] ... \stopsetups \startdocument [spanisabstract={\getbuffer[spanish]}, ] ... \stopdocument untested, just keyed in - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror
rsync: [Receiver] failed to connect to rsync.pragma-ade.nl (213.125.29.165): Connection timed out (110) rsync error: error in socket IO (code 10) at clientserver.c(139) [Receiver=3.2.7] ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror
rsync: [Receiver] failed to connect to rsync.pragma-ade.nl (213.125.29.165): Connection timed out (110) rsync error: error in socket IO (code 10) at clientserver.c(139) [Receiver=3.2.7] ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___