Re: [NTG-context] tikz + lmtx

2023-04-27 Thread Aditya Mahajan via ntg-context
On Fri, 28 Apr 2023, Aditya Mahajan via ntg-context wrote:

> Hi all,
> 
> For a few months now, all features of tikz have not been working with LMTX. 
> After help from Hans and a bit of trial and error, I think that figured out 
> what was going wrong with the catcodes in m-tikz: Since the texcatcodes are 
> different from what tikz expects, the catcodes have to be set inside 
> \starttikzpicture (in addition to before the loading of tikz files, which was 
> already being done). 
> 
> I am attaching the working m-tikz.mkxl file. 
> 
> I have tested this on my course notes, which make extensive use of simple 
> tikz block diagrams and pgfplots graphs. Perhaps others who were having 
> issues with tikz could test if this fixes everything and, if so, we can add 
> this to the distribution.

Circuitikz still doesn't work. Even loading the module fails. Not sure why this 
is happening:

\usemodule[circuitikz]

gives:


tex error   > tex error on line 77 in file 
/opt/luametatex/texmf-context/tex/context/modules/mkxl/m-circuitikz.mkxl: 
Package pgfkeys Error: I do not know the key '/tikz/resistor', to which you 
passed 'american', and I am going to ignore it. Perhaps you misspelled it

 \pgfkeys@error

which is a bit strange as the key should have been '/tikz/circuitikz/resistor' 
rather than 'tikz/resistor'.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] tikz + lmtx

2023-04-27 Thread Aditya Mahajan via ntg-context
Hi all,

For a few months now, all features of tikz have not been working with LMTX. 
After help from Hans and a bit of trial and error, I think that figured out 
what was going wrong with the catcodes in m-tikz: Since the texcatcodes are 
different from what tikz expects, the catcodes have to be set inside 
\starttikzpicture (in addition to before the loading of tikz files, which was 
already being done). 

I am attaching the working m-tikz.mkxl file. 

I have tested this on my course notes, which make extensive use of simple tikz 
block diagrams and pgfplots graphs. Perhaps others who were having issues with 
tikz could test if this fixes everything and, if so, we can add this to the 
distribution.

Aditya%D \module
%D   [   file=m-tikz,
%Dversion=2021.07.12,
%D  title=\CONTEXT\ Extra Modules,
%D   subtitle=TIKZ support,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D A fixed variant of the t-tikz module distributed with tikz. For practical 
reasons
%D per 2021 we split the module for \MKIV\ and \LMTX. (Maybe some day I'll 
optimize
%D TIKZ a bit.)
%D
%D All these t-* modules in the tikz distribution make no sense as we can just 
load
%D them here which is way cleaner. There is also some mkii filename mapping 
going on
%D that is not needed on todays systems (windows has no 8.3 limitation and on 
unix
%D tds finally adopted a case insensitive approach.)

%D Just in case someone does a hard input ...

\ifdefined\pgfdefined\endinput \fi
\ifdefined\pgfcoredefined\endinput \fi

%D ... but normally we end up here:

\startmodule[tikz]

\ifdefined\pdflastxpos \else
\unprotect

\frozen\overloaded\protected\def\pdflastxpos{\numexpr\clf_lastxpos\relax}

\frozen\overloaded\protected\def\pdflastypos{\numexpr\clf_lastypos\relax}
\protect
\fi

\newcatcodetable \tikzcatcodes

\startcatcodetable \tikzcatcodes
\catcode\tabasciicode \spacecatcode
\catcode\endoflineasciicode   \endoflinecatcode
\catcode\formfeedasciicode\endoflinecatcode
\catcode\spaceasciicode   \spacecatcode
\catcode\endoffileasciicode   \ignorecatcode
\catcode\circumflexasciicode  \superscriptcatcode
\catcode\underscoreasciicode  \subscriptcatcode
\catcode\ampersandasciicode   \alignmentcatcode
\catcode\backslashasciicode   \escapecatcode
\catcode\leftbraceasciicode   \begingroupcatcode
\catcode\rightbraceasciicode  \endgroupcatcode
\catcode\dollarasciicode  \mathshiftcatcode
\catcode\hashasciicode\parametercatcode
\catcode\commentasciicode \commentcatcode
\catcode\atsignasciicode  \lettercatcode
\catcode\exclamationmarkasciicode \othercatcode
\catcode\questionmarkasciicode\lettercatcode
\catcode\tildeasciicode   \activecatcode
\catcode\barasciicode \othercatcode
\stopcatcodetable

\permanent\protected\def\starttikzinput
  {\pushoverloadmode
   \pushcatcodetable
   \setcatcodetable\tikzcatcodes
   \pushmacro\meaning
   \let\meaning\meaningless
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzinput
  {\autoparagraphmode\plusone
   \popcatcodetable
   \popmacro\meaning
   \popoverloadmode}

\permanent\protected\def\tikzinputfile#1%
  {\starttikzinput
   \input{#1}\relax
   \stoptikzinput}

\permanent\protected\def\tikzerrormessage#1#2#3%
  {\writestatus{#1}{#2}}

% For now we need this but we need to educate the user to wrap settings in the
% wrappers. So some day the next line will go. I need to check what commands are
% possible outside a picture.

\overloadmode\zerocount

\newtoks\everytikzpicture

% \appendtoks
% \resetcharacterspacing
% \to \everytikzpicture

\permanent\protected\def\starttikzsettings
  {\pushoverloadmode
   \pushmacro\meaning
   \let\meaning\meaningless
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzsettings
  {\autoparagraphmode\plusone
   \popmacro\meaning
   \popoverloadmode}

\permanent\protected\def\starttikzpicture
  {\dontleavehmode
   \hcontainer\bgroup
   \setcatcodetable\tikzcatcodes
   \the\everytikzpicture
   \autoparagraphmode\zerocount
   \pushmacro\meaning
   \let\meaning\meaningless
 % \pushoverloadmode
   \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
   \tikzpicture}

\permanent\protected\def\stoptikzpicture
  {\endtikzpicture
 % \popoverloadmode
   \popmacro\meaning
   \egroup}

\let\pgfdefined\relax
\let\pgfcoredefined\relax

\tikzinputfile{pgfutil-common.tex}
\tikzinputfile{pgfutil-context.def}
\tikzinputfile{pgfrcs.code.tex}
\tikzinputfile{pgfsys.code.tex}
\tikzinputfile{pgfkeys.code.tex}
\tikzinputfile{pgfsyssoftpath.code.tex}
\tikzinputfile{pgfsysprotocol.code.tex}

[NTG-context] LuaMetaTeX doesn't find files when symlinked

2023-04-27 Thread Max Chernoff via ntg-context
Hi Hans,

With the LuaMetaTeX-based ConTeXt wrapper, it's not generally possible
to run ConTeXt from a symlinked binary in another directory. This shows
up if someone makes symlinks in "/usr/bin" so that they can avoid adding
anything to their $PATH.

If you make run a symlink to the LuaMetaTeX-based ConTeXt wrapper, it
looks for texmfcnf.lua relative to the symlink location, not the symlink
target. With the old LuaTeX/kpse-based wrapper, the script would look
for texmfcnf.lua relative to the symlink target.

I know that my description above is terrible, so here's a demo:

   $ bin=$(mtxrun --expand-var TEXMFOS | head -1)/*
   $ cd $(mktemp -d)
   $ ln -s $bin/luatex $bin/luametatex $bin/context $bin/context.lua 
$bin/mtxrun $bin/mtxrun.lua .
   $ ./context --nofile
   $ ./context --luatex --nofile
   
Running the above commands used to work with the old LuaTeX/kpse-based
wrapper, but it doesn't work any more. I was able to ""fix"" this by
adding the lines

   if os.selfpath then
   environment.ownbin = lfs.symlinktarget(os.selfpath .. io.fileseparator 
.. os.selfname)
   environment.ownpath = environment.ownbin:match("^.*" .. io.fileseparator)
   else
   environment.ownpath = kpse.new("luatex"):var_value("SELFAUTOLOC")
   environment.ownbin = environment.ownpath .. io.fileseparator .. (arg[-2] 
or arg[-1] or arg[0] or "luatex"):match("[^" .. io.fileseparator .. "]*$")
   end
   
to mtxrun.lua, right below the line

   package.loaded["data-ini"] = package.loaded["data-ini"] or true
   
but this is obviously not a very good fix.

There are some threads with more details at:

   https://tug.org/pipermail/tex-live/2023-March/049028.html
   https://gitlab.com/islandoftex/images/texlive/-/issues/30
   
Those links only discuss TL, but I get the same issue if I make a symlink
to the standalone ConTeXt files. 

Thanks,
-- Max
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-04-27 Thread Max Chernoff via ntg-context
Hi Lynx,

> * How can I be sure that the standalone version is the one being
> implemented?

It depends on what your $PATH is set to. On Linux/macOS, you can run

   $ type -ap context

to list all the ConTeXts in your $PTAH. The first one in that list is
the one that will be ran by default.

If you want to always run the standalone version, then you'll need to
make sure that your ConTeXt directory comes before your TL directory in
your PATH. On Linux/macOS, you'd add something like

   export PATH="/path/to/context/bin/:$PATH"
   
to your ~/.profile; on Windows, you can use the "setx" command. Googling
something like "add location to path" will get you more specific
instructions for your OS/shell.

> * How do I update the standalone version

Just run the installer again. On my system, I run

   $ cd /opt/context
   $ sudo sh ./install.sh

> (I assume that, as of today,
> it is already the most up-to-date version

Correct.

> if and when it is
> required or desired to do so?

You only need to update ConTeXt if a new update fixes a bug that affects
you or adds a new feature that you want. Most updates are announced on
the list, so you could just update whenever you see a new update. Or you
could just try updating once per week. You could also just never update.
Up to you.

The general recommendation is to save an old copy of the ConTeXt folder
before you update in case something breaks. I've never done this before
though since I can usually patch the bugs myself, and I can always fall
back on the version in TL if something is really broken.

-- Max
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-04-27 Thread lynx--- via ntg-context
Hello, Max: 

As suggested, I have installed the "standalone" version of ConTeXt
alongside my full TeXlive installation. 

Now: 

* How can I be sure that the standalone version is the one being
implemented?
* How do I update the standalone version (I assume that, as of today,
it is already the most up-to-date version--Yes? No?), if and when it is
required or desired to do so?

Lynx 

On 2023-04-27 01:32, Max Chernoff via ntg-context wrote:

> Hi Hans,
> 
>> I actually dont' know the rules for updating texlive but there are
>> definitely updates.
> 
> The rules are:
> 
> - Packages and formats are updated about 24 hours after a new version
> is uploaded to CTAN.
> 
> - Binaries are only updated once-per-year.
> 
> But there are also some special cases:
> 
> - The luatex binary will be updated shortly for "reasons" (details to 
> be made public later).
> 
> - The luametatex binary is allowed to be updated whenever.
> 
> https://tug.org/pipermail/tex-live/2023-March/049058.html
> 
> - I have no idea how ConTeXt is added to TL, but it doesn't appear to 
> be through the usual automatic CTAN sync. 
> 
>> Basically tex live is the yearly snapshot.
> 
> Because you're allowed to update luametatex at will and luatex hardly
> changes, you could update the ConTeXt in TL more than once per year.
> There's no need for it to get as many updates as the standalone
> distribution, but it would be nice to get an update every 3 months or
> so. (I have no idea how much work this is for you+Mojca, so it's maybe
> not worth the effort).
> 
>> But you can just install the lmtx installation alongside (it's small
>> compared to tex live) and have the best of both worlds. The lmtx
>> installation also has mkiv. It also comes with the fonts that match
>> what we expect in context (as fonts get updated or changed).
> 
> Lynx, I'll second this recommendation. The standalone lmtx distribution
> is updated weekly-ish, uses less than 400MB disk space when installed,
> and coexists happily with TL. The only downside is that it doesn't have
> a friendly installation GUI like TL does. Even then, I personally find
> it easier to install than TL.
> 
> Installation instructions:
> 
> https://wiki.contextgarden.net/Installation
> 
> Thanks,
> -- Max
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> __
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2023-04-27 Thread Cron Daemon via ntg-context
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 
 sent 100,908 bytes  received 21,237,423 bytes  4,741,851.33 bytes/sec
 total size is 448,578,693  speedup is 21.02


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2023-04-27.18
120744599   
/var/www/aanhet.net/context//htdocs/archives/context-2023-04-27.18/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2023-04-27.18/current
247494012   
/var/www/aanhet.net/context//htdocs/archives/context-2023-04-27.18
247494012   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] upload

2023-04-27 Thread Hans Hagen via ntg-context

Hi,

I uploaded the last of series 2.10.07 as prelude for bachotex. That one 
also can do this:


\newfloat \MyFloat
\MyFloat \pfsin \floatexpr 1.25 * \pfpi \relax
\the\MyFloat

\the \pfsin \floatexpr 1.25 * \pfpi \relax

The syntax is like \numexpr and \dimexpr but the \pfsin (and other 
functions) are (as usual with these things) not real primitives but 
(\untraced) luacalls.


Of course it is all still somewhat experimental but likely to stay ...

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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-04-27 Thread Max Chernoff via ntg-context

Hi Hans,

> I actually dont' know the rules for updating texlive but there are
> definitely updates.

The rules are:

 - Packages and formats are updated about 24 hours after a new version
   is uploaded to CTAN.
   
 - Binaries are only updated once-per-year.

But there are also some special cases:

 - The luatex binary will be updated shortly for "reasons" (details to 
   be made public later).
   
 - The luametatex binary is allowed to be updated whenever.

  https://tug.org/pipermail/tex-live/2023-March/049058.html

 - I have no idea how ConTeXt is added to TL, but it doesn't appear to 
   be through the usual automatic CTAN sync. 
   
> Basically tex live is the yearly snapshot.

Because you're allowed to update luametatex at will and luatex hardly
changes, you could update the ConTeXt in TL more than once per year.
There's no need for it to get as many updates as the standalone
distribution, but it would be nice to get an update every 3 months or
so. (I have no idea how much work this is for you+Mojca, so it's maybe
not worth the effort).

> But you can just install the lmtx installation alongside (it's small
> compared to tex live) and have the best of both worlds. The lmtx
> installation also has mkiv. It also comes with the fonts that match
> what we expect in context (as fonts get updated or changed). 

Lynx, I'll second this recommendation. The standalone lmtx distribution
is updated weekly-ish, uses less than 400MB disk space when installed,
and coexists happily with TL. The only downside is that it doesn't have
a friendly installation GUI like TL does. Even then, I personally find
it easier to install than TL.

Installation instructions:

   https://wiki.contextgarden.net/Installation
   
Thanks,
-- Max
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2023-04-27 Thread Cron Daemon via ntg-context
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 
 sent 100,914 bytes  received 20,433,917 bytes  3,159,204.77 bytes/sec
 total size is 448,578,496  speedup is 21.84


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2023-04-27.10
120743612   
/var/www/aanhet.net/context//htdocs/archives/context-2023-04-27.10/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2023-04-27.10/current
247493025   
/var/www/aanhet.net/context//htdocs/archives/context-2023-04-27.10
247493025   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-04-27 Thread Hans Hagen via ntg-context

On 4/27/2023 7:11 AM, Max Chernoff via ntg-context wrote:

Hi Lynx, Aditya,



New to conTeXt, have not performed a specific update prior to this.

My conTeXt installation is part of TeXlive-2023 (under Linux OS). Will
the updates to ConTeXt be handled by tlmgr ?


No. Usually, texlive updates context once a year.


This is correct in general, but this specific update *will* end up in
TL2023 due to the engine changes that Hans mentioned. It's not in TL
yet, but we're actively working on it, so it should show up within a
week or so (hopefully).
Correction: Luigi and I are still discussing how to make it work because 
there is some init order issue and we want to be sure that context (and 
its scripts) keep working. It would be sort of weird if context (where 
luatex originates) would stop working as expected. Keep in mind that 
luatex is also a lua engine. and I assume that the texlive team also has 
some tests to perform (apart from getting all platforms updated which 
for some is more work, like apple signing).


The issue (disabling socket by default) is not that pressing as socket 
has been with us for right fromn the start) and security wise there are 
plenty ways tex can mess up your system if someone wants.


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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-04-27 Thread Hans Hagen via ntg-context

On 4/27/2023 1:54 AM, Jairo A. del Rio via ntg-context wrote:

Hi, Hans. The following happens with the last update:

loading         > ConTeXt Node Macros / Page Building
resolvers       > lua > unknown file 'node-pag.lua'

error loading file: node-pag.lua (aborting)

Indeed, the file is missing in the distribution (there's only 
node-pag.mkxl). Regards

fixed

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] update

2023-04-27 Thread Hans Hagen via ntg-context

On 4/27/2023 2:50 AM, lynx--- via ntg-context wrote:

Re: performing update(s)

New to conTeXt, have not performed a specific update prior to this.

My conTeXt installation is part of TeXlive-2023 (under Linux OS). Will 
the updates to ConTeXt be handled by tlmgr ?
Basically tex live is the yearly snapshot. I actually dont' know the 
rules for updating texlive but there are definitely updates. But as much 
relates there (like engines shared between macro packages) it can be 
that only macros get updated and not engines (also relates to multiple 
platforms) so fundamental changes to luatex as engine .. hard to predict.


But you can just install the lmtx installation alongside (it's small 
compared to tex live) and have the best of both worlds. The lmtx 
installation also has mkiv. It also comes with the fonts that match what 
we expect in context (as fonts get updated or changed).


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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___