Re: [NTG-context] Install Tikz in LMTX tree

2020-03-11 Thread Jorge Manuel
Thanks to Hans Hagen.

\newcount\eTeXversion  \eTeXversion  = 2000
\newcount\eTeXrevision \eTeXrevision = 0020

In the top of my tex file fixed the problem.

Jorge

> On 10 Mar 2020, at 14:06, Hans Hagen  wrote:
> 
> On 3/10/2020 11:32 AM, Henri Menke wrote:
> 
>> There are still people trying to run TikZ on plain TeX with the Knuth
>> engine: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=920368
> 
> hm, so you can't actually use etex goodies unless you emulate them
> 
>>> \newcount\eTeXversion  \eTeXversion  = 2000
>>> \newcount\eTeXrevision \eTeXrevision = 0020
>> Hm, I need something that *all* eTeX engines provide that I can check.
>> And these seem to have met that requirement.  I really don't want to
>> write a huge cascade of if-s to test for different engines.
> 
> I'll add dummies then but be aware that you actually should test for the 
> primitives that you expect because I'm not even sure if luatex bumped the 
> number. As you mention "all" it means that you expect differences because 
> "all" implies differences here. What if someone runs a very old 
> (experimental) etex.
> 
> (\scantokens, \readline, \detokenize, \savingvdiscards are likely to be 
> untouched .. it depends on what primitives you expect to use)
> 
> 
> Hans
> 
> 
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 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
> ___

___
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] Install Tikz in LMTX tree

2020-03-09 Thread Jorge Manuel

Dear Sirs, 


I download tikz.tds.zip 
 from ctan and 
unzip it in /Applications/Context/context-osx-64/tex/texmf.

Next I run 
mtxrun --generate
context —make

My test  file contains:


\setupcolors[state=start]
\usemodule[tikz]   

\starttext

\starttikzpicture
 [node distance=4cm,
place/.style={circle,draw=blue!50,fill=blue!20,thick,
 inner sep=0pt,minimum size=6mm}]

\node[place] (wat) {};
  \node[place] (wag) [below=of wat] {};

\stoptikzpicture

\stoptext



The log is:

open source > level 1, order 1, name 'cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2020.02.17 19:36 MKIV beta  fmt: 2020.3.9  int: 
english/english
system  > 
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name 
'/Applications/Context/context-osx-64/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name 
'/Applications/Context/context-osx-64/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'Recuperacao', input './Recuperacao', result 
'Recuperacao'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name './Recuperacao.tex'
modules > 'tikz' is loaded
open source > level 3, order 4, name 
'/Applications/Context/context-osx-64/tex/texmf/tex/context/third/pgf/frontendlayer/t-tikz.tex'
loading > ConTeXt User Module / tikz
open source > level 4, order 5, name 't-pgf.tex'
loading > ConTeXt User Module / pgf
open source > level 5, order 6, name 't-pgfcor.tex'
loading > ConTeXt User Module / pgfcor
open source > level 6, order 7, name 't-pgfsys.tex'
loading > ConTeXt User Module / pgfsys
open source > level 7, order 8, name 't-pgfrcs.tex'
loading > ConTeXt User Module / pgfrcs
open source > level 8, order 9, name 't-pgfmod.tex'
loading > ConTeXt User Module / pgfmodules
system  > module wrapping error in 'tikz'
close source> level 8, order 9, name 't-pgfmod.tex'
open source > level 8, order 10, name 'pgfutil-common.tex'
open source > level 9, order 11, name 'pgfutil-common-lists.tex'
close source> level 9, order 11, name 'pgfutil-common-lists.tex'
close source> level 8, order 11, name 'pgfutil-common.tex'
open source > level 8, order 12, name 'pgfutil-context.def'
close source> level 8, order 12, name 'pgfutil-context.def'
open source > level 8, order 13, name 'pgfrcs.code.tex'

tex error   > tex error on line 11 in file pgfrcs.code.tex: ! Package PGF 
Error: PGF requires etex in extended mode


\pgfutil@packageerror #1#2#3->\errhelp {#3}\errmessage {Package #1 Error: #2}
 
l.11   \pgfutil@packageerror{PGF}{PGF requires etex in extended mode}{}
 %




This error message was generated by an \errmessage command, so I can't give any
explicit help. Pretend that you're Hercule Poirot: Examine all clues, and deduce
the truth by order and method.


Anybody has a clue how to fix this?

Thanks to all.


___
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] Third party modules in LMTX

2020-03-09 Thread Jorge Manuel

Attention: 

I tried to install TiKZ module in my macOS Catalina with this shell script and 
several folders in my system are deleted.  

My Context Folder is located at /Applications folder. 

Is there a safe way to install modules for LMTX.


Thanks.


> On 14 Feb 2020, at 07:48, Henri Menke  wrote:
> 
> On 2/12/20 5:10 PM, jdh wrote:
>> 
>> 
>> I would like to use Wolfgang's t-letter module, but need some help.
>> 
>> I found the following instructions:
>> 
>> "The ConTeXt suite only comes with Taco's t-bib module. If you want to 
>> install a new module, say Wolfgang's t-letter module, you can use
>> 
>> first-setup.sh --modules="t-letter"
>> 
>> 
>> BUT, the LMTX standalone does not have any "first-setup.sh"  shell script.
>> 
>> Is there another way to install the "t-letter" module for use with LMTX?
>> 
> 
> #!/bin/sh
> 
> # Install or update texmf-modules
> # Requires: awk, rsync
> 
> # Check whether LuaMetaTeX is available
> if ! command -v luametatex > /dev/null; then
>echo "luametatex is not in PATH, so there likely won't be the correct 
> mtxrun"
>echo "Aborting..."
>exit 1
> fi
> 
> # Make the texmf-modules directory, just in case
> TEXMFMODULES="$(mtxrun --resolve-path "\$TEXMFMODULES")"
> mkdir -p "${TEXMFMODULES}/"
> 
> # Sync with the Garden
> GARDENRSYNC="contextgarden.net 
> ::minimals/current/modules"
> for module in $(rsync "${GARDENRSYNC}/*" | awk '{print $NF}'); do
>echo "Syncing ${module}"
>rsync -rpztlv --delete "${GARDENRSYNC}/${module}/" "${TEXMFMODULES}/"
> done
> 
>> Any help is appreciated.
>> 
>> Thanks
>>  Darel
>> ___
>> 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 
>> ___
>> 
> ___
> 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 
> ___

___
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] metafun 2

2019-08-19 Thread Jorge Manuel

Thanks a lot for the new features.


In my system this code don’t work.

macOS Mojave

This is LuaMetaTeX, Version 2.00.0
open source > level 1, order 1, name 'cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2019.08.17 12:16 MKIV beta  fmt: 2019.8.19  
int: English/English




\startMPcode{doublefun}
draw lmt_function [

xmin =  0, xmax = 10, xstep = .05,
ymin = -2, ymax =  2,

xticks = "bottom", xsmall = 80, xlarge = 20,
yticks = "left",   ysmall = 40, ylarge =  4,

code = "1.5 * math.cosd(240 * math.sqrt(x))",

xlabels = "yes",
ylabels = "yes",

ycaption = "\strut\tfd \rotate[rotation=90]{vertical}",
xcaption = "\strut\tfd horizontal",

pointsymbol = "dot", pointsize = 4, pointcolor = "orange",

sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm,
]
xsized 8cm
;
\stopMPcode

The output error:

loading metafun, including plain.mp version 1.004 for metafun iv and xl


pages   > flushing realpage 9, userpage 8, subpage 9
metapost log> ! Missing ':' has been inserted.
metapost log> 
metapost log>addto
metapost log> draw->addto
metapost log>
.currentpicture.if.picture(EXPR0):also(EXPR0)else:doublepath(EXPR…









___
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 with context

2019-06-23 Thread Jorge Manuel
After some attempts to build crosswords puzzles with context, I found this 
approach:

1) Create the puzzle with  genxword
https://github.com/riverrun/genxword  

2) Edit the output table and change all {}  to  *

3) Save the table in a file (p.e. crosswords.txt) 

3) In context use this script (Revised By Wolfgang Schuster)

\startluacode
context.startmidaligned()
context.bTABLE( { rulethickness = ".25pt", width = ".8cm", height = 
".8cm", align = "{lohi, middle}" } )
for line in io.lines("crosswords.txt") do
for w in (line .. "|"):gmatch("([^|]*)|") do 
-- print (w)
if w == ' ' then
context.bTR()
elseif w == '.' then
context.eTR()
else
if w == '* ' then 
context.bTD( { frame = "off" } )
context.eTD()
else 
ww = string.match (w, "%d+")
print (ww)
if ww then
context.bTD( { foregroundstyle = "\\bfxx" } )
context("%s",ww)
context.eTD()
else
context.bTD()
 -- context("%s",w)
context.eTD()
end
end
end
end
end
context.eTABLE()
context.stopmidaligned()
\stopluacode


Files: 

crossword.txt file:

 |* |* |[2]T|* |* |* |* |* |* |* |* |* |* |* |* |* |.
 |[1]A|D|R|I|A|N|O|* |* |* |* |* |* |* |* |* |.
 |* |* |A|* |* |* |* |* |* |* |* |* |* |* |* |* |.
 |[6]H|* |J|* |* |* |[4]T|* |* |* |* |* |* |* |* |* |.
 |[3]I|T|A|L|I|C|A|* |* |* |* |* |* |* |* |* |.
 |S|* |N|* |* |* |R|* |* |* |* |* |* |* |* |* |.
 |P|* |O|* |* |* |G|* |[10]S|* |* |[7]P|* |* |* |* |.
 |A|* |* |* |[5]G|U|A|D|A|L|Q|U|I|[9]V|I|[8]R|.
 |L|* |* |* |* |* |R|* |N|* |* |B|* |E|* |O|.
 |I|* |* |* |* |* |Y|* |T|* |* |L|* |N|* |M|.
 |S|* |* |* |* |* |E|* |I|* |* |I|* |U|* |A|.
 |* |* |* |* |* |* |N|* |P|* |* |O|* |S|* |N|.
 |* |* |* |* |* |* |* |* |O|* |* |* |* |* |* |O|.
 |* |* |* |* |* |* |* |* |N|* |* |* |* |* |* |S|.
 |* |* |* |* |* |* |* |* |C|* |* |* |* |* |* |* |.
 |* |* |* |[11]A|N|F|I|T|E|A|T|R|O|* |* |* |.

Output






___
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] CHEMIC: place a argument under the compound

2019-03-18 Thread Jorge Manuel

Works.

Thanks a lot.

Jorge

> No dia 18/03/2019, às 14:55, Alan Braslau  escreveu:
> 
> \startchemicalformula

___
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] CHEMIC: place a argument under the compound

2019-03-18 Thread Jorge Manuel
Thanks for your support.
I clear the  recommended line, but the problem persists. How I can fix that?

Jorge


> No dia 18/03/2019, às 14:36, Alan Braslau  escreveu:
> 
> On Mon, 18 Mar 2019 10:08:33 +0000
> Jorge Manuel  wrote:
> 
>> \usemodule[chemic]
> 
> chemic is the old, mkii chemical macros.
> They have been replaced in mkiv with core macros
> so no need for the above line.
> 
> Alan
> 

___
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] CHEMIC: place a argument under the compound

2019-03-18 Thread Jorge Manuel
Good morning to all,

I need to place a argument under the compound.
For the first compound it's ok, but for the second and third compounds 
the argument is placed in front an not bellow. 

How I can fix that? thanks.

\usemodule[chemic]

\startformula
  \chemical{Fe^{3+}}{}{yellow}
  \chemical{PLUS}
  \chemical{SCN^{-}}{}{colourless}
  \chemical{EQUILIBRIUM}
  \chemical{[FeSCN]^{2+}}{}{red}
\stopformula
___
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] t-scancsv_ConTeXT_module can't filter anymore

2018-09-17 Thread Jorge Manuel

Dear Pablo,

Changing scancsv to handlecsv is enough in my all documents (at least the ones 
I tested).  Now, all works fine. Thanks again.

 Jorge


> No dia 17/09/2018, às 19:34, Pablo Rodriguez  escreveu:
> 
> 
> On 9/17/18 7:50 PM, Jorge Manuel wrote:
>>> [...]
>>> My guess is that you need to enclose text strings in quotes, so that
>>> your conditionals read:
>>> 
>>>  \doloopif{\Flag}{~=}{"anl"}{\lineaction}
>>>  \doloopif{\Flag}{==}{"anl"}{\lineaction}
>> 
>> Thanks for your reply. This code don’t work.  I would try your
>> handlecsv module. I need to adapt my old .tex files.
> I was wrong. Quotes aren’t required.
> 
> See minimal example (which works both with handlecsv and scancsv):
> 
>\usemodule[handlecsv]% scancsv works too
>\opencsvfile{cities.csv}
>\starttext
>\startbuffer
>This is located in Germany: \cA\par
>\stopbuffer
>\section{Cities in Germany}
>\doloopif{\cB}{==}{Germany}{\getbuffer}
>\section{Cities not in Germany}
>\doloopif{\cB}{~=}{Germany}{\getbuffer}
>\stoptext
> 
> Contents from "cities.csv" read:
> 
>"Berlin";"Germany"
>"Paris";"France"
>"London";"UK"
>"New York";"USA"
>"Munich";"Germany"
>"Lisbon";"Portugal"
>"Dublin";"Ireland"
>"Warsaw";"Poland"
>"Vienna";"Austria"
>"Barcelona";"Spain"
> 
> Just in case it helps,
> 
> Pablo
> -- 
> http://www.ousia.tk
> ___
> 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
> ___

___
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] t-scancsv_ConTeXT_module can't filter anymore

2018-09-17 Thread Jorge Manuel


> No dia 17/09/2018, às 17:07, Pablo Rodriguez  escreveu:
> 
> On 9/17/18 3:05 PM, Jorge Manuel wrote:
>> Dear Sirs
>> 
>> I'm trying to run an old code that imports the t-scancsv module.
> 
> Dear Jorge Manuel,
> 
> I’m afraid that the scancsv module has been deprecated.
> 
> handlecsv is the new csv module (that replaces scancsv).
> 
> Could you use the handlecsv module instead? (At least, if my suggestion
> below doesn’t work, try handlecsv.)
> 
>> However, I encountered an error message that did not happen before. The
>> same error can be reproduced in the module package when I run "context
>> list.tex". The error is on the line: 
> 
> Unless you provide a minimal sample that reproduces the issue, it is
> impossible to know what when wrong.
> 
>> \doloopif{\Flag}{~=}{anl}{\lineaction} doesn’t work anymore, the
>> same for \doloopif{\Flag}{==}{anl}{\lineaction}
> 
> My guess is that you need to enclose text strings in quotes, so that
> your conditionals read:
> 
>   \doloopif{\Flag}{~=}{"anl"}{\lineaction}
>   \doloopif{\Flag}{==}{"anl"}{\lineaction}


Thanks for your reply. This code don’t work.  I would try your handlecsv 
module. I need to adapt my old .tex files. 
 Many thanks for that.

Jorge



> 
>> but \doloopif{1}{==}{1}{\lineaction} is ok.
> 
> Numbers must not be enclosed in quotes to be handled as such (that is,
> to avoid being treated as text strings).
> 
> I hope it helps,
> 
> Pablo
> 
> 
> 
> 
> -- 
> http://www.ousia.tk
> ___
> 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
> ___

___
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] t-scancsv_ConTeXT_module can't filter anymore

2018-09-17 Thread Jorge Manuel
Dear Sirs

I'm trying to run an old code that imports the t-scancsv module. However, I 
encountered an error message that did not happen before. The same error can be 
reproduced in the module package when I run "context list.tex". The error is on 
the line: 

\ doloopif {\ Flag} {~ =} {anl} {\ lineaction} don’t work anymore, the same for 
\ doloopif {\ Flag} {==} {anl} {\ lineaction} 

but  \ doloopif {1} {= =} {1} {\ lineaction} is ok.


And the error is

 \Email 
   
\mailto #1->\useURL [#1
   ][mailto:#1][][#1]\from [{#1}]
 ...\bTD \ \flagpicture \eTD \bTD \fcol \ttx \mejl 
  \eTD \eTR 
\expanded ...m_syst_helpers_expanded {\noexpand #1
  }\m_syst_helpers_expanded 
\20>>1 ...v.gNumLine-1;}\else \blinehook \tempiii 
  \elinehook \fi \nextrow \i...
\syst_helpers_loop_yes ...helpers_recurse_content 
  \endofloop 
...
l.81 \doloopif{\Flag}{~=}{anl}{\lineaction}
 

Thanks for your support.


This is LuaTeX, Version 1.08.0 (TeX Live 2018) ___
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] Can MetaPost draw directly datapoints from a data file?

2017-12-28 Thread Jorge Manuel
Thanks a lot for this nice and clean solution. It’s fantastic. Now it is very 
easy to make scatter plots from the output of c++ libraries and other kind of 
applications: two axes and a path build like this

 path curve; 
 numeric i; i:=1;
 curve :=  my_offset(i) forever: hide(i := i + 1) exitif i >  my_nofelements .. 
my_offset(i) endfor;

Thanks again

Have a great 2018

Jorge


> No dia 28/12/2017, às 18:47, Hans Hagen  escreveu:
> 
> \starttext
> 
> \startluacode
>MP.mycode = { }
> 
>local elements = { }
> 
>function MP.mycode.loadelements(filename)
>elements = { }
>for line in io.lines(filename) do
>elements[#elements+1] = { string.match(line, 
> '(%S+)%s*(%S+)%s*(%S+)%s*(%S+)%s*(%S+)') }
>end
>end
> 
>function MP.mycode.nofelements()
>mp.print(#elements)
>end
> 
>function MP.mycode.getlabel(i)
>mp.quoted(elements[i][1])
>end
> 
>function MP.mycode.getoffset(i)
>mp.pair(elements[i][2],elements[i][3])
>end
> \stopluacode
> 
> \startMPcode
>lua.MP.mycode.loadelements("molecule.xyz ") ;
>for i=1 upto lua.MP.mycode.nofelements() :
>label (lua.MP.mycode.getlabel(i),50 * lua.MP.mycode.getoffset(i)) ;
>endfor ;
> \stopMPcode
> 
> \startMPcode
>def my_loadelements(expr name) =
>lua.MP.mycode.loadelements(name) ;
>enddef ;
>vardef my_nofelements =
>lua.MP.mycode.nofelements()
>enddef ;
>vardef my_label(expr i) =
>lua.MP.mycode.getlabel(i)
>enddef ;
>vardef my_offset(expr i) =
>lua.MP.mycode.getoffset(i)
>enddef ;
> 
>my_loadelements("molecule.xyz ") ;
>for i=1 upto my_nofelements :
>label (my_label(i),50 * my_offset(i)) ;
>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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Can MetaPost draw directly datapoints from a data file?

2017-12-28 Thread Jorge Manuel
When I need to draw datapoints from a external data file I’m using lua, like this:\starttext\startluacodeElemento = {}x = {}y ={}z= {}carga = {}i=1context("\\startMPcode”)context("numeric u; u := 1.5cm;")for line in io.lines("molecule.xyz") do   local a, b, c, d, e = string.match(line, '(%a+)%s*%s*(%S+)%s*%s*(%S+)%s*%s*(%S+)%s*%s*(%S+)')   Elemento[i]= a   x[i]= tonumber(b)   y[i]= tonumber(c)   z[i]= tonumber(d)   carga[i]= tonumber(e)   context("label(\"%s\", (%0.6f u, %0.6f u));", a, x[i],y[i])   i=i+1 endcontext("\\stopMPcode”)\stopluacode\stoptextIs there a way to pass directly the external data to MetaPost without using Lua?I know that I can use a similar function to gdata from graph.mp. I try to reuse this piece of code, but not works.\startMPcodevardef Grdln_@#(expr f) =  save n_, s_; string s_;  s_ = readfrom f;  string @#[];  if s_<>EOF:    @#1 := loptok s_;    n_ = if @#1="%": 0 else: 1 fi;    forever:      @#[incr n_] := loptok s_;      exitif @#[n_]="  ";    endfor    @#1<>"  "  else: false  fienddef;Grdln_$("molecule.xyz");\stopMPcode

molecule.xyz
Description: Binary data


read_external.tex
Description: Binary data
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] Can I use lua 5.3 with external dynamic libraries?

2017-12-27 Thread Jorge Manuel


> No dia 27/12/2017, às 09:31, Hans Hagen <pra...@wxs.nl> escreveu:
> 
> On 12/26/2017 9:19 PM, Jorge Manuel wrote:
>> Dear Sirs
>> Recently I moved to High Sierra with lua version 5.3.
>> I make a dynamic library from GSL and Swig the I call meurandist.so
>> I do:
>> swig -lua meurandist.i
>> gcc -I/usr/include/lua -c meurandist_wrap.c -o meurandist_wrap.o
>> gcc -c meurandist.c -o meurandist.o
>> gcc -fpic -bundle -undefined dynamic_lookup -llua -lgsl -lgslcblas -lm -Wall 
>> -I/usr/local/include -L/usr/local/lib meurandist_wrap.o meurandist.o -o 
>> meurandist.so
>> In my old machine all I need to do for call this library are
>> "sudo cp randist.so /usr/local/lib/lua/5.2”
>> And then
>> \startluacode
>> require "meurandist"
>> ARRAY_SIZE=100
>> arr=meurandist.new_int(ARRAY_SIZE)
>> meurandist.rpoisson(arr,ARRAY_SIZE,4)
>> for i=0,ARRAY_SIZE-1 do
>> context(" "..meurandist.int_getitem(arr,i)..",")
>>   end
>> \stopluacode
>> Works nicely.
>> But now I don’t have lua 5.2 installed. I have copied my dynamic library in 
>> the lua5.3 tree and that works fine if I call them from the console, but not 
>> works if all call inside a context document.
>> Did I need to install lua 5.2? Is it mandatary? Is there a another way to 
>> call c libraries?
>> Thanks a lot and have a luck year.
> lua 5.3 has different 'number' internals so i think that 5.3 libs will not 
> work with 5.2
> 
> anyway, you can probably best install lua 5.2 (otherwise, you also might need 
> to adapt existing lua code to 5.3)
> 
> Hans




My library works fine with lua 5.3, but I don’t know to fix that inside ConTeXT 
tree. Install lua 5.2 is the best and easy way.





Thanks a lot

Jorge

> 
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl <http://www.pragma-ade.nl/> | 
> www.pragma-pod.nl <http://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 <mailto:ntg-context@ntg.nl> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Can I use lua 5.3 with external dynamic libraries?

2017-12-26 Thread Jorge Manuel

Dear Sirs

Recently I moved to High Sierra with lua version 5.3.

I make a dynamic library from GSL and Swig the I call meurandist.so

I do:

swig -lua meurandist.i
gcc -I/usr/include/lua -c meurandist_wrap.c -o meurandist_wrap.o
gcc -c meurandist.c -o meurandist.o
gcc -fpic -bundle -undefined dynamic_lookup -llua -lgsl -lgslcblas -lm -Wall 
-I/usr/local/include -L/usr/local/lib meurandist_wrap.o meurandist.o -o 
meurandist.so

In my old machine all I need to do for call this library are  

"sudo cp randist.so /usr/local/lib/lua/5.2”

And then 

\startluacode
require "meurandist"
ARRAY_SIZE=100
arr=meurandist.new_int(ARRAY_SIZE)
meurandist.rpoisson(arr,ARRAY_SIZE,4)
for i=0,ARRAY_SIZE-1 do
context(" "..meurandist.int_getitem(arr,i)..",")
  end
\stopluacode

Works nicely. 

But now I don’t have lua 5.2 installed. I have copied my dynamic library in the 
lua5.3 tree and that works fine if I call them from the console, but not works 
if all call inside a context document.

Did I need to install lua 5.2? Is it mandatary? Is there a another way to call 
c libraries?

Thanks a lot and have a luck year.

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] Context minimals on linux armhf

2017-12-16 Thread Jorge Manuel
Fixed. Thanks. 

Jorge


> On 16 Dec 2017, at 20:04, Mojca Miklavec  
> wrote:
> 
> On 15 December 2017 at 16:06, Lutz Haseloff wrote:
>> Hi all,
>> 
>> since some days, everytime I want to run first-setup.sh I get following
>> error message.
>> 
>> @ERROR: chroot failed
>> rsync error: error starting client-server protocol (code 5) at main.c(1653)
>> [Receiver=3.1.1]
>> 
>> Is there something wrong with the rsync server?
> 
> Can you please retry?
> 
> I would say that it's weird that nobody reported it earlier, but it's
> probably because if one runs the update on top of existing
> distribution, the error skips by.
> 
> It looks as if the sysadmin was changing some paths on the system and
> accidentally made one search-and-replace replacement too much.
> 
> 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
> ___

___
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] Context minimals on linux armhf

2017-12-16 Thread Jorge Manuel
Same problem for me. I try to install in a fresh High Sierra 10.13.2


rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.


@ERROR: chroot failed
rsync error: error starting client-server protocol (code 5) at main.c(1719) 
[Receiver=3.1.2]
env: ./bin/mtxrun: No such file or directory


> On 15 Dec 2017, at 15:06, Lutz Haseloff  wrote:
> 
> Hi all,
> 
> since some days, everytime I want to run first-setup.sh 
>  I get following error message.
> 
> @ERROR: chroot failed
> rsync error: error starting client-server protocol (code 5) at main.c(1653) 
> [Receiver=3.1.1]
> 
> Is there something wrong with the rsync server?
> 
> Greetings Lutz
> -- 
> GPG Key ID 
> 3C4F83BC___
> 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
> ___

___
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] Working example for correspondence

2006-09-23 Thread Jorge Manuel de Almeida Magalhães

Dear Sirs,

I need to prepare a letter  to send to hundred persons but I don't find 
a working example for use with a address database in xml format. Can 
you post a small example, please?

I had read the manual named xcorres.pdf, but the examples don't work 
for me and I don't know what I'm doing in wrong way.

Thanks a lot

Have a nice night

Jorge

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Working example for correspondence

2006-09-23 Thread Jorge Manuel de Almeida Magalhães
Robert,

Many thanks for your reply.  I tried to make texexec 
letter-sample.tex but I got no pages of output. What I'm doing in 
the wrong way?

Jorge


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] several questions

2006-07-30 Thread Jorge Manuel de Almeida Magalhães
Hi to all

I have some questions for you. Please help me:

1. Did you know a way to make a list of tables (natural tables \bTable 
\eTable)? For the Figures it is very easy:

\placelist[figure][alternative=c,aligntitle=no,width=4em]

but

\placelist[table][alternative=c,aligntitle=no,width=4em]

  d'ont works


2. Did you know how to force the section number to start in the number  
0, not in 1 (default)?

3. In the top of my file I use \language[pt], but it d'ont work. For 
example, in the figure caption I have Figure but I need Figura and 
so on


Thanks a lot

have a nice day

Jorge

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Making posters with ConTeXT

2006-05-24 Thread Jorge Manuel de Almeida Magalhães
Hi

I am trying to making a scientifique poster in Context. I need some 
suggestions,
foreground an example, to start. Somebody has a nice example to share?
What is the correct scales for the fonts?

Have a nice day/night

Thanks to all

Jorge

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Making exams in Context

2006-05-24 Thread Jorge Manuel de Almeida Magalhães
I need to prepare an exam. My choice is obviously ContexT, but
I have some difficulty in generating multiple choice questions in 
random order.
  Each student will have one different exam.
In Latex I use MUCH (http://fourier.math.uoc.gr/~mk/much/). Did you can 
tell me if it has a similar
solution in ConTexT?

Thanks

Jorge

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context