[NTG-context] OpenBSD install broken

2019-09-20 Thread Robert Krug

Greetings,



First, thanks for all the wonderful work on context.



Now, to the reason for this note. I recently tries to install context on an 
OpenBSD 6.5 AMD64

system, but the install failed. Thanks to some helpful emails in the archives 
from 2017 and 2018,

I was able to get this working by editing mtxrun and mtx-update.sh.



I include what I did below.



Thanks again,

Robert



1) Do the usual:

  mkdir context && cd context
  rsync -ptv rsync://contextgarden.net/standalone/setup/first-setup.sh .
  ./first-setup.sh

This will silently fail, because
bin/mtx-update.lua
bin/mtxrun
do not recognize openbsd.

2) Edit bin/mtxrun:

We need to define a "good" version of resolvers.platform(t,k)
At line 4049, there is a default definition. Replace it with:

 function resolvers.platform(t,k)
  local platform="openbsd6.5-amd64"
  os.setenv("MTX_PLATFORM",platform)
  os.platform=platform
  return platform
 end

3) Edit bin/mtx-update:

3a) In the table update.platforms add an entry for openbsd:

    ["openbsd6.5-amd64"]  = "openbsd6.5-amd64",

I put this at line 198, after the entries for freebsd.

3b) In the function update.synchronize()

replace line 282:

    local platforms    = states.get('platforms') or { }

with:

    local platforms    = states.get('platforms') or {"openbsd6.5-amd64" }

3c) At the very start of local function add_collection(collection,platform)
line 417, add:

    platform = "openbsd6.5-amd64"

Maybe something is broken on my system or these last two aren't
really needed, but this is what I did,

4) Edit first-setup.sh:

To avoid overwriting the files we just edited, comment out line 146:

# rsync -rlptv rsync://contextgarden.net/minimals/setup/$platform/bin .

This may interfere with future updates.

5) Install for real this time:

  ./first-setup.sh --modules=all

6) Finally, the setuptex script gives me an error message:

  megaera$ . /home//Context/tex/setuptex
  /bin/ksh: /home//Context/tex/setuptex[163]: ${.sh.file}": bad 
substitution

but it is not hard to set the path correctly:

  PATH=$PATH\:/home//Context/tex/texmf-openbsd6.5-amd64/bin ; export PATH



___
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] Extracting a column from an array in lua

2019-09-20 Thread Otared Kavian
Hi,

Probably this is a silly question… 
In lua, I have an array named  t which is determined in a piece of lua code, 
having (say) two columns and I want to extract for example the first column of 
t and call the new array tt.
In Matlab, Scilab and friends, this can done by saying tt = t[:,1].

Is this possible in lua?
For the moment I have something like this, but I think it is not a good 
approach:

\starttext
\startluacode
t = {}  -- a silly example of a matrix...
for i = 1, 3 do
t[i] = {}
t[i]["columnOne"] = 10*i + 1
t[i]["columnTwo"] = 10*i + 2
end
tt = {}
for i = 1,3 do -- is it possible to avoid this ?
tt[i] = t[i]["columnOne"]
end
\stopluacode

The first column of the array  \type{t} is: 
\ctxlua{context.print(tt," ; ")}
\stoptext

Many thanks for any help,
Best regards: OK
___
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] comma as decimal separator in maths mode

2019-09-20 Thread Wolfgang Schuster

Martin Althoff schrieb am 14.09.2019 um 08:34:

Hi ... I am outputting some numbers in maths mode that have a comma as decimal 
separator.

I get a big space after the comma, which I can prevent by writing $1{,}5$

Is there a less awkward way of getting the comma as a "real" decimal separator?

\setupmathematics[autopunctuation=yes]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___