Re: [NTG-context] Documentation for the database module
Some time ago I wrote metapost code for make a periodic table. See: https://tex.stackexchange.com/questions/233417/periodic-table-with-electron-counts-in-shells/233644 Have a nice day Jorge <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> Sem vírus. www.avast.com <https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> Em ter., 15 de set. de 2020 às 03:51, escreveu: > Hi, > > I want to typeset a Periodic Table of the Elements. The according data > is prepared in a file with comma separated values (csv/UNIX). I found > some *very* basic informations how to get file based csv-data typeset, > but the result is hardly recognizable as Periodic Table of the > Elements. > > To understand how to use the according commands I need a documentation > of it. > > What I found was this: > https://wiki.contextgarden.net/M-database > which is more a summary of two examples with no explanations and > starting with the warning "This may be outdated". > > Where can I find a good one? > > Thanks a lot for any help in advance! > Cheers! > mcc > > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > -- Atentamente DesdeChaves ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] crosswords puzzles
Dear sirs, Is there a way to make crosswords or word puzzles in context? In my hippocampus I have a vague idea that this has already been tried, but I can't find this code anymore. Have a great day Jorge ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Asking for Hans Hagen candle's source code
Dear Sirs, If I can, where can I have access to show-gra.pdf source code (.tex file)? I would like to reproduce the Hans Hagen candle with the propose of illustration a "flame test" chemistry activity. Each salt burned have a different flame color and I would like to use Hans candle's with a different flame colors. Thanks a lot, have a nice day Jorge ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] include google maps in context document
Thanks to all for your support. For now I use Latex for making the images (thanks to Ulrike and Mojca), but my heart is on OpenStreet Maps + luatex + Metapost solution (thanks to Hans et al). Perhaps soon anybody can play with it. For now it lacks a labels level and it's to hard add particular gps tracks. Thank you very much to all. Jorge 2017-05-04 15:55 GMT+01:00 Mojca Miklavec <mojca.miklavec.li...@gmail.com>: > On 4 May 2017 at 15:59, Henning Hraban Ramm wrote: > > Am 2017-05-04 um 13:46 schrieb Mojca Miklavec: > >> On 4 May 2017 at 13:30, DesdeChaves wrote: > >>> > >>> Can you provide me a example (or a link) for use OpenStreet Maps in > context? > >>> > >>> Perhaps I can track my displacements with my phone and superimpose > those > >>> tracks with the OpenStreet Maps. > >> > >> See the attachment (you need to extract the osm file before running > context). > > > > Wow, that looks like something I need, thank you so much! > > Why didn’t anyone publish this as a module or on the wiki? > > Blame me :( > > Hans wrote most of the code and told me to document it. > > Mojca > > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > -- Atentamente DesdeChaves ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] include google maps in context document
Thanks for your support. Can you provide me a example (or a link) for use OpenStreet Maps in context? Perhaps I can track my displacements with my phone and superimpose those tracks with the OpenStreet Maps. Jorge 2017-05-04 11:26 GMT+01:00 Mojca Miklavec <mojca.miklavec.li...@gmail.com>: > Hi, > > On 3 May 2017 at 23:12, DesdeChaves wrote: > > Dear Sirs > > > > I need to justify my displacements from my school to the various > companies > > where I have students in training. For this I must include in my report a > > gloogle maps image with the path and the distance covered. > > > > In the browse o found all the information that I need. For example, with > an > > url address like: > > > > http://maps.googleapis.com/maps/api/distancematrix/json? > origins=Seattle=San+Francisco=driving=false > > > > i get a json response, but not the google map image. > > > > If I try an address like this > > "https://www.google.pt/maps/dir/Chaves/Valpaços/; I found all > information in > > the browser, but I need to include it in my context document report. > > > > Anybody know a simply way to make this work or this is a too hard task > for > > now. > > This is not really a ConTeXt-related question, but ConTeXt can include > any image you can feed to it, and potentially fetch images from URL on > the fly. So you first need to figure out how to get the image you > want. > > See: > https://developers.google.com/maps/documentation/static-maps/intro > > You first need your own API_KEY. > > If you have problems with the interface, ask on stackexchange or > elsewhere. If you have problems with making as automatic workflow as > possible (once you know how to get your PNGs exactly), you may ask > here. But have the rest of the details ready. > > ConTeXt supports "natively" drawing OpenStreet Maps, but I doubt it > would work in your case. > > Mojca > > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ -- Atentamente DesdeChaves ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] include google maps in context document
Dear Sirs I need to justify my displacements from my school to the various companies where I have students in training. For this I must include in my report a gloogle maps image with the path and the distance covered. In the browse o found all the information that I need. For example, with an url address like: http://maps.googleapis.com/maps/api/distancematrix/json?origins=Seattle=San+Francisco=driving=false i get a json response, but not the google map image. If I try an address like this " https://www.google.pt/maps/dir/Chaves/Valpaços/; I found all information in the browser, but I need to include it in my context document report. Anybody know a simply way to make this work or this is a too hard task for now. Have a good night Thanks in advance Jorge ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] call of string.match() inside \ctxlua{}
Dear Sirs A have a string where I need to extract one number. But every time I run this code I found this error message: [ctxlua]:1: unfinished string near \usemodule[scancsv] \def\licann#1{% #1 - lesson number with strings \ctxlua{parsedate=thirddata.scancsv.ParseCSVLine('#1','n.º');% local Nlic=(parsedate[2]);% Nlic=tonumber(string.match(Nlic, '%d+'));% context(Nlic ~=0 and 1 or 0)}} \starttext \licann{"lesson nº456Alterada"} \stoptext thanks in advance Have a nice day jorge ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] How to define a TeX logic function with a boolean returned from a Lua function and \edef fixed value
Dear sirs, Is there a way to compare, in TeX environment, a value returned from a lua function with a TeX variable? Please see this code: \def\aleatorioValue{ \startlua local nu = math.random(1,10); if nu<5 return 1 else return 0 end \stoplua } \edef\controlValue{1} \edef\inferior{Number too small \\} \edef\superior{Number too big \\} \def\myfunction{\ifx\aleatorioValue\controlValue\inferior\else\superior\fi} \starttext \dorecurse{20}{\myfunction} \stoptext Thanks a lot. Have a nice day Jorge ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] scancsv module and lua
Fixed. Sorry for the noise. 2017-01-16 17:35 GMT+00:00 DesdeChaves <desdecha...@gmail.com>: > Dear sirs, > > In my project I need to format some data from a csv file. The csv file is > scanned using the scancsv module and part of this information is formatted > inside luacode environment, but the text.print("") and the context("") > functions don´t be able to send the formatted data to the output. The > result is a empty pdf. > > The example attached is from a old question. > > Thanks a lot for your time > > Jorge M. > > --- example -- > > \usemodule[scancsv] > > \def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator > \startlua > local parsedate=thirddata.scancsv.ParseCSVLine('#1','#2'); > local day=tonumber(parsedate[1]); > local month=tonumber(parsedate[2]); > local year=tonumber(parsedate[3]); > -- tex.print(day..'#3'..month..'#3'..year); > text.print("Hello"); > \stoplua > } > > \unexpanded\def\lineaction{ > \Name\ arrived on \ddmm{\Date}{/}{.\\,} \\ > } > > > % Name;Date > % ME;11/10/14 > % You;05/02/14 > % He;15/02/2014 > % She;03/03/12 > % It;03/03/14 > > \setheader > \setsep{;} > \setfiletoscan{mail.csv} > > \starttext > \filelineaction > \stoptext > -- Atentamente DesdeChaves ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] scancsv module and lua
Dear sirs, In my project I need to format some data from a csv file. The csv file is scanned using the scancsv module and part of this information is formatted inside luacode environment, but the text.print("") and the context("") functions don´t be able to send the formatted data to the output. The result is a empty pdf. The example attached is from a old question. Thanks a lot for your time Jorge M. --- example -- \usemodule[scancsv] \def\ddmm#1#2#3{% #1 - date, #2 - old separator, #3 - new separator \startlua local parsedate=thirddata.scancsv.ParseCSVLine('#1','#2'); local day=tonumber(parsedate[1]); local month=tonumber(parsedate[2]); local year=tonumber(parsedate[3]); -- tex.print(day..'#3'..month..'#3'..year); text.print("Hello"); \stoplua } \unexpanded\def\lineaction{ \Name\ arrived on \ddmm{\Date}{/}{.\\,} \\ } % Name;Date % ME;11/10/14 % You;05/02/14 % He;15/02/2014 % She;03/03/12 % It;03/03/14 \setheader \setsep{;} \setfiletoscan{mail.csv} \starttext \filelineaction \stoptext ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] ANN: Updated Vim scripts for ConTeXt
Thanks a lot. Autocompletation don't works for me. Perhaps I have a wrong .vimrc file. Can you share your .vimrc file or a working .vimrc file. I use MacVim only with Context. Thanks a lot. I'm in MacVim 8.0.27. Have a nice day, Jorge 2016-10-11 10:46 GMT+01:00 Nicola <nvitacolo...@gmail.com>: > On 2016-10-11 09:33:36 +, Henning Hraban Ramm said: > > Am 2016-10-11 um 09:26 schrieb Nicola <nvitacolo...@gmail.com>: >> >> No, everything just works(tm) :) See :help ftplugin-overrule for the >>> details. >>> >> >> No, unfortunately not everything: >> >> Error detected while processing /Users/hraban/.vim/syntax/context.vim: >> line 22: >> E121: Undefined variable: v:t_list >> E15: Invalid expression: type(s:context_include) ==# v:t_list >> Error detected while processing /Users/hraban/.vim/ftplugin/context.vim: >> line 18: >> E539: Illegal character : formatoptions+=tjcroql2 >> >> >> Maybe my vim is too old? >> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 23 2016 20:20:57) >> > > Yes, the scripts are meant to be used with Vim 8. You should be able to > work around those errors by replacing v:t_list with 3 and removing 'j' > from formatoptions, but other things, like asynchronous typesetting, > won't work anyway. > > Nicola > > > > > ___ > 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/list > info/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > > ___ > -- Atentamente DesdeChaves ___ 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://context.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Buffered metapost function freezes random numbers
I found this solution in a old Hans post ( http://ntg-context.ntg.narkive.com/g0lT1D2A/scaling-mpgraphics) 2016-05-25 18:30 GMT+01:00 Wolfgang Schuster <schuster.wolfg...@gmail.com>: > DesdeChaves <desdecha...@gmail.com> > 25. Mai 2016 um 19:09 > For educational purposes I try to simulate a ammeter for reading practice. > I would like create six or more ammeter with different readings, but i'm > not able to do that because metapost create the same random number every > time I call the buffer that defines my ammeter. > > How can I fix that? > > Is there a reason why you use \externalfigure because the width can be set > with \scale, e.g. > > \scale[width=8cm]{\getbuffer[ammeter]} > > Wolfgang > > > ___ > 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 > > _______ > -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] Buffered metapost function freezes random numbers
For educational purposes I try to simulate a ammeter for reading practice. I would like create six or more ammeter with different readings, but i'm not able to do that because metapost create the same random number every time I call the buffer that defines my ammeter. How can I fix that? Thanks Jorge My code: \startbuffer[ammeter] \startMPcode r := 4cm; len := 10bp; min_thickness := 1.75bp; hour_thickness := 3bp; path cadran; cadran = fullcircle scaled (2r); numeric escala; escala := 0; for i = 50 upto 70: if i mod 5 = 0: j := i div 5; angl := 90-30j; freelabel("\tfb\bf" & decimal escala, (r+len)*dir angl, r*dir angl); draw ((r, 0) -- (r - len, 0)) rotated angl withpen pencircle scaled min_thickness; escala:= escala + 0.5; else: angl := 90 - 6i; draw ((r, 0) -- (r - .5len, 0)) rotated angl; fi endfor pickup pencircle scaled min_thickness; numeric minute; %randomseed := uniformdeviate infinity; minute:= 50 + uniformdeviate(20); pair A, B, C; A:=1.6r*right+.5r*up; C:=1.6r*right+.8r*up; B:=1.1r*left; drawarrow origin -- r*dir(90-minute*6) cutends (0, 1.5len); fill fullcircle scaled .75len; draw unitsquare xscaled 3.2r yscaled 1.5r shifted B; label("\tfb I (A)", 1.2r*up+1.6r*right) withcolor red; draw fullcircle scaled 2len shifted A; draw fullcircle scaled 2len shifted C; \stopMPcode \stopbuffer \startbuffer[programa] \placefigure[center,nonumber]{}{ \startcombination[2*1] {\externalfigure[ammeter][type=buffer,width=8cm]}{\_\_\_\_\_\_\_\_\_\_$\pm$\_\_\_\_\_\_\_\_} {\externalfigure[ammeter][type=buffer,width=8cm]}{\_\_\_\_\_\_\_\_\_\_$\pm$\_\_\_\_\_\_\_\_} } \stopcombination \stopbuffer \starttext \dorecurse{3} {\getbuffer[programa]} \stoptext output.pdf Description: Adobe PDF document ___ 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 ___
Re: [NTG-context] anchor points for \inmargin
Thanks a lot for this great solution. 2015-11-12 18:14 GMT+00:00 Wolfgang Schuster <schuster.wolfg...@gmail.com>: > DesdeChaves <desdecha...@gmail.com> > 11. November 2015 um 19:01 > Dear Sirs, > > I'm trying to make a exam for my students. After the question I should > provide a blank space for the answer. In the margin I want write the > partial scores for the answer. The problem occurs when I force a new page. > In this case the text in the margin is flushed to the next page. I don't > want this behavior. How can I can this? > > Margin texts are flushed with the next paragraph but you can start one for > the points only with the \dontleavehmode command. > > \define[1]\Info > {\dontleavehmode\margindata[inmargin]{\rotate{#1}}} > > Another question: How can I anchor the scores in the middle of the > vertical blank space? This \vskip4cm\Info{scores}\vskip4cm don't make the > job. > > You can use the \framed command to reserve the space for the answer and > place with the score with a layer as background for the frame. > > \setupmargindata[inmargin][style={\ss\tfx},location=outer,align=middle] > \setupmarginframed[inmargin][align=middle,location=outer] > > \definelayer[infolayer][width=\framedwidth,height=\framedheight] > > \startsetups[infolayer:place] > > \setlayer[infolayer][preset=middleright]{\rotate{\getvariable{infotext}{points}}} > \stopsetups > > > \defineframed[infobox][frame=off,width=max,background=infolayer,setups=infolayer:place] > > \define[2]\Info > {\par >\setvariable{infotext}{points}{#2}% >\infobox[height=#1]{}} > > \starttext > > \startitemize[n] > \starthead{Question 1} > \Info{9cm}{20 \periods[3] 15 \periods[3] 10} > \stophead > \starthead{Question 2} > \Info{8cm}{20 \periods[3] 15 \periods[3] 10} > \stophead > \starthead{Question 3} > \Info{6cm}{20 \periods[3] 15 \periods[3] 10} > \stophead > \stopitemize > > \stoptext > > Wolfgang > > > ___ > 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 > > ___ > -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] anchor points for \inmargin
Dear Sirs, I'm trying to make a exam for my students. After the question I should provide a blank space for the answer. In the margin I want write the partial scores for the answer. The problem occurs when I force a new page. In this case the text in the margin is flushed to the next page. I don't want this behavior. How can I can this? Another question: How can I anchor the scores in the middle of the vertical blank space? This \vskip4cm\Info{scores}\vskip4cm don't make the job. Thanks in advance. Jorge Code: \setupmargindata[inmargin][style={\ss\tfx},location=outer,align=middle] \setupmarginframed[inmargin][align=middle,location=outer] \def\Info#1{\margindata[inmargin]{\rotate{#1}\ignorespaces}} \starttext \startitemize[n] \item Question 1 \vskip8cm \Info{20 \periods[3] 15 \periods[3] 10} \vskip1cm \item Question 2 \vskip8cm \Info{20 \periods[3] 15 \periods[3] 10} \page %%% --> problematic \item Question 3 \stoptext ___ 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 ___
[NTG-context] Form with character separators
I would like to produce a form with a character separators. However, my code presents two problems: first, the character box has no fixed dimensions and, two, I can't indent the text when it occupies multiple lines (ex, address field). I tried to use the starttabulate environment, but without sucess. My questions are: Can I fix the size of the boxes? and Can I apply the starttabulate environment to indent the field description and align all descriptors and fields names (name, age, sex, race, address, ...)? Thanks in advance Jorge tokens3.pdf Description: Adobe PDF document tokens3.tex Description: TeX document ___ 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 ___
[NTG-context] PPCHTEX: bonds overlaps the radicals groups
Some time ago I wrote the code attached to create random branched organic molecules. However, with recent versions of Context the carbon-carbon bonds overwrites the radicals. How can I fix this? Another question: is there a way to change the bonds color? I would like to blank some radicals and bonds and ask the students to draw it. Thanks and have a nice sunday. teste.tex Description: TeX document ___ 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 ___
Re: [NTG-context] can't run external lua library
Luigi, you saved my day. Thanks a lot. Now all works fine. 2015-07-23 8:30 GMT+01:00 luigi scarso luigi.sca...@gmail.com: On Thu, Jul 23, 2015 at 1:37 AM, DesdeChaves desdecha...@gmail.com wrote: I'm trying to reuse a old library to generate poisson numbers. In old context versions the library works fine, but in the current beta (ConTeXt ver: 2015.07.16 13:30 MKIV beta fmt: 2015.7.23 int: english/english) the execution fails. This code works perfectly in lua 5.3 but not in luatex. why? \startluacode require meurandist ARRAY_SIZE=3 arr=meurandist.new_int(ARRAY_SIZE) meurandist.rpoisson(arr,ARRAY_SIZE,4) for i=0,ARRAY_SIZE-1 do print(meurandist.int_getitem(arr,i)) end \stopluacode Thanks a lot luatex 0.80.1 (the latest luatex) still uses lua 5.2.4 -- luigi ___ 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 ___ -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] can't run external lua library
I'm trying to reuse a old library to generate poisson numbers. In old context versions the library works fine, but in the current beta (ConTeXt ver: 2015.07.16 13:30 MKIV beta fmt: 2015.7.23 int: english/english) the execution fails. This code works perfectly in lua 5.3 but not in luatex. why? \startluacode require meurandist ARRAY_SIZE=3 arr=meurandist.new_int(ARRAY_SIZE) meurandist.rpoisson(arr,ARRAY_SIZE,4) for i=0,ARRAY_SIZE-1 do print(meurandist.int_getitem(arr,i)) end \stopluacode Thanks a lot Jorge ___ 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 ___
[NTG-context] Update text variables inside metapost
Why the metapost not updated the value of text variables that are generated inside luacode environment? In the code below, If I have \startitemize[columns,two] then metapost draw: 1. \Bolha[size=6cm]{text1}{text2}{text3}, 2. and four \Bolha[size=4cm]{text1}{text2}{text3}, but text1, text2 and text3 is not updated in every call; If I omit the itemize environment or with \startitemize metapost only draw: 1. the first call of Bolha that is: \Bolha[size=6cm]{text1}{text2}{text3} 2. and four call of \Bolha[size=6cm]{text1}{text2}{text3} %% all new information is omited Jorge % code \def\Bolha[#1]#2#3#4% {\setupMPvariables[bolha][#1]% \setMPtext{labelcima}{#3}% \setMPtext{labelesquerda}{#2}% \setMPtext{labeldireita}{#4}% \useMPgraphic{bolha}} \startuniqueMPgraphic{bolha} path p, q, cima, esquerda, direita, vertical; pair A, B, C; p:=fullcircle scaled \MPvar{size}; A:= (point 4 of p); B:= (point 8 of p); C:= (point 6 of p); q:=A--B; vertical := .5[A,B]--C; cima := buildcycle(q, subpath(4,8) of reverse p); esquerda := buildcycle(subpath(4,6) of p, vertical, subpath(0,.5) of q); direita := buildcycle(subpath(6,8) of p, subpath(0,.5) of reverse q, vertical); draw p; draw q; draw vertical; label(textext( \MPstring{labelcima} ), center cima); label(textext( \MPstring{labelesquerda} ), center esquerda); label(textext( \MPstring{labeldireita} ), center direita); \stopuniqueMPgraphic \starttext \placefigure[center, nonumber]{}{ \Bolha[size=6cm]{$C_m$ (g/dm\high{3})}{mass (g)}{V\low{s} (dm\high{3})} } \startitemize[columns,two] %% try only \startitemize \startluacode flasks={20,25,50,100,200,250,500,1000} k=1 repeat Cm=math.random(1,10)/10 Vs=flasks[math.random(1,8)]/1000 mass=Cm*Vs --incognita=math.random(1,3) incognita=1 context.item() if incognita==1 then context(\\Bolha[size=4cm]{$C_m$}{%.2f g}{%.1f dm\\high{3}} mass=%.2f g, mass, Vs, mass) elseif incognita==2 then context(\\Bolha[size=5cm]{%.1f g/dm\\high{3}}{m}{%.1f dm\\high{3}} mass= hidde, Cm, Vs, mass) elseif incognita==3 then context(\\Bolha[size=5cm]{%.1f g/dm\\high{3}}{%.2f g}{V\\low{s}} mass=%.2f g, Cm ,mass, mass) end k=k+1 until k==5 \stopluacode \stopitemize \stoptext %%% stop code ___ 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 ___
Re: [NTG-context] Update text variables inside metapost
Aditaya, thanks for the clarification. Now it works perfectly. Jorge 2015-03-07 23:57 GMT+00:00 Aditya Mahajan adit...@umich.edu: On Sat, 7 Mar 2015, DesdeChaves wrote: Why the metapost not updated the value of text variables that are generated inside luacode environment? In the code below, If I have \startitemize[columns,two] then metapost draw: 1. \Bolha[size=6cm]{text1}{text2}{text3}, 2. and four \Bolha[size=4cm]{text1}{text2}{text3}, but text1, text2 and text3 is not updated in every call; Use useMPgraphic instead of uniqueMPgraphic. uniqueMPgraphic recomputes the graphic only when the dimensions of figure has changed; otherwise, it reuses the previously drawn graphic. This behavior was useful for drawing page-backgrounds etc in MkII where calling metapost was slow. Aditya ___ 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 ___ -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] Code that run in Metapost but not in starMPcode enviroment
I'm trying to draw some random arrows using Metapost. For that I use a piece of code from fpast that in found at stackexchange http://tex.stackexchange.com/questions/179745/generating-random-arrows-in-tikz/180111#180111 Unfortunately this code does not work in context (request for a solution http://tex.stackexchange.com/questions/225864/metapost-error-related-with-context) because the freelabel() function. If I disable it the result is the expected. What is wrong with this code? \starttext \startMPcode numeric u, nb_vectors, wd; u := 1cm; % unit length nb_vectors := 20; wd = .5; boolean intersect; pair random_origin; color random_color; path candidate, random_vector[]; % vardef bb(expr p) = save orig, extr; pair orig, extr; orig = point 0 of p; extr = point 1 of p; pair v,w; v = wd*unitvector(extr-orig)*u; w = v rotated 90; (orig - v + w) -- (extr + v + w) -- (extr + v - w) -- (orig - v - w) -- cycle enddef; % pickup pencircle scaled 2bp; i = 1; forever: exitunless (i = nb_vectors); intersect := false; random_length := u*(2+uniformdeviate(1)); random_angle := uniformdeviate(359); random_origin := u*(uniformdeviate(wd*nb_vectors), uniformdeviate(wd*nb_vectors)); random_color := (uniformdeviate(1), uniformdeviate(1), uniformdeviate(1)); candidate := random_origin -- (random_origin + random_length*dir(random_angle)); j := 1; forever: exitif (j = i) or (intersect = true); if bb(random_vector[j]) intersectiontimes bb(candidate) (-1, -1): intersect := true; fi; j := j+1; endfor; if intersect = false: random_vector[i] = candidate; drawarrow candidate withcolor random_color; freelabel(btex $v$ etex, point .5 of candidate, point .5 of candidate + dir (random_angle + 90)); i := i+1; fi; endfor; \stopMPcode \stoptext ___ 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 ___
Re: [NTG-context] pgfplots.revision.tex is missing in the last ContextMinimals
There are a extra \ in the beginning of the file pgfplots.revision.tex. I have *\*\begingroup* --- should be \begingroup* \\catcode`\\/=12 \\catcode`\\.=12 \\catcode`\\:=12 \\catcode`\\+=12 \\catcode`\\-=12 \gdef\pgfplotsrevision{1.11-232-g91e635c} \gdef\pgfplotsversion{1.11} \gdef\pgfplotsversiondatetime{2014-08-04 12:47:48 +0200} \gdef\pgfplotsrevisiondatetime{2015-01-04 21:23:44 +0100} \gdef\pgfplots@glob@TMPa#1-#2-#3 #4\\relax{#1/#2/#3} \xdef\pgfplotsversiondate{\expandafter\pgfplots@glob @TMPa\pgfplotsversiondatetime\\relax} \xdef\pgfplotsrevisiondate{\expandafter\pgfplots@glob @TMPa\pgfplotsrevisiondatetime\\relax} \endgroup 2015-01-10 11:04 GMT+00:00 Mojca Miklavec mojca.miklavec.li...@gmail.com: On Mon, Jan 5, 2015 at 11:00 PM, DesdeChaves wrote: Dear Sirs In the last ContextMinimals the file pgfplots.revision.tex is missing. This file is required by the pgfplots module. Some problems had to be fixed upstream and I had to start auto-generating that file, but I hope that it is fixed now. Please check if it works ok. Mojca ___ 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 ___ -- Atentamente DesdeChaves ___ 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 ___
Re: [NTG-context] pgfplots.revision.tex is missing in the last ContextMinimals
Now is fine. Thanks a lot. jorge 2015-01-10 12:30 GMT+00:00 Mojca Miklavec mojca.miklavec.li...@gmail.com: On Sat, Jan 10, 2015 at 12:31 PM, DesdeChaves wrote: There are a extra \ in the beginning of the file pgfplots.revision.tex. I'm sorry. After the problem was fixed, I synced the package, but not the distribution. Please try again. Mojca ___ 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 ___ -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] pgfplots.revision.tex is missing in the last ContextMinimals
Dear Sirs In the last ContextMinimals the file pgfplots.revision.tex is missing. This file is required by the pgfplots module. Happy New Year 2015 to all members Jorge ___ 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 ___
[NTG-context] MP/Lua binding information flow
In the code in the attachment I have intend that everytime the data generated by Lua are updated metapost should make immediately their representation. However, it insists into represent only the last data generated. How can I fix this problem? thanks Jorge calltemplates.tex Description: TeX document ___ 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 ___
Re: [NTG-context] Pass a lua table to metapost
Thanks, but I'm not able to run this code in my system. I'm working in ConTeXt ver: 2014.12.06 14:20 MKIV beta fmt: 2014.12.8 int: english/english and the error message is: runscript ! Isolated expression. to be read again ( mlib_luas_luacall-begingroup.runscript( for.s=(TEXT2):if.string.s:s.elsei... lua-..._s,(TEXT3))else:mlib_luas_luacall((TEXT3)) fi.endgroup * ...lua(mp.print(#document.variables.labels)) : b[i] = unitsquare xscal... ! Extra tokens will be flushed. to be read again ( mlib_luas_luacall-begingroup.runscript( for.s=(TEXT2):if.string.s:s.elsei... lua-..._s,(TEXT3))else:mlib_luas_luacall((TEXT3)) fi.endgroup * ...lua(mp.print(#document.variables.labels)) : b[i] = unitsquare xscal... vacuous ! Improper final value has been replaced by 0. to be read again : * ...a(mp.print(#document.variables.labels)) : b[i] = unitsquare xscaled... 2014-12-08 9:21 GMT+00:00 Hans Hagen pra...@wxs.nl: On 12/7/2014 8:25 PM, DesdeChaves wrote: I would like to pass the lua table keys and values to metapost. In the keys i have information about the paths names and in the values i have information about the label that should be draw in the center of each path (unitsquare). In my code (see attach) the table in question is weekdays_number_and_name. I know that is possible to pass a array from metapost to lua. Is the reverse possible? it's possible to ask values from within mp: \starttext \startluacode document.variables = { labels = { one, two, three, } } \stopluacode \startMPpage numeric dx, dy; dx = 4.4cm; dy = 0.53cm; path b[]; for i=1 upto lua(mp.print(\#document.variables.labels)) : b[i] = unitsquare xscaled dx yscaled dy shifted (0, (i-1)*dy); draw b[i]; label(lua(mp.quoted(document.variables.labels[ decimal i ])), center b[i]); endfor \stopMPpage \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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 / 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 ___ -- Atentamente DesdeChaves ___ 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 ___
Re: [NTG-context] Pass a lua table to metapost
I use the last context minimals. In my system a have a new luatex binary (v. 0.78.2) but I don't know how install it in minimals. If i just copy/paste the new binary to the folder .../tex/texmf-osx-64/bin I found a eeror message This went wrong: .../Context/tex/texmf-context/tex/context/base/spac-ver.lua:933: attempt to index field 'properties' (a nil value) Why context minimals don't coming with the last luatex? Thanks for your support 2014-12-08 12:19 GMT+00:00 Hans Hagen pra...@wxs.nl: On 12/8/2014 12:27 PM, DesdeChaves wrote: Thanks, but I'm not able to run this code in my system.. I'm working in ConTeXt ver: 2014.12.06 14:20 MKIV beta fmt: 2014.12.8 int: english/english and the error message is: runscript ! Isolated expression. so your luatex is too old - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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 / 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 ___ -- Atentamente DesdeChaves ___ 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 ___
Re: [NTG-context] Pass a lua table to metapost
Sorry for the noise. My LuaTeX version is 0.79.1. I'm using MacOSX This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 4972) 2014-12-08 15:48 GMT+00:00 Mojca Miklavec mojca.miklavec.li...@gmail.com: On Mon, Dec 8, 2014 at 4:34 PM, DesdeChaves wrote: I use the last context minimals. In my system a have a new luatex binary (v. 0.78.2) but I don't know how install it in minimals. If i just copy/paste the new binary to the folder .../tex/texmf-osx-64/bin I found a eeror message This went wrong: .../Context/tex/texmf-context/tex/context/base/spac-ver.lua:933: attempt to index field 'properties' (a nil value) Why context minimals don't coming with the last luatex? Hans, what version of LuaTeX is needed? Jorge, which version of luatex do you have in minimals / what OS are you using? It's not 100% clear to me whether you have 0.78.2 in minimals or somewhere else. If 0.78.2 comes from minimals, you must be using PowerPC or armel and we need to ask the maintainer of these binaries for a rebuild. If LuaTeX 0.79.2 is needed, we just need to send an email to everyone (or rather: we should do that anyway). Maybe I just forgot to send a notice to the builders to make new builds when LuaTeX 0.79.2 came out. Mojca ___ 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 ___ -- Atentamente DesdeChaves ___ 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 ___
Re: [NTG-context] Pass a lua table to metapost
MacOSX intel 2014-12-08 16:03 GMT+00:00 DesdeChaves desdecha...@gmail.com: Sorry for the noise. My LuaTeX version is 0.79.1. I'm using MacOSX This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 4972) 2014-12-08 15:48 GMT+00:00 Mojca Miklavec mojca.miklavec.li...@gmail.com : On Mon, Dec 8, 2014 at 4:34 PM, DesdeChaves wrote: I use the last context minimals. In my system a have a new luatex binary (v. 0.78.2) but I don't know how install it in minimals. If i just copy/paste the new binary to the folder .../tex/texmf-osx-64/bin I found a eeror message This went wrong: .../Context/tex/texmf-context/tex/context/base/spac-ver.lua:933: attempt to index field 'properties' (a nil value) Why context minimals don't coming with the last luatex? Hans, what version of LuaTeX is needed? Jorge, which version of luatex do you have in minimals / what OS are you using? It's not 100% clear to me whether you have 0.78.2 in minimals or somewhere else. If 0.78.2 comes from minimals, you must be using PowerPC or armel and we need to ask the maintainer of these binaries for a rebuild. If LuaTeX 0.79.2 is needed, we just need to send an email to everyone (or rather: we should do that anyway). Maybe I just forgot to send a notice to the builders to make new builds when LuaTeX 0.79.2 came out. Mojca ___ 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 ___ -- Atentamente DesdeChaves -- Atentamente DesdeChaves ___ 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 ___
Re: [NTG-context] Pass a lua table to metapost
After the update to new ConTeXT minimals -- luatex beta-0.79.2 (rev 5084) -- the code runs perfectly. Thanks to all. Jorge 2014-12-08 16:05 GMT+00:00 DesdeChaves desdecha...@gmail.com: MacOSX intel 2014-12-08 16:03 GMT+00:00 DesdeChaves desdecha...@gmail.com: Sorry for the noise. My LuaTeX version is 0.79.1. I'm using MacOSX This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 4972) 2014-12-08 15:48 GMT+00:00 Mojca Miklavec mojca.miklavec.li...@gmail.com : On Mon, Dec 8, 2014 at 4:34 PM, DesdeChaves wrote: I use the last context minimals. In my system a have a new luatex binary (v. 0.78.2) but I don't know how install it in minimals. If i just copy/paste the new binary to the folder .../tex/texmf-osx-64/bin I found a eeror message This went wrong: .../Context/tex/texmf-context/tex/context/base/spac-ver.lua:933: attempt to index field 'properties' (a nil value) Why context minimals don't coming with the last luatex? Hans, what version of LuaTeX is needed? Jorge, which version of luatex do you have in minimals / what OS are you using? It's not 100% clear to me whether you have 0.78.2 in minimals or somewhere else. If 0.78.2 comes from minimals, you must be using PowerPC or armel and we need to ask the maintainer of these binaries for a rebuild. If LuaTeX 0.79.2 is needed, we just need to send an email to everyone (or rather: we should do that anyway). Maybe I just forgot to send a notice to the builders to make new builds when LuaTeX 0.79.2 came out. Mojca ___ 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 ___ -- Atentamente DesdeChaves -- Atentamente DesdeChaves -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] Pass a lua table to metapost
I would like to pass the lua table keys and values to metapost. In the keys i have information about the paths names and in the values i have information about the label that should be draw in the center of each path (unitsquare). In my code (see attach) the table in question is weekdays_number_and_name. I know that is possible to pass a array from metapost to lua. Is the reverse possible? thanks in advance Jorge calendario3.tex Description: TeX document ___ 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 ___
[NTG-context] Tikz calendar translation
Dear Sirs I need to represent a calendar in Portuguese language. You want to use the Tikz calendar package, but the result is unsatisfactory (please see attach). The problem is in the translation of the names of months and days of the week. How can I fix this problem? Thanks in advance. Jorge test code \usemodule[tikz] \usetikzlibrary[calendar] \language[pt] \starttext \tikz \calendar [dates=2014-09-01 to 2015-04-31, month list,month label left,month yshift=1.25em] if (Sunday) [black!50] % GROUP 1 if (between=2012-08-09 and 2012-08-12)[orange] if (between=2012-06-01 and 2012-06-03)[orange] if (between=2012-04-05 and 2012-04-07)[orange] if (between=2012-12-22 and 2012-12-27)[orange] % GROUP 2 if (between=2012-09-10 and 2012-09-15)[blue] if (between=2012-08-17 and 2012-08-21)[blue] if (between=2012-06-29 and 2012-07-02)[blue] if (between=2012-05-14 and 2012-05-21)[blue] % GROUP 3 if (between=2012-11-02 and 2012-11-09)[darkgreen] if (between=2012-01-01 and 2012-01-27)[darkgreen] ; \stoptext calendartest.pdf Description: Adobe PDF document ___ 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 ___
[NTG-context] framed and placefigure
why this happens: After a specification of the foregroundcolor the figures are behind a framed color. \setupframed[offset=2mm, corner=round, background=color, backgroundcolor=blue, foregroundcolor=yellow, frame=off, strut=no, align=normal, location=top, width=\textwidth] For example, is this case my \placefigure[right,nonumber,2*hang] {}{\externalfigure[ostrichhead][width=5cm]} is behind a yellow framed rectangle. Jorge ___ 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 ___
[NTG-context] first xcell dimension to large in xtable with external figure.
Dear Sirs, I would like to write a tecnhical document that looks like the DIN standards style. I found in this Wolfgang's message ( http://www.ntg.nl/pipermail/ntg-context/2013/076348.html) inspiration for do that. All works great if the sentence \externalfigure[cow.pdf][height=3cm] are commented, otherwise the cell Doc No. is to large relatively the other cells in the last column. What is wrong with this code? thanks in advance. Jorge \setuplayout [backspace=15mm, width=middle, topspace=15mm, height=middle, header=5cm, footer=0pt] \startsetups[header:table] \startembeddedxtable[align={middle,lohi},strut=no] \startxrow \startxcell[width=0.20\paperwidth,ny=4] \externalfigure[cow.pdf][height=3cm] \stopxcell \startxcell[width=0.40\paperwidth,ny=4] Document title \stopxcell \startxcellgroup[height=1cm,foregroundstyle=small] \startxcell[width=0.10\paperwidth,align={flushright,lohi}] Doc No. \stopxcell \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] \unknown \stopxcell \stopxcellgroup \stopxrow \startxrow \startxcellgroup[height=1cm, foregroundstyle=small] \startxcell[width=0.10\paperwidth,align={flushright,lohi}] Revision \stopxcell \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] \unknown \stopxcell \stopxcellgroup \stopxrow \startxrow \startxcellgroup[height=1cm, foregroundstyle=small] \startxcell[width=0.10\paperwidth,align={flushright,lohi}] Data \stopxcell \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] \unknown \stopxcell \stopxcellgroup \stopxrow \startxrow \startxcellgroup[height=1cm,foregroundstyle=small] \startxcell[width=0.10\paperwidth,align={flushright,lohi}] Pagina \stopxcell \startxcell[width=0.15\paperwidth,align={flushleft,lohi}] \pagenumber/\lastpagenumber \stopxcell \stopxcellgroup \stopxrow \stopembeddedxtable \stopsetups \setupheadertexts[\texsetup{header:table}] \starttext \dorecurse{30}{\input knuth\par} \stoptext ___ 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 ___
[NTG-context] Draw eletrical circuits in ConTeXt (Circuitikz or mpcirc.mp)
Dear Sirs I need to draw some simple eletrical circuits. I try metapost (mpcirc.mp) and cicruitikz, but i found error messages in both. Is there a way to draw eletrical circuits in ConTeXt? Thanks in advance for your support. Jorge ConTeXt ver: 2014.02.14 17:07 MKIV beta fmt: 2014.2.15 int: english/english # with mpcirc.mp ## With this code: \startMPinclusions input mpcirc; \stopMPinclusions \starttext %\forceMPTEXgraphictrue %%% command don't work \startMPcode u:=10bp; % unit of length prepare(L,C,Vac); % mention your elements z0=(10u,10u); % lower right node ht:=6u; % height of circuit z1=z0+(0,ht); % upper right node C=.5[z0,z1]; % location of capacitor L.t=T.r; % use default orientation C.t=Vac.t=T.u; % components rotated 90 degrees % set the distance between Voltage and Capacitor equally_spaced(5u,0) Vac, C; L=z1-0.5(C-Vac); % location of spool edraw; % draw components of the circuit % draw wires connecting components % the first ones rotated 90 degrees wire.v(Vac.a,z0); wire.v(Vac.b,L.a); wire.v(L.b,z1); wire(C.a,z0); wire(C.b,z1); \stopMPcode \stoptext I found this error message: metapost error: (mpcirc.mp (ttex.mp) (circlib.mp circlib.mp circlib.mpx ! ! Unable to make mpx file. l.39 def Eplus_ = btex $+$etex enddef; With Circuitikz ### If i try use Circuitikz with this test code: \usemodule[circuitikz] \starttext A simple example to test the installation. \startcircuitikz[scale=1.2] \draw (0,2) to[I=1\milli\ampere] (2,2) to[R, l_=2\kilo\ohm, *-*] (0,0) to[R, l_=2\kilo\ohm] (2,0) to[V, v_=2\volt] (2,2) to[cspst, l=$t_0$] (4,2) -- (4,1.5) to [generic, i=$i_1$, v=$v_1$] (4,-.5) -- (4,-1.5) (0,2) -- (0,-1.5) to[V, v_=4\volt] (2,-1.5) to [R, l=1\kilo\ohm] (4,-1.5); \stopcircuitikz \stoptext The error message is: (/Applications/Context/tex/texmf-modules/tex/generic/circuitikz/pgfcircquadpoles.sty) (/Applications/Context/tex/texmf-modules/tex/generic/circuitikz/pgfcirclabel.sty) (/Applications/Context/tex/texmf-modules/tex/generic/circuitikz/pgfcircvoltage.sty) (/Applications/Context/tex/texmf-modules/tex/generic/circuitikz/pgfcirccurrent.sty)) ! Missing \endcsname inserted. system tex error on line 16 in file /Applications/Context/tex/texmf-modules/tex/generic/circuitikz/t-circuitikz.tex: Missing \endcsname inserted ... 6 \usepgflibrary[decorations.pathmorphing] 7 \usetikzlibrary[calc] 8 9 \unprotect 10 11 \input circuitikz.code.tex 12 13 % defaults 14 15 \setupmodule[current=european, voltage=european, resistor=american, inductor=cute, logic=american, siunitx=true, arrowmos=false] 16 17 \processaction[\currentmoduleparameter{voltage}] 18[european=\ctikzset{voltage=european}, 19 american=\ctikzset{voltage=american} 20] # ___ 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 ___
Re: [NTG-context] Pgfplots - passing point coordinates by Lua
,color=red] coordinates {\ctxlua{plot(data)}}; % THIS PLOT HAS NO POINT (?!) \stopaxis \stoptikzpicture \stoptext gives error: ... fonts fallback modern rm 12pt is loaded Crds= (5,15)(20,20)(24,-24) Package pgfplots: Error! Sorry, I could not read the plot coordinates near '(5,15)(20,20)(24,-24)'. Please check for format mistakes. ! Package pgfplots Warning: the current plot has no coordinates (or all have been filtered away)... Any idea from someone more familiar with pgfplots would be appreciated. TIA. Best regards, Lukas ___ 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 ___ ___ 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 ___ -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] Strange output from linear_shade (METAPOST)
I need to create some graphics to teach energy. One of the illustrations is about the sound energy that I represent using linear_shade function. In the following example the first illustration is represented correctly, but the second call of the function SoundEnergy implies the loss of gradient. What am I doing wrong? Thanks in advance Jorge \startMPinclusions def SoundEnergy = path pr ; pr := unitsquare xscaled .3cm yscaled 2cm ; currentpicture:=nullpicture; for i=0 step 2 until 10: linear_shade(pr shifted (i*.3cm,0),0,white,black); linear_shade(pr shifted ((i+1)*.3cm,0),0,black,white); endfor; clip currentpicture to (0,0)--(0,2cm)--(2cm,2cm)--(3cm,1cm)--(2cm,0)--cycle; draw (0,0)--(0,2cm)--(2cm,2cm)--(3cm,1cm)--(2cm,0)--cycle withcolor .625red; addto finalpicture also currentpicture shifted(avanco*3.5cm,0) ; currentpicture := nullpicture ; avanco := avanco+1 ; enddef; \stopMPinclusions \starttext \startMPcode picture finalpicture ; finalpicture := nullpicture ; numeric avanco ; avanco := 0 ; bboxmargin := 0pt ; %% first call is OK SoundEnergy; %% second call loss the gradient SoundEnergy; currentpicture := finalpicture ; \stopMPcode \stoptext ___ 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 ___
[NTG-context] draw random branched hydrocarbons
I wrote this code to randomly draw organic branched structures. Since the organic structures have different dimensions I'm using the scale function to normalize the width. The result is a rather ugly because the structures are displayed with fonts with different sizes. Is there a way to normalize the structures width only when it exceeds a certain size? Thanks a lot Jorge \usemodule[chemie] \usemodule[fullpage][style={margin,empty},margin=15mm] \starttext \startluacode context.bTABLE() beginchemical={\\scale[width=.40\\textwidth]{\\startchemical[height=fit,width=fit,frame=off] endchemical=\\stopchemical}} firstC=\\chemical[ONE, Z0, SAVE][H_3C] -- go and branch below skeletonforBELOW={\\chemical[RESTORE,MOV1,Z0,SB153,SAVE][CH], \\chemical[RESTORE,MOV1,Z0,SB5][CH_2]\\chemical[MOV1,Z0,SB153,SAVE][CH]} -- \\chemical[RESTORE,MOV1,Z0][CH_2]\\chemical[MOV1,Z0,SB5][CH_2]\\chemical[MOV1,Z0,SB153,SAVE][CH]} -- go and branch above skeletonforABOVE={\\chemical[RESTORE,MOV1,Z0,SB517,SAVE][CH], \\chemical[RESTORE,MOV1,Z0,SB5][CH_2]\\chemical[MOV1,Z0,SB517,SAVE][CH]} -- go and not branch skeletonnobranched={\\chemical[RESTORE,MOV1,Z0,SB5,SAVE][CH_2], \\chemical[RESTORE, MOV1,Z0,SB5][CH_2]\\chemical[MOV1,Z0,SB5,SAVE][CH_2]} -- last C: two ways lastC={\\chemical[RESTORE,MOV1, Z0, SB5][CH_3], \\chemical[RESTORE,MOV1,Z0,SB5][CH_2]\\chemical[MOV1, Z0, SB5][CH_3]} -- branch below branchedBELOW={\\chemical[MOV3, Z0, SB7][CH_3], \\chemical[MOV3,Z0,SB7][CH_2]\\chemical[MOV3,Z0,SB7][CH_3], \\chemical[MOV3,Z0,SB7][CH_2]\\chemical[MOV3,Z0,SB7][CH_2]\\chemical[MOV3,Z0,SB7][CH_3], \\chemical[MOV3,Z0][Cl], \\chemical[MOV3,Z0][F],\\chemical[MOV3,Z0][I]} -- branch above branchedABOVE={\\chemical[MOV7, Z0, SB3][CH_3], \\chemical[MOV7,Z0,SB3][CH_2]\\chemical[MOV7,Z0,SB3][CH_3], \\chemical[MOV7, Z0,SB3][CH_2]\\chemical[MOV7,Z0,SB3][CH_2]\\chemical[MOV7,Z0,SB3][CH_3], \\chemical[MOV7,Z0][Cl], \\chemical[MOV7,Z0][F],\\chemical[MOV7,Z0][I]} -- rows for j=1,5 do context.bTR() -- columns for i=1,2 do context.bTD() -- begin chemical context(beginchemical) -- draw the first CH3 context(firstC) -- define the maximum for branches for k=1,3 do -- linear or branched branched=math.random(1,100)30 if branched then -- below or above branchedBA=math.random(1,100)30 if branchedBA then branch=branchedBELOW[math.random(1,6)]; skeleton=skeletonforBELOW[math.random(1,2)] else branch=branchedABOVE[math.random(1,6)]; skeleton=skeletonforABOVE[math.random(1,2)] end context(skeleton) context(branch) else -- no branch context(skeletonnobranched[math.random(1,2)]) end end -- draw the last CH3 last=lastC[math.random(1,2)] context(last) -- end chemical context(endchemical) context.eTD() end context.eTR() end context.eTABLE() \stopluacode \stoptext ___ 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 ___
[NTG-context] (no subject)
Some features of m-steps does not work in mkiv. For example, I can not change colors and the shapes (first example), add steps from the cell (n) to the cell (n+m, m=2,3,4...) and reverse steps. \usemodule[steps,mathml] \starttext \startSTEPtable \setupSTEPcells [alternative=5, framecolor=red] \setupSTEPtexts [framecolor=green] \setupSTEPlines [alternative=5] \cell {initial concentration, $C_i$} \text {$\div C_f$, final concentration} \cell {diluation factor, $f$} \text {inverse} \cell {$\frac{1}{f}$} \text {$\times V_f$, volume of the volumetric flask} \cell {pipette volume, $V_p$} \stopSTEPtable From the manual: \startSTEPchart \cell {A} \cell {one} \texts{}{+2} \texts{}{+3} \cell {two} \cell {three} \texts{+4}{} \texts{+5}{} \cell {four} \cell {five} \stopSTEPchart \stoptext Jorge ___ 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 ___
[NTG-context] m-steps on mkiv
Some features of m-steps does not work in mkiv. For example, I can not change colors and the shapes (first example), add steps from the cell (n) to the cell (n+m, m=2,3,4...) and reverse steps. \usemodule[steps,mathml] \starttext \startSTEPtable \setupSTEPcells [alternative=5, framecolor=red] \setupSTEPtexts [framecolor=green] \setupSTEPlines [alternative=5] \cell {initial concentration, $C_i$} \text {$\div C_f$, final concentration} \cell {diluation factor, $f$} \text {inverse} \cell {$\frac{1}{f}$} \text {$\times V_f$, volume of the volumetric flask} \cell {pipette volume, $V_p$} \stopSTEPtable From the manual: \startSTEPchart \cell {A} \cell {one} \texts{}{+2} \texts{}{+3} \cell {two} \cell {three} \texts{+4}{} \texts{+5}{} \cell {four} \cell {five} \stopSTEPchart \stoptext Jorge ___ 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 ___
[NTG-context] align text in nodes (tikz)
How i can fix that: This works: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm}] \node[mynode] (A) at (5cm, 8cm) {This\\ works}; \stoptikzpicture This don´t works: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm, align=center}] \node[mynode] (A) at (5cm, 8cm) {Align\\ (don´t work)}; \stoptikzpicture ConTeXt ver: 2013.12.22 19:05 MKIV beta fmt: 2013.12.23 int: english/english Jorge ___ 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 ___
Re: [NTG-context] align text in nodes (tikz)
I found this solution: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm}] \node[mynode] (A) at (5cm, 8cm) {\framed[width=4cm,location=middle,align=center]{it's\\ (framed )}}; \stoptikzpicture Jorge 2014/1/20 DesdeChaves desdecha...@gmail.com How i can fix that: This works: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm}] \node[mynode] (A) at (5cm, 8cm) {This\\ works}; \stoptikzpicture This don´t works: \starttikzpicture[mynode/.style={rectangle,fill=red!10,text width=4cm, align=center}] \node[mynode] (A) at (5cm, 8cm) {Align\\ (don´t work)}; \stoptikzpicture ConTeXt ver: 2013.12.22 19:05 MKIV beta fmt: 2013.12.23 int: english/english Jorge -- Atentamente DesdeChaves ___ 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 ___
Re: [NTG-context] reset blocks with dorecurse
Please, can someone provide some assistance in resolving this problem, if possible. I need to prepare a worksheet for Friday and I'm having this problem, ie, each worksheet show the hints and the answers of all worksheets. thanks in advance Jorge 2014/1/14 DesdeChaves desdecha...@gmail.com Is there a way to empty the blocks after each recurse cycle. If i make three exams with the command \dorecurse[3], in the first exam i found the hints and the answers of all exams. I try with the commands \resetnumber[hint, answer], but don't work. begin question-hint-answer-blocks.tex \defineblock[question] \defineblock[hint] \defineblock[answer] \defineenumeration[question] [alternative=hanging, width=2.5cm, text={Question}, headstyle={\bi}, stopper={.}] \defineenumeration[hint] [alternative=hanging, width=4cm, text={Hint for question}, headstyle={\bi}, stopper={.}] \defineenumeration[answer] [alternative=hanging,width=4.5cm, text={Answer to question}, headstyle={\bi}, stopper={.}] \setupblock[question][before={\startquestion},after={\stopquestion}] \setupblock[hint][before={\starthint},after={\stophint}] \setupblock[answer][before={\startanswer},after={\stopanswer}] \keepblocks[question] \hideblocks[hint] \hideblocks[answer] \startsetups examn:make \resetnumber[answer] \resetnumber[question] \resetnumber[hint] \page \setcounter[userpage][1] \centerline{\kap{Maths}} \centerline{\kap{Worksheet}} \crlf Name:\thinrules[n=1]%, interlinespace=big] Evaluation:\thinrules[n=1]%, interlinespace=big] \getbuffer[examn] \stopsetups \starttext \setuppagenumbering[state=stop] \startbuffer[examn] \section{Questions} \beginquestion Compute $4\times 5$. \endquestion \beginhint Use the fact that $2\times 5 = 10$. \endhint \beginanswer $20$. \endanswer \beginquestion What is the value of $100 / 10$? \endquestion \beginhint Remember that $10\times 10 = 100$. \endhint \beginanswer $10$ \endanswer \section{Hints to all questions} \useblocks[hint] \section{Answers to all questions} \useblocks[answer] \setuppagenumber[number=1] \stopbuffer \setuprandomize[124] % set a seed \dorecurse{3} {\setups[examn:make]} \stoptext Thanks a lot Jorge -- Atentamente DesdeChaves ___ 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 ___
Re: [NTG-context] reset blocks with dorecurse
Thank you. Jorge 2014/1/15 Wolfgang Schuster schuster.wolfg...@gmail.com Am 15.01.2014 um 15:06 schrieb DesdeChaves desdecha...@gmail.com: Please, can someone provide some assistance in resolving this problem, if possible. I need to prepare a worksheet for Friday and I'm having this problem, ie, each worksheet show the hints and the answers of all worksheets. There is no command to reset a block, to create the different worksheets you have to process your document three times (don’t forget to delete the temporary files because the randomseed won’t change otherwise). Wolfgang ___ 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 ___ -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] reset blocks with dorecurse
Is there a way to empty the blocks after each recurse cycle. If i make three exams with the command \dorecurse[3], in the first exam i found the hints and the answers of all exams. I try with the commands \resetnumber[hint, answer], but don't work. begin question-hint-answer-blocks.tex \defineblock[question] \defineblock[hint] \defineblock[answer] \defineenumeration[question] [alternative=hanging, width=2.5cm, text={Question}, headstyle={\bi}, stopper={.}] \defineenumeration[hint] [alternative=hanging, width=4cm, text={Hint for question}, headstyle={\bi}, stopper={.}] \defineenumeration[answer] [alternative=hanging,width=4.5cm, text={Answer to question}, headstyle={\bi}, stopper={.}] \setupblock[question][before={\startquestion},after={\stopquestion}] \setupblock[hint][before={\starthint},after={\stophint}] \setupblock[answer][before={\startanswer},after={\stopanswer}] \keepblocks[question] \hideblocks[hint] \hideblocks[answer] \startsetups examn:make \resetnumber[answer] \resetnumber[question] \resetnumber[hint] \page \setcounter[userpage][1] \centerline{\kap{Maths}} \centerline{\kap{Worksheet}} \crlf Name:\thinrules[n=1]%, interlinespace=big] Evaluation:\thinrules[n=1]%, interlinespace=big] \getbuffer[examn] \stopsetups \starttext \setuppagenumbering[state=stop] \startbuffer[examn] \section{Questions} \beginquestion Compute $4\times 5$. \endquestion \beginhint Use the fact that $2\times 5 = 10$. \endhint \beginanswer $20$. \endanswer \beginquestion What is the value of $100 / 10$? \endquestion \beginhint Remember that $10\times 10 = 100$. \endhint \beginanswer $10$ \endanswer \section{Hints to all questions} \useblocks[hint] \section{Answers to all questions} \useblocks[answer] \setuppagenumber[number=1] \stopbuffer \setuprandomize[124] % set a seed \dorecurse{3} {\setups[examn:make]} \stoptext Thanks a lot Jorge ___ 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 ___
Re: [NTG-context] Statistical module for Metapost
Thanks a lot. Merry Christmas Jorge 2013/12/24 Hans Hagen pra...@wxs.nl On 12/23/2013 7:55 PM, DesdeChaves wrote: I'm trying play with the statistical package** for metapost from Anthony Phan. I found this strange problem: This code runs fine: \startMPcode label.bot(btex Metapost and Statistics etex,(5mm,0)) ; \stopMPcode Also, this code run fine: \startMPcode input mps-core.mp; draw fullcircle scaled 1cm ; \stopMPcode But this don't run!! \startMPcode input mps-core.mp label.bot(btex Metapost and Statistics etex,(5mm,0)) ; \stopMPcode You're missing a ; on the input line so it could be some read-ahead issue. What can coming from the module mps-core.mp that interfere with Metapost labels? If it's a big subsystem there might be conflicts; anyway, better load like this: \startMPinclusions input mps-core.mp ; \stopMPinclusions \startMPcode label.bot(btex Metapost and Statistics etex,(5mm,0)) ; \stopMPcode because you only want to load once Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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 / 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 ___ -- Atentamente DesdeChaves ___ 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 ___
Re: [NTG-context] Request for metapost
Thanks very much for your support. Jorge 2013/12/22 Hans Hagen pra...@wxs.nl On 12/22/2013 3:57 PM, Hans Hagen wrote: On 12/21/2013 12:50 PM, DesdeChaves wrote: I know that metapost can send the variables version, number, string, point, quad, boolean and path to Context. triplet variable can't pass. It will be very usefull if metapost can send a array to context. \startMPcode numeric x[]; for i = 1 upto 10: x[i]:=random; endfor passvariable(array,x); passvariable(version,1.0) ; passvariable(number,x[1]) ; passvariable(string,whatever) ; passvariable(point,(1,2)) ; passvariable(triplet,(1,2,3)) ; passvariable(quad,(1,2,3,4)) ; passvariable(boolean,false) ; passvariable(path,fullcircle scaled 1cm) ; \stopMPcode \ctxluacode{inspect(metapost.variables)} \ctxcommand{mprunvar(array)} Thanks in advance that's less trivial (as automatism) so i provide passarrayvariable now (next beta) ... of course the next request would concern complex arrays so i also made a more low level flusher \starttext \startMPcode numeric n[] ; for i=1 upto 10: n[i] := i + 1 ; endfor ; pathp[] ; for i=1 upto 10: p[i] := fullcircle scaled (i*cm) ; endfor ; numeric n[][] ; for i=1,4 : for j=1,3 : n[i][j] = uniformdeviate(1) ; endfor ; endfor ; passvariable(x,12345) ; passarrayvariable(n-array,n,1,7,1) ; passarrayvariable(p-array,p,1,7,1) ; passvariable(p,(1,1) .. (2,2)) ; % watch out: no ; in between startpassingvariable(b) startarray for i=1,4 : startarray for j=1,3 : value(n[i][j]) endfor stoparray endfor stoparray stoppassingvariable ; startpassingvariable(a) starthash key(test1) startarray value(123) value(456) stoparray key(test2) starthash key(test) value(789) stophash stophash stoppassingvariable ; draw fullcircle scaled 1cm ; \stopMPcode \ctxluacode{inspect(metapost.variables)} \ctxcommand{mprunvar(x)} \stoptext \starttext % \enabletrackers[metapost.variables] \startMPcode numeric n[] ; for i=1 upto 10: n[i] := 1/i ; endfor ; pathp[] ; for i=1 upto 10: p[i] := fullcircle xyscaled (cm*i,cm/i) ; endfor ; numeric r[][] ; for i=1 upto 4 : for j=1 upto 3 : r[i][j] := uniformdeviate(1) ; endfor ; endfor ; pairu[][] ; for i=1 step 0.5 until 4 : for j=1 step 0.1 until 2 : u[i][j] := (i,j) ; endfor ; endfor ; passvariable(x,12345) ; passarrayvariable(n-array,n,1,7,1) ; passarrayvariable(p-array,p,1,7,1) ; passvariable(p,(1,1) .. (2,2)) ; startpassingvariable(b) startarray for i=1 upto 4 : startarray for j=1 upto 3 : value(r[i][j]) endfor stoparray endfor stoparray stoppassingvariable ; startpassingvariable(a) starthash key(test 1) startarray value(123) value(456) stoparray key(test 2) startarray index(0) value(123) value(456) value(789) slot(999,987) stoparray key(test 3) starthash key(first) value(789) entry(second,987) stophash stophash stoppassingvariable ; startpassingvariable(c) startarray for i=1 step 0.5 until 4 : index(i) startarray for j=1 step 0.1 until 2 : slot(j,u[i][j]) endfor stoparray endfor stoparray stoppassingvariable ; draw fullcircle scaled 1cm ; \stopMPcode \ctxluacode{inspect(metapost.variables)} \ctxcommand{mprunvar(x)} \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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
[NTG-context] Statistical module for Metapost
I'm trying play with the statistical package** for metapost from Anthony Phan. I found this strange problem: This code runs fine: \startMPcode label.bot(btex Metapost and Statistics etex,(5mm,0)) ; \stopMPcode Also, this code run fine: \startMPcode input mps-core.mp; draw fullcircle scaled 1cm ; \stopMPcode But this don't run!! \startMPcode input mps-core.mp label.bot(btex Metapost and Statistics etex,(5mm,0)) ; \stopMPcode What can coming from the module mps-core.mp that interfere with Metapost labels? Thanks in advance Jorge **(www-math.univ-poitiers.fr/~*phan*/downloads/metapost/) . ___ 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 ___
[NTG-context] Request for metapost
I know that metapost can send the variables version, number, string, point, quad, boolean and path to Context. triplet variable can't pass. It will be very usefull if metapost can send a array to context. \startMPcode numeric x[]; for i = 1 upto 10: x[i]:=random; endfor passvariable(array,x); passvariable(version,1.0) ; passvariable(number,x[1]) ; passvariable(string,whatever) ; passvariable(point,(1,2)) ; passvariable(triplet,(1,2,3)) ; passvariable(quad,(1,2,3,4)) ; passvariable(boolean,false) ; passvariable(path,fullcircle scaled 1cm) ; \stopMPcode \ctxluacode{inspect(metapost.variables)} \ctxcommand{mprunvar(array)} Thanks in advance Jorge ___ 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 ___
[NTG-context] luatex lunatic
Dear sirs I would like to try luatex lunatic ( http://wiki.contextgarden.net/User:Luigi.scarso/luatex_lunatic) but i d'ont find the luatex-0.42. I'm looking in https://foundry.supelec.fr/frs/?group_id=10release_id=406#luatex-beta-0.76.0-title-content I've been looking for a way to simulate data with different distributions (normal, poisson, exponential, etc.) in the .tex file. The use of GSL library is a good option, but it seems impossible to import in luatex. Another way is using the R-statistical through filter module***, which seems to work well in luatex. At this time I would try to import the GSL functions through python script. For that i think that i need the older luatex 0.42 but I don't find that. *** \defineexternalfilter [R] [ filtercommand={R CMD BATCH -q --save --restore \externalfilterinputfile\space \externalfilteroutputfile}, output=\externalfilterbasefile.out, directory=output, readcommand=\typefile, read=no, cache=yes, ] Jorge ___ 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 ___
[NTG-context] gsl in luatex
Dear Sirs Is there a way to call external lua modules inside luatex. In particular I would like to call gsl libray using a gsl-lua binding ( http://www.stefanom.org/devel/gsl-lua)/. I'm not talking about gsl-shell that needs luajit. I'm working in MacOSX with minimals. My LUAINPUTS are: LUAINPUTS = .;$TEXINPUTS;$TEXMF/scripts/context/lua//;/usr/local/lib/lua/5.2//, CLUAINPUTS = .;$SELFAUTOLOC/lib/{context,luatex,}/lua//;/usr/local/lib/lua/5.2//, ls /usr/local/lib/lua/5.2 GSLdefs2.lua alien_c.la alien_c.so gsl.lua The GSL library is called using the Alien. If i try: \starttext \enabletrackers[resolvers.libraries] \startluacode print(LUAINPUTS,os.getenv(LUAINPUTS)) require(alien) ; \stopluacode \stoptext [...] resolverslibraries registered lua format path 32: /Applications/Context/tex/texmf-osx-64/scripts/context/lua/ resolverslibraries registered lua format path 33: /Applications/Context/tex/texmf/scripts/context/lua/ resolverslibraries registered lua format path 34: /usr/local/lib/lua/5.2 resolverslibraries lua format, checking 34 paths resolverslibraries lua format, identifying 'alien.lua' using format 'tex' resolverslibraries lua format, identifying 'alien.lua' using format 'lua' resolverslibraries locating, level '1', method 'lib variable format', name 'alien' resolverslibraries registered lib format path 1: . resolverslibraries registered lib format path 2: /Applications/Context/tex/texmf-osx-64/bin/lib/context/lua/ resolverslibraries registered lib format path 3: /Applications/Context/tex/texmf-osx-64/bin/lib/luatex/lua/ resolverslibraries registered lib format path 4: /Applications/Context/tex/texmf-osx-64/bin/lib/lua/ resolverslibraries registered lib format path 5: /usr/local/lib/lua/5.2 resolverslibraries lib format, checking 5 paths resolverslibraries lib format, identifying 'alien.so' using format 'lib' resolverslibraries locating, level '1', method 'lua extra list', name 'alien' resolverslibraries no extra lua paths defined resolverslibraries locating, level '1', method 'lib extra list', name 'alien' resolverslibraries no extra lib paths defined resolverslibraries locating, level '1', method 'path specification', name 'alien' resolverslibraries using builtin lua path 1: /usr/local/share/lua/5.2/?.lua resolverslibraries using builtin lua path 2: /usr/local/share/lua/5.2/?/init.lua resolverslibraries using builtin lua path 3: /usr/local/lib/lua/5.2/?.lua resolverslibraries using builtin lua path 4: /usr/local/lib/lua/5.2/?/init.lua resolverslibraries using builtin lua path 5: ./?.lua resolverslibraries found, level '1', method 'path specification', name 'alien' resolverslibraries locating, level '1', method 'already loaded', name 'alien_c' resolverslibraries locating, level '1', method 'preload table', name 'alien_c' resolverslibraries locating, level '1', method 'lua variable format', name 'alien_c' resolverslibraries lua format, checking 34 paths resolverslibraries lua format, identifying 'alien_c.lua' using format 'tex' resolverslibraries lua format, identifying 'alien_c.lua' using format 'lua' resolverslibraries locating, level '1', method 'lib variable format', name 'alien_c' resolverslibraries lib format, checking 5 paths resolverslibraries lib format, identifying 'alien_c.so' using format 'lib' resolverslibraries lib format, 'alien_c.so' found on '/usr/local/lib/lua/5.2/alien_c.so' resolverslibraries calling loadlib with '/usr/local/lib/lua/5.2/alien_c.so' with init 'luaopen_alien_c' resolverslibraries locating, level '1', method 'lua extra list', name 'alien_c' resolverslibraries locating, level '1', method 'lib extra list', name 'alien_c' resolverslibraries locating, level '1', method 'path specification', name 'alien_c' resolverslibraries locating, level '1', method 'cpath specification', name 'alien_c' resolverslibraries using builtin lib path 1: /usr/local/lib/lua/5.2/?.so resolverslibraries using builtin lib path 2: /usr/local/lib/lua/5.2/loadall.so resolverslibraries using builtin lib path 3: ./?.so ! LuaTeX error error loading module 'alien_c' from file '/usr/local/lib/lua/5.2/alien_c.so': dlopen(/usr/local/lib/lua/5.2/alien_c.so, 6): Symbol not found: _luaL_addlstring Referenced from: /usr/local/lib/lua/5.2/alien_c.so Expected in: flat namespace in /usr/local/lib/lua/5.2/alien_c.so stack traceback: [C]: in ? [C]: in function 'cpath specification' ...Context/tex/texmf-context/tex/context/base/l-package.lua:291: in function '?' ...Context/tex/texmf-context/tex/context/base/l-package.lua:318: in function
[NTG-context] ctxluacode inside bTABLE
I try make a table with some random numbers but I found a problem with this code: \starttext \ctxluacode{v=math.random(400,600)/10;context(%0.1f,v) ;} \bTABLE \bTR\bTD Distance (cm) \eTD\bTD $\Delta t$ (s) \eTD\eTR \bTR\bTD[nr=3] \ctxluacode{v=math.random(400,600)/10;context(%0.1f,v) ;} \eTD\bTD t1 \eTD\eTR \bTR\bTD t2 \eTD\eTR \bTR\bTD t3 \eTD\eTR \eTABLE \stoptext \ctxluacode{v=math.random(400,600)/10;context(%0.1f,v) ;} don't work inside the bTABLE environment. Thanks in advance. Jorge ___ 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 ___
Re: [NTG-context] ctxluacode inside bTABLE
Is there a way to pass arguments to getrandomnumber() function? \startluacode local mathrandom = math.random local context= context document.get_random_number = function (min,max,delta) context (%0.1f, mathrandom (min, max) / decimal) end \stopluacode \def \getrandomnumber#1#2#3 {\ctxluacode {document.get_random_number (#1,#2,#3)}} \starttext \bTABLE \bTR \bTD Distance (cm) \eTD \bTD $\Delta t$ (s) \eTD \eTR \bTR \bTD[nr=3] \getrandomnumber{34,56,10} \eTD \bTD t1 \eTD \eTR \bTR \bTD t2 \eTD \eTR \bTR \bTD t3 \eTD \eTR \eTABLE \stoptext 2013/11/27 Philipp Gesang philipp.ges...@alumni.uni-heidelberg.de Hi Jorge, ···date: 2013-11-27, Wednesday···from: DesdeChaves··· I try make a table with some random numbers but I found a problem with this code: \starttext \ctxluacode{v=math.random(400,600)/10;context(%0.1f,v) ;} \bTABLE \bTR\bTD Distance (cm) \eTD\bTD $\Delta t$ (s) \eTD\eTR \bTR\bTD[nr=3] \ctxluacode{v=math.random(400,600)/10;context(%0.1f,v) ;} \eTD\bTD t1 \eTD\eTR \bTR\bTD t2 \eTD\eTR \bTR\bTD t3 \eTD\eTR \eTABLE \stoptext \ctxluacode{v=math.random(400,600)/10;context(%0.1f,v) ;} don't work inside the bTABLE environment. just wrap the code in a macro. Lua code needs a different catcode regime and expansion rules that don’t cooperate well with the table scanner. E.g. \startluacode local mathrandom = math.random local context= context document.get_random_number = function () context (%0.1f, mathrandom (400, 600) / 10) end \stopluacode \def \getrandomnumber {\ctxluacode {document.get_random_number ()}} \starttext \bTABLE \bTR \bTD Distance (cm) \eTD \bTD $\Delta t$ (s) \eTD \eTR \bTR \bTD[nr=3] \getrandomnumber \eTD \bTD t1 \eTD \eTR \bTR \bTD t2 \eTD \eTR \bTR \bTD t3 \eTD \eTR \eTABLE \stoptext Hth, Philipp ___ 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 ___ -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] pstrics module again
Dear sirs The pstrics module don't work anymore. I tried to run this simple code but I found a lot of errors. \usemodule[pstric] \starttext \startPSTRICKS \pspicture(0,0)(20,20) \psline(0,0)(20,20) \psline(1,1)(10,10) \endpspicture \stopPSTRICKS \stoptext This module is no longer supported? There is still any hope of being able to use pstric and some of its extensions (pst-spectra, for example)? Thanks a lot Sorry for my persistence about pstrics module. Thanks a lot Jorge ___ 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 ___
Re: [NTG-context] pstrics module again
I d'ont know how to fix the picture size. No errors at all, but the figure size isn't correct. \usemodule[pstric] \starttext Hydrogen spectrum \startPSTRICKS \input pst-spectra.tex \input pstricks-add.tex \pspicture(0,-2.5)(\textwidth,1.6) \psspectrum[element=H, emission](0,0)(\textwidth,1.5) \rput(2,1){Hydrogen spetrum} \endpspicture \stopPSTRICKS \stoptext 2013/11/25 DesdeChaves desdecha...@gmail.com radical solution Download and unpack the PSTRicks-TDS.tar to a directory cp ./PSTricks-TDS/tex/generic/*/*.tex . perl -pi.back -e 's/\ifx!#1/\ifx !#1/g;' *.tex rm -rf *.back cp /usr/local/texlive/2013/texmf-dist/tex/context/base/colo-rgb.mkii ./colo-rgb.tex run context change in m-pstric.* files ps2pdf to pstopdf tanks a lot Jorge 2013/11/25 Herbert Voss herbert.v...@fu-berlin.de Am 25.11.2013 21:25, schrieb Aditya Mahajan: \unprotect \input pstricks \protect and therefore when ConTeXt sees \ifx!#1 it thinks that \ifx! is a csname. Adding a space after \ifx avoids that. As I said in my previous message, this is easy to fix at ConTeXt end defining an appropriate catcode regime before inputing pstricks. So, the pstricks package does not need to be changed, but the ConTeXt code that is calling the package needs to be adapted. ok, understood. thanks, Herbert ___ 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 ___ -- Atentamente DesdeChaves -- Atentamente DesdeChaves ___ 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 ___
[NTG-context] pst-spectra and some other pstricks packages in context
Dear Sirs Tanks a lot for the context software. I use it so much. I'm a physics/chemistry teacher and for making personalized exams with random numbers/questions the math.random() from lua is great. For draw schematic diagrams/graphs with random arguments I use tikz inside luacode, like context(\\addplot[blue, ultra thick] {..slope..*x-..workfunction..};). However, it would be useful to use some pstricks packages. For example, the package pst-spectra includes a set of spectrum of various chemical elements. It is unique. Currently, I run latex and then import the pdf file into context file. There are other old pstricks macros, but still very useful, that i like to use. It's old, but useful. In the pstricks home page (http://tug.org/PSTricks/main.cgi/) I can found some new work, with some new packages and macros. For now, if i try to run this simple code \usemodule[pstric] \starttext \startPSTRICKS \pspicture(0,0)(20,20) \psline(0,0)(20,20) \psline(1,1)(10,10) \endpspicture \stopPSTRICKS \stoptext I found this error message: [...] (/usr/local/texlive/2013/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex) `PSTricks' v2.43 2013/05/12 (tvz) (/usr/local/texlive/2013/texmf-dist/tex/generic/pstricks/pstricks.con)) (/usr/local/texlive/2013/texmf-dist/tex/generic/pst-plot/pst-plot.tex v1.45, 2013/04/29 (tvz,hv) ! Undefined control sequence. \special@length ...ecial@length]{ #1|#2|#3 }\ifx! #1\relax \edef \pst@Specia... \pssetlength ...ecial@length \pst@tempg \@nil {#1} \ignorespaces \pst@getlength #1#2-\pssetlength \pst@dimg {#1} \edef #2{\pst@number\pst@di. .. argument ...endcsname \expandafter {\XKV@tempa } \relax \XKV@srstate{}{@\r... \XKV@afterfi #1\fi -\fi #1 \XKV@f@r ...nnil \expandafter \@gobbletwo \else #2 \expandafter \XKV@f@r \fi ... ... l.219 \psset[pst-plot]{barwidth=0.25cm} Thanks a lot for your support and for Context. Jorge Manuel ___ 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 ___
[NTG-context] Drawing chemical structures
Dear Sirs, I'm trying to run some code from the ppchtex manual, however, the chemical structures are not correctly drawn. See the example: https://www.dropbox.com/s/w7v8kouc4glndf0/chemicerror.pdf. I found this problem en Minimals (last version) and on TexLive 2013. \setupbodyfont[11pt] \usemodule[chemic] \starttext \startchemical[width=fit,scale=small,size=big] \bottext{α-Glycerophosphate} \chemical[ONE,SB1357,Z0357][\TL{α}{C},\SL{OPO\lohi{3}{2-}},H,H] \chemical[MOV1,SB137,Z037][C,\SL{OH},H] \chemical[MOV1,SB137,Z0137][C,H,\SL{OH},H] \stopchemical \definechemical[desoxyribose] {\chemical[FIVE,FRONT,BB125,+SB3,-SB4,Z4][O] \chemical[FIVE,FRONT,+R1235,+RZ1235][H,H,\SR{HOH_2C},OH] \chemical[FIVE,FRONT,-R1235,-RZ1235][H,OH,H,H]} \startchemical[height=6500,top=2000,bottom=2500,width=4500] \chemical[desoxyribose] \bottext{Desoxiribosa (dR)} \stopchemical \startchemical[height=4500,bottom=2500] \bottext{$\alpha$-D-Fructofuranose} \chemical [FIVE,FRONT,BB125,+SB3,-SB4,Z4][O] \chemical [FIVE,FRONT,+R1235,+RZ1235][\SR{HO},H,\SR{HOH_2C},CH_2OH] \chemical [FIVE,FRONT,-R1235,-RZ1235][OH,H,\SR{HO},H,CH_2OH] \stopchemical \startchemical[height=4500,bottom=2500] \chemical [FIVE,FRONT,B,R] \chemical [+RZ1..5] [1,2,3,4,5] \chemical [-RZ1..5] [a,b,c,d,e] \stopchemical \stoptext ___ 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 ___