Re: [NTG-context] Set luatex cache directory path

2021-04-11 Thread Thangalin
$ sudo su -
$ rm -rf /opt/context
$ mkdir -p /opt/context
$ cd /opt/context
$ wget http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip
$ unzip *zip
$ export TEXMFCACHE=/tmp
$ sh install.sh
$ exit
$ cat test.tex
\starttext
Test
\stoptext
$ export TEXMFCACHE=/tmp
$ sudo rm -rf /tmp/luatex-cache
$ /opt/context/tex/texmf-linux-64/bin/mtxrun --autogenerate --script
mtx-context --autopdf test.tex
resolvers   | resolving | remembered file 'mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-contexts.lua'
resolvers   | resolving | remembered file 'mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-contexts.lua'
resolvers   | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers   | resolving | remembered file 'mtx-context.lua'
mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'

If the cache directory isn't deleted, the PDF is generated. However, as
soon as the computer reboots, or the temporary directory is otherwise
erased, two runs are required.

I've addressed this in my code, but it's a little awkward and somewhat
brittle because the code cannot know what makes for a valid luatex-cache
directory:

private boolean reinitialize() {
  // variable assignments ... exists = check for luatex-cache directory

  mArgs.clear();
  mArgs.add( TYPESETTER.getName() );

  if( exists ) {
mArgs.add( "--autogenerate" );
mArgs.add( "--script" );
mArgs.add( "mtx-context" );
mArgs.add( ... remaining args ... );
  }
  else {
mArgs.add( "--generate" );
  }

  return exists;
}

private boolean typeset() throws Exception {
  return reinitialize() ? call() : call() && reinitialize() && call();
}

// Invoke ConTeXt to either typeset the document or generate the cache
directory
public Boolean call() throws Exception {
  final var builder = new ProcessBuilder( mArgs );
  builder.directory( mDirectory.toFile() );

  final var cacheDir = getCacheDir();
  final var env = builder.environment();
  env.put( "TEXMFCACHE", cacheDir.toString() );

  builder.redirectOutput( DISCARD );
  builder.redirectError( DISCARD );

  final var process = builder.start();
  process.waitFor();
  final var exit = process.exitValue();
  process.destroy();
  return exit == 0;
}

Also, unless my application installs ConTeXt, setting the TEXMFCACHE
directory before the installation begins will require asking users to do
this. Ideally, using the software would take the following steps:

1. Download text editor
2. Download and install ConTeXt (e.g., click link, extract archive, run
install.sh)
3. Run text editor
4. Export PDF (editor configures ConTeXt as required, reducing the number
of steps for end users)

At some point in the future, the editor may prompt the user for permission
to install ConTeXt on their behalf---to simplify step 2---but that's much
more effort.

Stay safe!
___
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] arm osx

2021-04-11 Thread Keith McKay
An alternative way is to go to Preferences>>Security and Privacy>>General.
And then click on Open anyway and that's it sorted.
Best Wishes
Keith



On Sun, 11 Apr 2021, 18:47 Otared Kavian,  wrote:

> Hi,
>
> Thank you Mojca and Hans for the new binary for MacOS ARM: yesterday I
> installed it on my new MacBook Pro ARM and everything works like a charm.
>
> Just for the persons who run into difficulties when running
> sh install.sh
> and see that MacOS 11 prevents mtxrun to run properly, in the Finder you
> should find the file
>
> context-osx-arm64/bin/mtxrun
>
> and then you press Control while clicking on it. You’ll see a pop up
> window, and you choose Open, and when the Finder tells you whether you
> really want to open that file, you say YES…
> After this, the install script does what it has to do and you don’t need
> anymore to authorize mtxrun to run.
>
> Best regards: Otared
>
> > On 10 Apr 2021, at 17:21, Hans Hagen  wrote:
> >
> > Hi,
> >
> > Thanks to Mojca's persistent efforts we now generate arm osx binaries on
> the build infrastructure, so lmtx now ships native arm bins for apples.
> There are also intel solaris builds now but no installers for those
> platforms (yet).
> >
> > 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
>
> ___
>
___
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] arm osx

2021-04-11 Thread Otared Kavian
Hi,

Thank you Mojca and Hans for the new binary for MacOS ARM: yesterday I 
installed it on my new MacBook Pro ARM and everything works like a charm.

Just for the persons who run into difficulties when running
sh install.sh
and see that MacOS 11 prevents mtxrun to run properly, in the Finder you should 
find the file

context-osx-arm64/bin/mtxrun

and then you press Control while clicking on it. You’ll see a pop up window, 
and you choose Open, and when the Finder tells you whether you really want to 
open that file, you say YES…
After this, the install script does what it has to do and you don’t need 
anymore to authorize mtxrun to run.

Best regards: Otared

> On 10 Apr 2021, at 17:21, Hans Hagen  wrote:
> 
> Hi,
> 
> Thanks to Mojca's persistent efforts we now generate arm osx binaries on the 
> build infrastructure, so lmtx now ships native arm bins for apples. There are 
> also intel solaris builds now but no installers for those platforms (yet).
> 
> 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
___


Re: [NTG-context] arm osx

2021-04-11 Thread Keith McKay

Great news on the Apple front! Thanks to Mojca and ConTeXt.

Best Wishes

Keith McKay

On 10/04/2021 16:21, Hans Hagen wrote:

Hi,

Thanks to Mojca's persistent efforts we now generate arm osx binaries 
on the build infrastructure, so lmtx now ships native arm bins for 
apples. There are also intel solaris builds now but no installers for 
those platforms (yet).


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
___


Re: [NTG-context] Arabic place names

2021-04-11 Thread Arthur Rosendahl
On Sun, Apr 11, 2021 at 08:47:05AM +1000, jbf wrote:
> Thanks for that tip, Arthur. I, too, considered that it might be the font
> that was giving me problems (among other things, mainly my lack of
> understanding of r2l!), so I swapped to Amiri and then used the setup below
> which I then called in whenever needed -- it seems to work. But I will take
> a look at DejaVu Sans.

  That shouldn’t be necessary, I only took that one because it’s
mentioned on the wiki.  Glad it works for you.

Best,

Arthur
___
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] Set luatex cache directory path

2021-04-11 Thread Hans Hagen

On 4/11/2021 1:30 AM, Thangalin wrote:

Are two runs always required to generate a PDF when TEXMFCACHE is set?

$ sudo su -
$ mkdir -p /opt/context
$ cd /opt/context
$ wget http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip 


$ unzip *zip
$ sh install.sh
$ exit
$ cat test.tex
\starttext
Test
\stoptext
$ export TEXMFCACHE=/tmp
$ rm -rf $TEXMFCACHE/luatex-cache
$ /opt/context/tex/texmf-linux-64/bin/mtxrun --autogenerate --script 
mtx-context --autopdf test.tex

...
resolvers       | resolving | remembered file 'mtx-context.lua'
resolvers       | resolving | remembered file 'mtx-contexts.lua'
resolvers       | resolving | remembered file 'mtx-context.lua'
resolvers       | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers       | resolving | remembered file 'mtx-t-mtx-contexts.lua'
resolvers       | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers       | resolving | remembered file 'mtx-context.lua'
mtxrun          | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'
$ /opt/context/tex/texmf-linux-64/bin/mtxrun --script context --version
mtx-context     | current version: 2021.04.10 17:09
$ mtxrun --autogenerate --script mtx-context --autopdf test.tex
...
mkiv lua stats  > runtime: 0.432 seconds, 1 processed pages, 1 shipped 
pages, 2.315 pages/second

system          | total runtime: 3.318 seconds of 3.372 seconds

The first run fails; the second run succeeds.

If TEXMFCACHE is not set, then the first run succeeds. If TEXMFCACHE is 
set to any non-empty value and $TEXMFCACHE/luatex-cache has not been 
created, mtxrun always terminates with the same unknown script error.


What am I missing to ensure that ConTeXt will create luatex-cache in 
/tmp when TEXMFCACHE is set and successfully build the PDF on first run?

what happens if you also set TEXMFCACHE before running install.sh

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