Re: [NTG-context] Parallelizing typesetting of large documents with lots of cross-references

2020-12-03 Thread Hans Hagen

On 12/3/2020 12:04 PM, Stephen Gaito wrote:


- very large (1,000+ pages),


not that large, literate code is often verbatim so that doesn't take 
much runtime either



- highly cross-referenced documents,


ok, that demands runs


- with embedded literate-programmed code (which needs
   concurrent compiling and execution),


you only need to process those snippets when something has changed and 
there are ways in context to deal with that (like \typesetbuffer and 
such which only processes when something changed between runs)



- containing multiple MetaFun graphics,


those don't take time assuming effecitne metapost code
 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
___


Re: [NTG-context] Using ConTeXt-LMTX for modern Mathematically-Literate-Programming 1/2

2020-12-03 Thread Hans Hagen

On 12/3/2020 12:15 PM, Taco Hoekwater wrote:




On 3 Dec 2020, at 11:35, Stephen Gaito  wrote:

Hans,

As I said my desktop is elderly... it has a 2.8GHz processor, 16Gb of
DDR3 memory, and a couple of old SATA1 hard disks, and only 3Mb of CPU
cache...

... all well past its use by date for single threaded ConTeXt. ;-(

So one way to get better performance for ConTeXt is to invest in a new
ultra fast processor. Which will cost a lot, and use a lot of power
which has to be cooled, which uses even more power


Startup time can be improved quite a bit with an SSD. Even a cheap SATA
SSD is already much faster than a traditional harddisk. Doesn’t help
with longer documents, but it could be a fairly cheap upgrade.


also, an empty context run

\starttext
\stoptext

only takes 0.490 seconds on my machine, which means:

- starting mtxrun, which includes quite a bit of lua plus loading the
file database etc
- loading mtx-context that itself does some checking
- and then launches the engine (it could be intgerated but then we run 
into issues when we have fatal errors as well as initializations so in 
the end it doesn't pay off at all)
- the tex runs means: loading the format and initializing hundreds of 
lua scripts including all kind of unicode related stuff


so, the .5 sec is quite acceptable to me and i knwo that when i would 
have amore recent machine it would go down to half of that


now, making a tex run persistent is not really a solution: one has to 
reset all kinds of counters, dimensions etc wipe node and token space, 
etc an done would also have to reset the pdf output which includes all 
kind of housekeeping states ... adding all kind of resetters and hooks 
for that (plus all the garbage collection needed) will never pay back 
and a 'wipe all and reload' is way more efficient then


of course, when i ever run into a secenario where I have to creeate tens 
of thousands of one/few page docs very fast i might add some 'reset the 
pdf state' because that is kind of doable with some extra code but to be 
honest, no one ever came up with a project that had any real demands on 
the engine that could not be met (the fact that tex is a good solution 
for rendering doesn't mean that there is demand for it ... it is seldom 
on the radar of those who deal with that, who then often prefer some pdf 
library, also because quality doesn't really matter)


these kind of performance things are demand driven (read: i need a 
pretty good reason to spend time on it)



I can’t comment on how to speed up the rest of what you are doing,
but generally multi-threading TeX typesetting jobs is so hard as to
be impossible in practise. About the only step that can be split off
is the generation of the PDF, and even there the possible gain is
quite small (as you noticed already).


indeed, see above


Typesetting is a compilation job, so the two main ways to speed things
along are

1) split the source into independent tasks, like in a code compiler
that splits code over separate .c / .cpp / .m / .p etc. files,
and then combine the results (using e.g. mutool)

2) precompile recurring stuff (in TeX, that would mean embedding
separately generated pdfs or images)

right

(and we are old enough and have been around long enough to have some gut 
feeling about that)


Hans

ps. When it comes to performance of tex, lua, context etc it is no 
problem, when googling a bit, to run into 'nonsense' arguments of why 
something is slow ... so don't take it for granted, just ask here on 
this list


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


Re: [NTG-context] Placing extra bookmarks?

2020-12-02 Thread Hans Hagen

On 12/2/2020 12:10 AM, Bruce Horrocks wrote:

On 1 Dec 2020, at 16:37, Henning Hraban Ramm  wrote:



Am 01.12.2020 um 15:36 schrieb Bruce Horrocks :

I have \placebookmarks[chapter] in my doc and all is fine except that I'd like 
to force an extra bookmark at the top of the list that jumps to the cover page. 
However there is no chapter title, or other built in style on the cover.

I tried inserting \bookmark[chapter]{The Cover} but nothing happened - no 
error, no bookmark.

Any suggestions please? There's no need to bookmark to a specific point - just 
going to page 1 would be enough.


Did you enable interactions? \setupinteractions[state=start]

But when I recently tried to manually set some bookmarks instead of visible 
chapter titles, I also didn’t get any; didn’t investigate further yet.

there are some examples in the test suite (sections/bookmarks-*.tex)

You can specify bookmarks when you use \startsection etc an dalso add 
them any place to named lists.


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
___


Re: [NTG-context] How do I get rid of the ct and st ligatures in EBGaramond?

2020-12-02 Thread Hans Hagen

On 12/2/2020 5:54 PM, Joey McCollum wrote:
If you're using Octavio Pardo's version of EB Garamond 
(https://github.com/octaviopardo/EBGaramond12 
<https://github.com/octaviopardo/EBGaramond12>), then these ligatures 
are covered (along with the Th ligature) by the "dlig" (discretionary 
ligatures) feature, so you'll need to disable that. Unfortunately, this 
will also disable the Th ligature. This is a known, open issue for the 
font: https://github.com/octaviopardo/EBGaramond12/issues/20 
<https://github.com/octaviopardo/EBGaramond12/issues/20>.

One of these examples where opensource fails ...

https://github.com/octaviopardo/EBGaramond12
https://github.com/georgd/EB-Garamond

A while ago I replaced AB on my machine in oirdert to test some issue so 
now I have to replace it again? Which one is the real one? Which one is 
the original? Which one are we supposed to support / configure?


\definefontfeature[whatever][default][rlig=yes]
% \definefontfeature[whatever][default][rlig=yes,dlig=yes] % those st 
and ct ligs


\definefontfamily [english] [rm] [EB Garamond]   [features=whatever]
\definefontfamily [english] [mm] [Stix Two Math]

\setupbodyfont[english]

\starttext
fi fl ffi ffl ct st
\stoptext

Using the ones pointed from google fonts.

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
___


Re: [NTG-context] How do I get rid of the ct and st ligatures in EBGaramond?

2020-12-02 Thread Hans Hagen

On 12/2/2020 6:14 PM, T. Kurt Bond wrote:

It does help.  Thanks.

But how do I turn that font feature off in ConTeXt?

You forget to add a MWE ...

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
___


Re: [NTG-context] Using ConTeXt-LMTX for modern Mathematically-Literate-Programming 2/2

2020-12-02 Thread Hans Hagen

On 12/2/2020 11:43 AM, Stephen Gaito wrote:


Again, to my knowledge, Lua v5.4 has only one implementation (though
this implementation *can* be compiled for a very wide range of CPU's).


Lua has not many demands ... it can even run on tiny cpu's. It's all 
rather plain C code. (And in luametatex we have no c++ ... all is just C.)



Finally, the computational complexity of my proof engine, will be
comparable to MetaFun/MetaPost... which I suspect you would not
consider implementing in pure Lua. Some things are faster in C.


Hard to say ... I think that the parser / expansion machinery in mp is 
the bottleneck here (no fun to do that in lua). Redoing it in Lua also 
is asking for compatibility issues. (btw, extensions are done in lua 
anyway, as is the mp backend)



So yes I do need to implement it in ANSI-C wrapped in Lua (so that it
can be used from *inside* ConTeXt).


I would have to see the 'kind of code involved' in order to comment on 
that.


An option is to do most in lua and maybe some helpers for crititical 
code in C.

 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
___


Re: [NTG-context] Using ConTeXt-LMTX for modern Mathematically-Literate-Programming 1/2

2020-12-02 Thread Hans Hagen

On 12/2/2020 10:40 AM, Stephen Gaito wrote:


Many thanks for your swift and helpful comments.

After some *very crude* tests using the `luametatex` and `luametafun`
documents, I find that while I *can* stop effective processing at
various points in the LuaMetaTeX pipeline, the time difference overall
is not really significant enough to bother with this approach.

The principle problem is, as you suggested below, "stopping" the
pipeline at the PDF stage (using for example the `pre_output_filter`)
corrupted the `*.tuc` data which is for my purposes, critical.

Your comment was:


but keep in mind that multipass data is flushed as part of the
shipout (because it is often location and order bound)


For the record, using the `append_to_vlist_filter` callback, I did
manage to drastically reduce the "pages" (which were all blank, not
surprisingly).

However, on my elderly desktop from 2008, both callbacks essentially cut
only 6-8 seconds out of 18 seconds, for the `luametatex` document, and
190 seconds, for the `luametafun` document.


hm, on my 2013 laptop the luametatex manual needs 10 sec (i have all the 
fonts, so that includes a bunch) and a metafun manual should do about 20


a test on am M1 mini needs half those times as reported yesterday

i bet that on a modern desktop the luatex manual will do < 5 sec


In the case of the `luametafun` document, it is the MetaFun/MetaPost
processing which, of course, is taking a long time (as it should, the
graphics computations represent important but complex computations).


One run or many due to xref? Maybe your machine has no significant cpu 
cache? Do you run from disk or ssd? How much memory?



My ultimate goal is to parallelize the production of large, heavily
cross-referenced, ConTeXt documents... more on this in a future email...

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
___


Re: [NTG-context] Getting the filename which is being typeset

2020-12-01 Thread Hans Hagen

On 12/1/2020 6:55 PM, Otared Kavian wrote:

Hi Wolfgang,

Thank you for your explanations: I am wondering whether this kind of 
information could go into the wiki, and if yes what would be an appropriate 
title for that page (of course I'll do it).

However the two commands

\inputfilesuffix
\jobfilesuffix

put inside the file « myfile.tex » do not give the suffix « tex »: shoul dthey 
give « tex » or am I misintrepreting these commands?

tex is the default suffix in engines

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
___


Re: [NTG-context] Context install for Apple Silicon M1 mac mini

2020-12-01 Thread Hans Hagen

On 12/1/2020 6:17 PM, Otared Kavian wrote:

Hi Keith,

You may try to copy to your new machine the whole folder where you have 
installed LMTX on your old machine, and then run
context --make
there. Indeed if this works for your current LMTX folder you'll need someone to 
prepare a whole working folder of updated LMTX. As long as I have a PowerBook 
with the old chip (and running MacOS 14), I may do this for you and then put a 
zip file on Dropbox. However I may be too pushed to get a new M1 PowerBook in 
the future.
the trick is in the install script: we've added apple arm recognition 
there so assuming an updated install.sh one should be okay


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
___


[NTG-context] new upload

2020-12-01 Thread Hans Hagen

Hi,

I uploaded a new version. This time some cleanup of the backend, so 
let's see where I messed up this time.


The installer has been adapted so that an apple m1 machine is 
recognized. No native arm bins, that has to wait till we have some 
hardware available.


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
___


Re: [NTG-context] Install Problems with 64 bit ARM Linux

2020-12-01 Thread Hans Hagen

On 12/1/2020 4:05 PM, Mojca Miklavec wrote:

Dear Christian,

I remembered that I have an old Pine64 with Armbian 10 collecting dust
somewhere in a drawer.
I powered it up and it still works :) I guess we could build the binaries there.
So then we have, like with bsd, several versions? Bah, happy me that 
windows doesn't have that problem.


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
___


Re: [NTG-context] Adding syntax highlighting when typesetting from xml (asciidoc/docbook)

2020-12-01 Thread Hans Hagen

On 11/30/2020 9:08 PM, Mojca Miklavec wrote:

Hi,

A while ago Hans provided an example of typesetting a document from a
docbook source.

I'm attaching an over-simplified version of the initial module (a
somewhat more complete version exists, but it still needs lots of
work) and a minimum working example with XML.

I'm not sure how to extend the xml parser to support typesetting from
something like this:


Hello World in C and ConTeXt
#include
stdio.h

int main()
{
 printf("Hello, World!\n");
 return 0;
}
\starttext
Hello world!
\stoptext


Maybe using the vim module would be the right approach here (since the
built-in parser only has support for a limited set of languages), but
I'm not exactly sure about the implementation to achieve that goal.

I started with

\startxmlsetups xml:programlisting
 \dontleavehmode
 \startframedtext[background=color,backgroundcolor=lightgray]
 \obeylines
 \tt
 \xmlflush{#1}
 \stopframedtext
\stopxmlsetups

but something more is needed to properly handle new lines and to
properly pass the text to vim, for example.

Any hints welcome.

\startbuffer[demo]


\def\whatever#1{[whatever #1]}

\ctxlua{print("okay")}



bold



\stopbuffer

\usemodule[scite]

\startxmlsetups xml:initialize
\xmlsetsetup{#1}{doc|pre}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:initialize}

\startxmlsetups xml:doc
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:pre
\blank
\xmlprettyprint{#1}{\xmlattdef{#1}{type}{txt}}
\blank
\stopxmlsetups

\starttext
\xmlprocessbuffer{main}{demo}{}
\stoptext


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


Re: [NTG-context] Bug in lmtx bibliography (numerals in entry?)

2020-12-01 Thread Hans Hagen

On 12/1/2020 10:02 AM, Damien Thiriet wrote:

Hello,


My bibliography files compiles fine in mkiv, but hangs in lmtx
Here is the error message:

tex error   > tex error on line 30 in file ./Nation_rev_empire.mkiv:
Use of \btxshowentryinline doesn't match its definition

I forgot the \tolerant prefix in:

\permanent\tolerant\protected\def\btxshowentryinline[#1]#*[#2]%

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
___


Re: [NTG-context] Combinations not working as expected

2020-12-01 Thread Hans Hagen

On 12/1/2020 9:02 AM, Christoph Reller wrote:

Dear list,

In the latest version 2020.11.28 13:18 of ConTeXt LMTX, combinations 
don't seem to work as expected. Example:


\starttext
\startcombination[2*1]
   {first}{a}
   {second}{b}
\stopcombination
\blank[big]
\startcombination[1*2]
   {first}{a}
   {second}{b}
\stopcombination
\stoptext

The output is
image.png
The layout argument [2*1] or [1*2] does not seem to have an effect and 
the caption placement for "b" is strange.

Am I doing something wrong?

fixed in next upload


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


Re: [NTG-context] Using ConTeXt-LMTX for modern Mathematically-Literate-Programming 1/2

2020-11-30 Thread Hans Hagen
l and 
possible gain is


- tex: the context code is quite efficient, and tex is quite fast, so 
there's little to gain there (but as said one can write slow macros that 
spoil that game)


- lua: on the average lua is fast but garbage collection can be of 
influence (i need to see code in order to be able to tell if there is a 
gain there); the lua code in context is quite ok but for instance 
messing with node lists will always come at a cost (crossing the c 
boundary and such)


- pdf: the backend code in luametatex is somewhat slower than in luatex 
but we're gaining there (because in related areas we can do things 
different, although there is new functionality that when used also comes 
 at a price); but as far as i can tell a luametatex run here is on the 
average some 20% faster than a luatex run so the pdf generation slowdown 
gets kind of obscured by it




QUESTION: Are the "stages" I have identified major, computationally
expensive, "steps" in the overall ConTeXt "computation"?



basic typesetting (hyphenation, font handling): takes a bit of time, 
extra features that you use add some too: some timings are reported 
after a run so you get an idea


par building: unles hz is used, quite fast

page building: fast but depending on what features are enables 
finalizing the page can take some time


expansion: pretty fast on the average

summary: try to identify where the bottlenecks are

you can run with

  \enabletrackers[pages.timing]

(put it on cont-loc.mkxl somewhere in in texmf-local) and get timings 
per page (i have that enabled on my machine)


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
___


Re: [NTG-context] framedtext is (still) broken in LMTX

2020-11-29 Thread Hans Hagen

On 11/29/2020 10:33 PM, Rik Kabel wrote:
With ConTeXt  ver: 2020.11.28 13:18 LMTX  fmt: 2020.11.29 the 
*\framedtext* output is consistently *0.8\textwidth*. MkiV gives the 
expected result.


\starttext
\framedtext{Fail}\par
\framedtext[width=fit]{Fail}\par
\framedtext[width=3cm]{Fail}\par
\framedtext[width=0.8\textwidth]{Fine by accident}\par
\framedtext[width=\textwidth]{Fail}\par
\framed{Fine}\par
\framed[width=fit]{Fine}\par
\framed[width=3cm]{Fine}\par
\framed[width=0.8\textwidth]{Fine}\par
\framed[width=\textwidth]{Fine}\par
\stoptext

fixed in next upload (tomorrow)


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


Re: [NTG-context] Install Problems with 64 bit ARM Linux

2020-11-28 Thread Hans Hagen

On 11/28/2020 11:32 AM, luigi scarso wrote:



On Sat, Nov 28, 2020 at 11:18 AM Hans Hagen <mailto:j.ha...@xs4all.nl>> wrote:


looks nice (specs and such) indeed, maybe as a next tablet (i haven't
tested tex on the very old nexus in a while); probably a little faster
than the rpi 4


these also look interesting
  e.g.
https://tinker-board.asus.com/prod_tinker-board-2s.html 
<https://tinker-board.asus.com/prod_tinker-board-2s.html>

ah, an update, interesting indeed (also some flash on board)

(I just compiled luametatex for windows arm but I lack a MWHE for 
testing it.)


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
___


Re: [NTG-context] Install Problems with 64 bit ARM Linux

2020-11-28 Thread Hans Hagen

On 11/28/2020 11:02 AM, Christian Prim wrote:

Hi Mojca

sorry for being a few days late. I got the hardware just yesterday. It's 
a lenovo chromebook duet (Tablet), that can run linux apps. For the UK 
(you may select your country) it's here: 
https://www.lenovo.com/gb/en/laptops/lenovo/student-chromebooks/Lenovo-CT-X636/p/ZZICZCTCT1X 
<https://www.lenovo.com/gb/en/laptops/lenovo/student-chromebooks/Lenovo-CT-X636/p/ZZICZCTCT1X>


Very nice little piece of hardware. Small, great battery life and not so 
limited as other tablets (full linux access). Rather fast too...
looks nice (specs and such) indeed, maybe as a next tablet (i haven't 
tested tex on the very old nexus in a while); probably a little faster 
than the rpi 4


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
___


Re: [NTG-context] Install Problems with 64 bit ARM Linux

2020-11-28 Thread Hans Hagen

On 11/28/2020 10:52 AM, Mojca Miklavec wrote:

Dear Christian,

On Fri, 27 Nov 2020 at 20:50, Christian Prim wrote:


Is there a reason why the arm binaries for ARM Linux use version 2.29 of glibc?


They are being compiled on a Raspberry PI which kind of lacks
first-class 64-bit support (or at least that was the case when we set
up a builder on our build farm, about 9 months ago). I don't remember
seeing anyone even request those binaries before, and this is the
first complaint I see about the glibc-too-new issue on aarch64 (it was
common on the Intel platform, but there we can easily build on Debian
8 or 9).

I believe the RPI is currently running some recent version of Ubuntu
(it was set up by Hans; I would need to check to be sure, but it could
well be that it's 20.04).


Indeed, because older 64 bit made the machine freeze after a while. We 
run from usb (3) which is kind of evolving on the pi (at least we can 
now reboot the machine).



Judging from (random google hits)
 https://www.raspberrypi.org/forums/viewtopic.php?t=243985
 https://www.raspberrypi.org/blog/latest-raspberry-pi-os-update-may-2020/
it could be that May 2020 (which is precisely 6 months ago, in any
case later than when the builder was set up) has brought some better
news, an OS image that wouldn't require so much hacking to get it set
up and running.


Given the nature of these tiny machines running the latest greatest 
makes sense.



It's a pity that you didn't ask this question a few days ago, I
believe that Hans just reinstalled everything on that tiny device (SD
cards are a pain and like to wear out rather quickly if you keep
running build jobs and rewriting the same memory cells over and over
again; I thought we had set up an external disk properly, but well
...)


We have and previous versions then demansed some reflashing of the boiot 
eeprom and such (which effectively means that one has a os -- to do that 
-- on the tiny card and the external disk that we run the farm 
compilation on (I need to displace the machine and connect it to 
keyboard, screen etc to do that. Not really optimal for a headless 
approach.)



We could try again to get Debian 10 running on the RPI.


Not worth the trouble. I ran into too many hit for troubles with 64 bit 
while for ubuntu it sounded better.


One reason for doing the 64 bit was to see how well it works (4GB mem, 
performance, etc) just in case i want to use it for real.



Alternatively we could cross-compile, of course, but that's a bit more
painful to set up, and RPI 4 is certainly amazingly fast.


Or the user could update (can't one just symlink some lib to an older 
one? we only use simple stuff)



My actual debian buster installation is still on glibc-2.28. The x86_64 Linux 
binaries also use the older 2.28-version which is widely used among many 
distros. I would be very happy if I could install a 2.28-version on my ARM 
Linux box. Else I have to compile my own glic... or my own mtxrun...


A luametatex binary is needed.

Out of curiosity: what hardware do you run your linux distro on?
(btw, i think a 32 bit arm bij should run on the 64 right, and the 32 
bit is still old debian)


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
___


[NTG-context] new lmtx

2020-11-27 Thread Hans Hagen

Hi,

A new upload ... a few lua files cleaned up (stale code removed and so) 
... hopefully for the best.


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
___


Re: [NTG-context] Setting and measuring boxes TeX/Lua

2020-11-27 Thread Hans Hagen

Hi Jano,

It's not clear to me what you want to measure when but here is a weekend 
playground (you're locked down anyway).


\def\MacroJano#1%
  {\writestatus{JANO}{ONE}
   \setbox0=\hbox\bgroup\xmlflush{#1}\egroup}

\startluacode
function document.FunctionJano(id)
context.writestatus("JANO","ZERO")
token.expand_macro("MacroJano",true,id)
context("%p",tex.box[0].width)
context.writestatus("JANO","TWO")
end
\stopluacode

\startbuffer[doc]


one
one two
one two three

\stopbuffer

\startxmlsetups xml:name
\xmlsetsetup{#1}{*}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:name}

\startxmlsetups xml:section
width: \ctxlua{document.FunctionJano("#1")}\par
\stopxmlsetups

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups

\starttext

\xmlprocessbuffer{xml:name}{doc}{}

\stoptext

A clue: token.expand_macro will kind of 'run a local tex job'.

If this works for you. you know the price you have to pay ... wikify

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
___


Re: [NTG-context] mathmatrix and internal lines

2020-11-27 Thread Hans Hagen

On 11/27/2020 10:07 AM, Otared Kavian wrote:

Hi Hans,

Thanks for your insight!
Indeed I'll wikify what you explained, once I have tested it with the next 
upload. Would  \HL and \VL be also available in mkiv ?

Dunno yet ... it's not that hard but I'm in lmtx mode now.

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
___


Re: [NTG-context] question about frames

2020-11-26 Thread Hans Hagen

On 11/26/2020 10:03 PM, Pablo Rodriguez wrote:

On 11/26/20 5:26 PM, Wolfgang Schuster wrote:

Pablo Rodriguez schrieb am 25.11.2020 um 22:43:

[...]
Which is the way to avoid any vertical space between frames?


Variant 1:

 \offinterlineskip}


Many thanks for your reply, Wolfgang.

As always, your solution is straight to the point and works like a
charm. And it’s also highly instructive.

This is the first time I see \offinterlineskip. Thanks to “TeX for the
Impatient”, I see that this is a TeX command.


beware, it's a macro, not a primitive (and context has a bit different 
definition)


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
___


Re: [NTG-context] mathmatrix and internal lines

2020-11-26 Thread Hans Hagen

On 11/26/2020 8:43 PM, Otared Kavian wrote:

Hi Jean-Philippe,

A few weeks ago I saw briefly the discussion about Hans' message regarding 
\noalign and the the new definitions of \HR and \VR that you are sending. 
Indeed your solution works great !
Just for the case other people may have the same question about writing block 
matrix, I copy below the whole example which can be found later in the mail 
archive.
(For mkiv, I don't know how to do the same thing…).


The \noaligned permits a \protected definition. Otherwise one has to do 
something


\def\VR{\noalign\bgroup
  that command then does the rule and ends the noalign. Also, that one 
cannot be \protected (a pitty in case one uses \expanded or so)


So ... a multistep approach. Plenty of that in mkiv.


%%% begin block-matrix.tex
% in LMTX defining \HR and \VR to create block matrices:
\pushoverloadmode
\noaligned\tolerant\protected\def\HR[#1]{\noalign{\hrule #1}}
\popoverloadmode

\def\VR{\dosingleempty\doVR}
\def\doVR[#1]{\NC \hskip-0.5em \vrule #1 \hskip-0.5em \NC}


given the \HR definition that should be

\tolerant\protected\def\VR[#1]{\NC ...\NC}


\definemathmatrix[mymatrix]
[left={\left(\,},
right={\, \right)}]

\starttext  

\startformula
\startmymatrix
\NC A \VR  B \NR
\HR
\NC C \VR  D \NR
\stopmymatrix
\stopformula

\stoptext


Anyway, a feature like this should be in sync with other table 
mechanisms, so


\definemathmatrix
  [mymatrix]
  [left={\left\lparent\thinspace},
   right={\thinspace\right\rparent}]

\starttext

\startformula
\startmymatrix
\NC A \VL  B \NR
\HL
\NC C \VL  D \NR
\stopmymatrix
\stopformula

\startformula
\startmymatrix
\NC A \VL[3,green]  B \NR
\HL[10,red]
\NC C \VL  D \NR
\stopmymatrix
\stopformula

\stoptext

A bit more code needed but the next upload will have it. Of course you 
have to wikify it.


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
___


Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Hans Hagen
mirror/commits/
wiki : http://contextgarden.net
___




--

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


Re: [NTG-context] new upload

2020-11-26 Thread Hans Hagen

On 11/26/2020 6:07 PM, luigi scarso wrote:



Il Gio 26 Nov 2020, 18:00 Hans Hagen <mailto:j.ha...@xs4all.nl>> ha scritto:


On 11/26/2020 5:10 PM, luigi scarso wrote:
 >
 >
 > On Thu, Nov 26, 2020 at 5:00 PM Hans Hagen mailto:j.ha...@xs4all.nl>
 > <mailto:j.ha...@xs4all.nl <mailto:j.ha...@xs4all.nl>>> wrote:
 >
 >       Of course, if they care about luatex cs support they
 >     could send an M1 mini to Mojca for the compile farm for some real
 >     testing.
 >
 >
 > very likely luatex will run full native on M1 on next texlive,
following
 > http://www.tug.org/mactex/aboutarm.html
<http://www.tug.org/mactex/aboutarm.html>
 > <http://www.tug.org/mactex/aboutarm.html
<http://www.tug.org/mactex/aboutarm.html>>
that's with universal binaries (as happened before when apple switched
from powerpc to intel)


Full native:
"""
Full native Arm support will arrive with MacTeX-2021 next spring.
"""


sure, but by using a unversal bin:

from 2021 on they will contain both Intel and Arm code packaged together 
as a universal binary. Thus MacTeX will support Intel and Arm machines 
on an equal footing for many years to come.



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


Re: [NTG-context] new upload

2020-11-26 Thread Hans Hagen

On 11/26/2020 5:10 PM, luigi scarso wrote:



On Thu, Nov 26, 2020 at 5:00 PM Hans Hagen <mailto:j.ha...@xs4all.nl>> wrote:


  Of course, if they care about luatex cs support they
could send an M1 mini to Mojca for the compile farm for some real
testing.


very likely luatex will run full native on M1 on next texlive, following
http://www.tug.org/mactex/aboutarm.html 
<http://www.tug.org/mactex/aboutarm.html>
that's with universal binaries (as happened before when apple switched 
from powerpc to intel)


i suppose the buildnot can generate small arm M1 only bins

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
___


Re: [NTG-context] new upload

2020-11-26 Thread Hans Hagen

On 11/26/2020 4:26 PM, Keith McKay wrote:

Hi,

I'm planning in the next few weeks to retire my 2012 16GB Mac mini which 
has served me well with ConTeXt (and other software) over these past few 
years. I was planning on getting the new entry level MAC min M1 with 8GB 
unified memory but I see that there will be no ConTeXt binaries for 
these new M1 chip Macs. Would it be possible for a ConTeXt user like 
myself to build the binaries on my proposed new Mac? I'm not a computer 
professional.
At some point yes  (because once stable the code will be in the 
distribition) but even then you probably need to mess with compilers


https://developer.apple.com/documentation/xcode/building_a_universal_macos_binary

Maybe Mojca has to configure the build to either generate arm bins (in 
addition) or universal apple bins (of course these are larger).


We actually discussed it before but apple has been kind of secretive 
about all this. Of course, if they care about luatex cs support they 
could send an M1 mini to Mojca for the compile farm for some real testing.


Btw, aren't intel bins supposed to run on the M1 in some emulation mode?

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
___


Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Hans Hagen

On 11/26/2020 4:09 PM, Keith McKay wrote:

Hi,

I have been using xpart and ypart to extract these values from pairs of 
points in a path but I wasn't getting the correct result. I was expecting:


pair (2cm, 11cm) to give xpart 2 and ypart 11

However I was getting:

pair (2cm, 11cm) -> xpart 56.6929 and ypart 311.8096

After much head scratching and reading the MetaPost and MetaFun manuals, 
I realised that the units of xpart or ypart are in Postcript points or 
Big Points (bp), and 1 bp is 1/72 of an inch, and thus to get the values 
of xpart or ypart in cm I would have to use a correction factor. I had 
made the assumption that since the x and ypart in the pair was in cm 
that the result would be in cm, but I see now that this is not the case. 
Will I have to continue doing this or is there some magic within MetaFun 
which takes account of the units in a pair and outputs the result of x 
and ypart in the same units?


The MWE belows shows what I have been doing.


cm is not really a unit but a multiplier

cf := 72/2.54; %Converts points/in to points/cm%

message(cm);
message(cf);




Thanks

Keith McKay

%%% MWE %%%

\setuppapersize [A5, landscape][A4, portrait]

\usecolors[crayola]

\starttext

\startMPpage

StartPage;

width := PaperWidth ; height := PaperHeight ; unit := cm ;

numeric squig;

pair a[]; a0 = (2cm,11cm); a1 = (4cm,10cm); a2 = (6cm,9cm); a3 = (8cm,8cm);

show xpart a[0], ypart a[0]; %Example of result from x and ypart before 
applying correction factor (cf) %


cf := 72/2.54; %Converts points/in to points/cm%

path pp;

for i = 0 step 1 until 3:

pp := ((xpart a[i])/cf*cm, (ypart a[i])/cf*cm);

for squig = 1 step 1 until 15:

xcoord := uniformdeviate(1) - 0.5 + (xpart a[i]/cf);

ycoord := uniformdeviate(1) - 0.5+ (ypart a[i]/cf);

pp := pp .. {curl 100}(xcoord*cm, ycoord*cm);

endfor;

pp := pp --- cycle;

if i < 3 :

pp := pp --- ((xpart a[i+1]/cf)*cm, (ypart a[i+1])/cf*cm);

fi;

f :=((1.4 - 0.6) * uniformdeviate(1)) + 0.8; % Factor to lighten/darken 
colour %


draw pp withpen pencircle xscaled 0.5mm yscaled .1mm rotated 45 
withcolor (f[white,\MPcolor{BurntSienna}]);


endfor;

StopPage;

\stopMPpage

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




--

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


Re: [NTG-context] Strange bug with obayspaces and tagging

2020-11-26 Thread Hans Hagen

On 11/26/2020 10:47 AM, Christoph Reller wrote:

Hi,

With the currently latest version of ConTeXt LMTX 2020.11.25 21:42, this 
MNWE fails with the following error message:




\setuptagging[state=start]
\starttext
\obeyspaces\obeylines
   patch
\stoptext



tex error       > tex error on line 4 in file ./scratch1.tex: Valid 
keyword expected, likely 'plus'


   pa
     tch

1     \setuptagging[state=start]
2     \starttext
3     \obeyspaces\obeylines
4 >>    patch
5     \stoptext



This may be a bug in the tagging feature.

i'll fix it

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


Re: [NTG-context] Setting and measuring boxes TeX/Lua

2020-11-26 Thread Hans Hagen

On 11/25/2020 10:28 PM, Jano Kula wrote:

Hello Hans!

On Wed, 25 Nov 2020 at 21:25, Hans Hagen <mailto:j.ha...@xs4all.nl>> wrote:


\startluacode
context.stepwise (function()
      context.step()
end)
\stopluacode


Thank you very much!

I was trying context.stepwise several times (and \dowithnextbox, 
\nextboxht and other things). I bet there was no example of empty 
context.step().


The usage was: stepping in TeX end with 
context.step("\\texcommands\\with\\doubleslashes") without leaving Lua.

What is the purpose of empty context.step()? Knocking on TeX's door?

no, kind of quit, goto tex and then pickup again (coroutine magic)

(this mechanism is already kind of old, there are also other cheats 
possible)


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
___


Re: [NTG-context] Setting and measuring boxes TeX/Lua

2020-11-25 Thread Hans Hagen

On 11/25/2020 7:31 PM, Jano Kula wrote:

Hello!

I would like to set framed boxes, measure their dimensions and proceed 
based on the measurement. It is a combination of TeX and Lua ends.


  * Boxes are set on the TeX side. Stacking boxes (hbox, framed, vbox)
in Lua looked too complex.
  * The content of the inner box is set on the Lua side (some computations).

On TeX side boxes and their dimensions are accessible, but not at Lua 
side, until luacode is finished (iterations over boxes happen here). I 
would say Hans already named the problem in the list: /that is always 
tricky as what happens is postponing till the group ends/.


Do you have an idea how to expand the box sooner or would you use a 
different approach?


Sorry for longer MWE (attached also).

Thank you,
Jano

\def\StartBox{\setbox0=\hbox\bgroup% open hbox
                 \framed[frame=on]\bgroup% open framed
                     \vbox\bgroup% open vbox (\par needed)
              }
\def\StopBox{\egroup\egroup\egroup% close vbox, framed, hbox
              \setvariable{Test}{Height}{\the\ht0}%
             }%

\startluacode
ctx = context

function TestBox()
     ctx("TeX Box: ")    ctx.copy(false,0)ctx.par()
     ctx("TeX Getvar: ") ctx.getvariable("Test", "Height")ctx.par()
     var = tokens.getters.macro(tokens.getters.macro("??variables") .. 
"Test:Height")

     ctx("Lua Type: ")   ctx(type(var))ctx.par()
     ctx("Lua Value: ")  ctx(var)ctx.par()
end
\stopluacode

\starttext

\startluacode
     ctx.bold("First luacode (more boxes)")ctx.par()
     ctx.StartBox()
     ctx("AAA")ctx.par()
     ctx("BBB")ctx.par()
     ctx.StopBox()
     TestBox()
     ctx.StartBox()
     ctx("CCC")ctx.par()
     ctx.StopBox()
     TestBox()
\stopluacode

\blank[4*big]

\startluacode
     ctx.bold("Second luacode (last content of box0)")ctx.par()
     TestBox()
\stopluacode

\stoptext

\startluacode
 context.stepwise (function()
ctx.bold("First luacode (more boxes)")ctx.par()
ctx.StartBox()
ctx("AAA")ctx.par()
ctx("BBB")ctx.par()
ctx.StopBox()
context.step()
TestBox()
context.step()
ctx.StartBox()
ctx("CCC")ctx.par()
ctx.StopBox()
context.step()
TestBox()
context.step()
end)
\stopluacode

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


Re: [NTG-context] Issue with tex.romannumeral output

2020-11-25 Thread Hans Hagen

On 11/25/2020 7:51 PM, Joseph wrote:

Dear list,

Following MWE outputs only ‘m’ characters (with latest upload).

ah, some left over from a test, i'll fix it

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
___


Re: [NTG-context] RE : RE : RE : RE : Issue with grid

2020-11-25 Thread Hans Hagen

On 11/25/2020 6:10 PM, Joseph wrote:

\setupindenting[yes, next, 1em]

\starttext

\input knuth

\stoptext
hm, maybe i did somethign wrong. i'll check it, but indeed for now you 
can just use the patch


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
___


Re: [NTG-context] Another LMTX small issue

2020-11-25 Thread Hans Hagen

On 11/25/2020 2:42 PM, Rik Kabel wrote:
The following code generates an error message in the log under LMTX 
2020.11.24 19:02 but compilation continues with no apparent issue.


\starttext
\framedtext{abc}
\stoptext

should be ok in next upload (later today)

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


Re: [NTG-context] accessing tex variable on lua side

2020-11-25 Thread Hans Hagen

On 11/25/2020 11:54 AM, Jano Kula wrote:

Hello,

running in circles I have to give up on such an easy thing as passing a 
tex variable to lua (knowing everything is stored in lua).


\setvariable{test}{something}{}
\starttext
\getvariable{test}{something}\par
% how to access the variable on lua end?
\startluacode
-- var =
\stopluacode
\stoptext

Never give up ...

\starttext

\setvariable{test}{something}{}

\getvariable{test}{something}\par

\meaning\getvariable

\startluacode

print(">>",tokens.getters.macro(tokens.getters.macro("??variables") .. 
"test:something"))

\stopluacode

\def\MyVariableSomething{}

\startluacode
print(">>",tokens.getters.macro("MyVariableSomething"))
\stopluacode

\stoptext

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


Re: [NTG-context] new upload

2020-11-25 Thread Hans Hagen

On 11/25/2020 10:12 AM, Giulio Bertellini wrote:


Great. Made a clean install from scratch and now metafun manual compiles 
great at first run:


mkiv lua stats  > used engine:*luametatex version: 2.0803, functionality 
level: 20201123*, format id: 547, compiler: gcc
mkiv lua stats  > tex properties: 740024 hash slots used of 2097152, 
approximate memory usage: 44 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 140 MB, 
ctx: 123 MB, max: 123 MB, hash chars: min(64,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 20.182 seconds, 396 processed pages, 396 
shipped pages, 19.621 pages/second
Looks ok to me given the thousands of graphics. What are the specs of 
the machine?


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
___


Re: [NTG-context] LMTX and descriptions

2020-11-24 Thread Hans Hagen

On 11/24/2020 7:44 PM, Wolfgang Schuster wrote:


This is a different problem which is unrelated to the description.
I'll update when Wolfgang has found some more glitches. (nearly all high 
level commands that take arguments get/got adapted this month so I bet 
that there are some more. No functional changes, only mess ups.)


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
___


[NTG-context] new upload

2020-11-24 Thread Hans Hagen

Hi,

A new upload. Mojca upgraded the build manager and we also updated some 
machines so all binaries (platforms) should be in sync now. (No binaries 
for apples M1 and microsofts SQ2 as we don't have these machines, so 
just good old intel and arm it is.)


On my rusty laptop the luametatex manual takes between 10 and 10.5 sec 
(depending on load). On the raspberry pi 64 bit it takes 32.5 sec 
(ubuntu, ssd on usb 3). The Windows Linux Subsystem (version 1) takes 
some 11.5 seconds and the domotica fitlet with a low power AMD A10 needs 
27.5 sec.) The ratios match measurements of a while ago. In the meantime 
the format file got smaller, memory more dynamic and the mem footprint 
also smaller. I expect a modern intel laptop cpu to need some 5 seconds 
and a decent desktop less but who knows. It's not easy to squeeze out 
more (the bottleneck is in the lua code as the (con)tex(t) code is 
pretty efficient so we pay a price for flexibility).


(In the process I saw that I bugged the xetex logo but that has to wait 
for a next upload. Hardly critital I suspect.)


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
___


Re: [NTG-context] RE : upload

2020-11-23 Thread Hans Hagen

On 11/24/2020 1:47 AM, Rik Kabel wrote:

\version[draft]
\starttext
Hi!
\stoptext


for now use \setupversion


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


Re: [NTG-context] RE : upload

2020-11-23 Thread Hans Hagen

On 11/23/2020 9:42 PM, Joseph wrote:

After running install.bat I see error :

new attempt


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


Re: [NTG-context] upload

2020-11-23 Thread Hans Hagen

On 11/23/2020 8:21 PM, Otared Kavian wrote:

Hi Hans,

On MacOS X I obtain the same error when doing:
context --make --all
(or mtxrun --make --all).
The error is

csname overload > fatal error, protection level 4, control sequence 
'textcontrolspace', properties 'immutable', file 'enco-ini.mkxl', line 315
yes, i'll make new zip btu i also found out that the build server is n't 
running so we get the wrong binaries (i kind of assume it runs and 
didn't check)


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
___


Re: [NTG-context] upload

2020-11-23 Thread Hans Hagen

On 11/23/2020 7:29 PM, Christian Prim wrote:

Hi



Do I miss something?

looks like some old files are still present

i'll fix it

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
___


[NTG-context] upload

2020-11-23 Thread Hans Hagen

Hi,

I uploaded a next iteration of lmtx. From now on there are dedicated sub 
directories for mklx and mpxl, which is an indication that we're on the 
way to a full code split.


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
___


Re: [NTG-context] Adding Custom PDF Property

2020-11-23 Thread Hans Hagen

On 11/23/2020 11:26 AM, Ramkumar KB wrote:

Hello List,

I am looking for a way to add custom PDF properties to the document.

 From the docs, I can see how to add standard properties (a.k.a headers) 
like Title, Author, Subtitle and Keywords - 
https://wiki.contextgarden.net/Interaction#PDF_Headers 
<https://wiki.contextgarden.net/Interaction#PDF_Headers>


But I would like to add my own custom Name-Value properties (similar to 
what ConTeXt, by default, adds like `ConTeXt.Url=www.pragma-ade.com 
<http://www.pragma-ade.com>` when I open the document in Adobe Reader).

\pdfbackendsetinfo{foo}{bar}


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


Re: [NTG-context] RE : RE : Issue with grid

2020-11-23 Thread Hans Hagen

On 11/23/2020 11:13 AM, Joseph wrote:
Yes, I refer to text not being aligned on the grid. This only happens if 
\blank is used it seems, and text sits above where it’s supposed to (ie 
amount of space being skipped vertically is smaller, ie \blank[line] 
skips less than 1 line). I attach pdf I get. Could reduce MWE a bit.


\showgrid

\setuplayout[grid=both]

\definefontfamily[mainfont][serif][EBGaramond][features=default]

\setupbodyfont[mainfont, 9pt]

\starttext

\blank[line]Fin des psalmes.

\blank[line]Fin des psalmes.

\dorecurse{8}{\input knuth

}

\stoptext

It looks ok here< I also checked the latest eb (less fonts now it seems).

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
___


Re: [NTG-context] RE : Issue with grid

2020-11-23 Thread Hans Hagen

On 11/23/2020 9:31 AM, Joseph wrote:
I don’t understand the answer I am afraid, I’ve never seen any issue 
with grid alignment before (I don’t use columns either, and I changed 
nothing at all).
you talk about grid alignment i.e. text not sitting on the grid ... this 
is something that relates to font and line distance properties


if on th eother hand you talk about when a pag ebreak occurs pablos 
answer points to the solution


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
___


Re: [NTG-context] Issue with grid

2020-11-22 Thread Hans Hagen

On 11/22/2020 5:03 PM, Joseph wrote:


\definefontfeature[base][mode=node]

\definefontfamily[mainfont][serif][EBGaramond][features=base]
Really? No features enabled at all? EBGaramond is quite loaded with 
features. Just use 'default'.


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
___


Re: [NTG-context] Issue with grid

2020-11-22 Thread Hans Hagen

On 11/22/2020 5:03 PM, Joseph wrote:

Dear list,

In some cases with latest LMTX I see text not aligned to grid. MWE 
reproduces the problem (could not reproduce with default font).


Typesetting MWE using online ConTeXt page shows correctly aligned text 
on grid.


\showgrid

\setuplayout[grid=both]

\definefontfeature[base][mode=node]

\definefontfamily[mainfont][serif][EBGaramond][features=base]

\setupbodyfont[mainfont, 9pt]

\starttext

\blank[line, samepage]Fin des psalmes.

\blank[line, samepage]Fin des psalmes.

\dorecurse{8}{\input knuth

}

\stoptext

If number of itérations is changed from 8 to 7) problem does not appear, 
seems to be linked to the fact page is fully filled with lines.


If one of the \blank lines is commented out problem does not occur either.


It might have to do with the fact that the height/depth ratio that is 
used doesn't match well with the ascenders/descenders of the font that 
you use. The defaults are:


\setupinterlinespace
  [height=.72,
   depth=.28,
   line=2.8\exheight]

so you can play with these. The 72:28 ratio works ok for most fonts but 
sometimes need to be adapted. Sometimes the 2.8 is not enough.


(makes me wonder: i can issue a warning when a font can overrun)

(normally grid snapping should catch is but columns are kind of different)

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
___


Re: [NTG-context] Global pagination optimisation

2020-11-22 Thread Hans Hagen

On 11/22/2020 7:58 PM, Joseph wrote:

Dear list,

Out of curiosity.

Perhaps a question already discussed but wondering if there were plans 
to implement eventually in LMTX an equivalent of framework described in 
article 2018-01-FMi-CI-Journal-28454894_as_submitted.pdf 
(latex-project.org) 
<https://www.latex-project.org/publications/2018-01-FMi-CI-Journal-28454894_as_submitted.pdf> 
or something similar ?
When cooking up solutions I normally start from practical cases, not 
from something like discussed in there. I'm more a 'play with something 
and see how it works out' than 'read all kind of theoretical stuff' (I 
simply don't have the patience for reading up on that). So, context 
evolved from use cases and solutions needed. Often solutions then go 
through some iterations. It helps that right from the start context was 
set up to make extensions relatively easy. Theoretical discussions on 
typesetting are wasted on me, sorry. (For the record: I read a lot, on 
all kind of topics, but the last time I read something about 
typographics is more than a decade ago.)


Now, when discussing document wide optimizations ... I played with that 
long ago but kind of stopped when it became clear that it's too easy to 
get oscilliation. An interesting suggestion Herman Zaph made when we 
discussed this was that like horizontal hz (expansion in tex) one could 
also do that vertical: no one will notice it, no matter what folks claim 
to notice. That would actually solve quite some issues. It was easy to 
make a quick demo then and I might actually bring that into context (if 
I can find back the code). Trial and error is my friend (of course with 
a dose of thinking and feedback).


It is no big deal to cook up a solution for some subclass of well 
defined problems (say: text only with an occasional display element) but 
it happens that tex is seldom the candidate for that. Problems show up 
when you have plenty of extra elements, backgrounds, floats, notes, etc. 
All kind of tricky interactions and constraints. My personal opinion is 
that there are no perfect automatic solutions for cases where in fact 
the visual appearance matters more: that is why desk top publishing 
works ok for complex layouts (it just pays off). It all has to do with 
the solution space. Just use the right tool for the job.


Actually, before looking at complex cases it probably makes more sense 
to make simple cases look nice and probably the majority of documents 
one can find on the web done with tex look quite average. So, from the 
context perspective it makes more sense to chellenge users to make nice 
documents and provide the means for that, even it occasionally means 
some hand work.


Now, with respect to future plans for context / lmtx: I do have some 
things on the agenda because there are some half finished experimental 
mechanisms in context that could use a bit of help from the engine, but 
first I want to finish what we currently have. But, as mentioned: the 
starting point is 'user demand' and 'useability' (there are for instance 
some things Thomas and I look at occasionally wrt parallel texts that we 
need to pick up). And, as with all in context, it starts by just looking 
at what is needed, and playing around to get a feeling. Personally it's 
more about (visual) fun than about neccessity.


So: feel free to come up with demands but keep it practical and keep 
useability and constraints in mind and perspective.


Hans

ps. When it comes to columns ... I don't see much of a future in them, 
because on devices one doesn't have the constraints of paper: why 
complicate ones live. We moved on in other areas too. Actually, if a pdf 
viewer could handle a page with height 5 meter well (wrt go back) then 
each chapter would be one page and we got rid of floats too. Ok, one 
could also use html then -) Of course in magazines, news papers, large 
size stuff, separate text flows make sense but that is typically not the 
domain where tex makes muich sense.



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


Re: [NTG-context] Typesetting without interpunctation and interword space

2020-11-22 Thread Hans Hagen

On 11/22/2020 11:55 AM, juh wrote:

Hi all,

I want to typeset poems in a special way.

I want to achieve something like Capitalis quadrata which was used by
the Romans in stone.

See here:
https://de.wikipedia.org/wiki/Capitalis_quadrata#/media/Datei:Capitalis_Quadrata1.png

One stream of letters without spaces and interpunctation.

The input files I have to use are written as usually:

This is a line,
that is a line,
and a third line as well

I want to typeset the whole poem in the Capitalis quadrata way:

THISISALINETHATIS
ALINEANDATHIRDLIN
EASWELL

The whole poem forms one block of upper case letters.

No interword spacing.

I guess that I can make my hands dirty with lua and write a filter that skips
all interpunctation and spaces, converts the whole text to lower- or uppercase
and after this use a special font with nice upper case letters.

But I need a special hyphenation that hyphenates just were the
line ends.

Any hints how to achieve this?

An lmtx solution:

\starttext

\definestartstop
  [CapitalisQuadrata]
  [setups=foo]

\startsetups foo
\pushoverloadmode % needed when protection enabled
\def\obeyedline{\removepunctuation\endgraf}
\obeylines
\nospacing
\WORD
\popoverloadmode
\stopsetups

\start[CapitalisQuadrata]
This is a line,
that is a line,
and a third line as well
\stop

\stoptext




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


Re: [NTG-context] Problem with setupcharacterspacing and comma

2020-11-21 Thread Hans Hagen

On 11/21/2020 4:57 AM, Rik Kabel wrote:

Hello all,

Playing with define/setup/set characterspacing, I have come across some 
odd, perhaps buggy, behavior. This applies to both MkIV 2020.11.19 11:23 
and LMTX 2020.11.19 11:28.


The problem is that character spacing is not effected for the left side 
of the comma character. It is handled as expected for other characters 
that I have tested, but I have not performed extensive tests.


Example code:

\definecharacterspacing[Test]
\setupcharacterspacing [Test] ["002C] [left
=.25,right=1,alternative=1] % ,
\setupcharacterspacing [Test] ["0065]
[left=0.5,right=1,alternative=1] % e
\setupcharacterspacing [Test] ["003B]
[left=0.5,right=1,alternative=1] % e
\startTEXpage[offset=1em]
abc; def, g

\setcharacterspacing[Test]abc; def, g
\stopTEXpage

remove the space between "left" and "="

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


Re: [NTG-context] bizarre bug in xml

2020-11-21 Thread Hans Hagen

On 11/21/2020 2:09 AM, Pablo Rodriguez wrote:

On 11/20/20 10:52 PM, Wolfgang Schuster wrote:

[...]
Optional arguments (e.g. plus/minus values for \hskip) for commands are
handled different in LMTX but it was always recommended to add \relax
after the last value.


Hi Wolfgang,

the same would apply to \vskip, wouldn’t it?
also for \hrule and \vrule (and in pdftex/luatex some backend related 
primitives); primitives like \hbox have their keyword scan terminated by 
a leftbrace token


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
___


Re: [NTG-context] \noindentation not working

2020-11-20 Thread Hans Hagen

On 11/20/2020 6:27 PM, Wolfgang Schuster wrote:

Pablo Rodriguez schrieb am 20.11.2020 um 17:41:

Dear list,

I have the following MWE:

   \showframe\showgrid
   \setupindenting[yes, always, big]
   \starttext
   \noindentation
   a

   a
   \stoptext

Using LMTX (2020.11.19 11:28), I get indentation with \noindentation.

Could anyone confirm this?


Yes, something is wrong.

 begin example
\showgrid

\starttext

\parindent\emwidth

a

\everypar{\setbox\scratchbox\lastbox}
a

\stoptext
 end example


Ah, okay. We have normalization enabled now. That means two things:

- instead if a hbox being used for indentation (with >= 0 width) we now 
have a skip (with no stretch but that might become an option some day); 
the tex engine uses a hbox because it is easier on the par builder (less 
checking, as glue, being a valid breakpoint, involves quite a bit)


- after breaking a paragraph into lines the result is normalized, that 
is: we have left/right hang, left/right skip. left/right parfilskip 
instead of a mix of either or not present left/right skip, and shifted 
boxes in case of some hang features (again, the original approach is 
easier for the engine, but machines are fast enough and have plenty of 
memory so we can stop worrying about it)


The ideas is that this way we can make some lua nodelist hackery more 
elegant (but I need to catch up with that: most tex files are now split 
in mkiv and lmtx and next comes the lua files after which we can start 
some more drastic upgrading ... keep in mind that quite some code is 
from more than a decase ago, evolved a bit but seldom changed conceptually).


Here's a fix:

\unprotect

\def\spac_indentation_remove
  {\ifzeropt\parindent \else
 \begingroup
 \unskip % we also need to check for the subtype
 \setbox\scratchbox\lastbox % we also need to check for the
 \endgroup
   \fi}

\protect

(we might need adapt some more code); actually more correct would be:

\def\spac_indentation_remove
  {\ifzeropt\parindent \else
 \begingroup
 \ifnum\lastnodetype=\gluenodecode
   \unskip % we also need to check for the subtype
 \orelse\ifnum\lastnodetype=\hlistnodecode
   \setbox\scratchbox\lastbox % we also need to check for the subtype
 \else
   % forget about it
 \fi
 \endgroup
   \fi}

(it actually makes sense to have a native \unindent primitive but we can 
simulate that in lua)


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
___


Re: [NTG-context] LMTX MkIV difference in expansion

2020-11-19 Thread Hans Hagen

On 11/20/2020 12:18 AM, Rik Kabel wrote:

You are right about not quite understand.

Does this mean that I can have the same definitions in MkIV and LMTX 
(after some future update), or should I hunt down the \defines in both, 
or that I should fork (or mode test) my source environment files, one 
set for LMTX and one for MkIV?

Kind of

\protected\def\MyCommand#1{\tricky{?}\stuff{!}}

\def\MyKeyword{tricky stuff}

because you want to always expand MyKeyword and in controlled cases 
\MyCommand.


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
___


Re: [NTG-context] LMTX MkIV difference in expansion

2020-11-19 Thread Hans Hagen

On 11/19/2020 9:41 PM, Wolfgang Schuster wrote:

Rik Kabel schrieb am 19.11.2020 um 21:20:

Another LMTX/MkIV difference, this time with expansion:

    \define\Align{yes}
    \starttext
    \startalignment[\Align]
     This works with MkIV but fails with LMTX, complaining: {\tt
     tex error on line 3 in file G:/expand.mkvi: The file ended
     when scanning an argument.}
    \blank
    It works in both when \tex{def} or \tex{defineexpandable} is
    used instead of \tex{define}.
    \blank
    What changed?
    \stopalignment
    \stoptext

It may well be that I have been abusing some laxity in MkIV and that 
LMTX is a bit stricter in what it accepts, but I would like to know if 
this is an expected difference.


You have to wait for Hans to get an answer but here is a minimal example.

\starttext

\protected\def\testparameter{test}
%\def\testparameter{test}

\def\test[#1]%
   {\expandafter\let\expandafter\testargumentlist\csname#1\endcsname}

\test[\testparameter]

\stoptext
Often arguments to commands like \startsomething[xx] let the xx end up 
in some \(if)csname expansion. A protected (\unexpanded in context 
speak) macro doesn't expand inside for instance an \edef (or comparable 
expandable situation). Now, from that it makes perfect sense to also not 
let it expand inside a \csname or \ifcsname. One reason is that when it 
does expand, you can get a pretty wild (nested) sequence of nested 
expansions and one can be pretty sure that we then don't have a proper 
csname. This is why in luatex we have a catch for running wild csname 
checking.


The original \ifcsname test was inherited from etex. The \protected 
feature also comes from etex. But \csname is a tex natural.
In pdftex (and luatex) a protected macro inside an \(if)csname does 
expand which to makes no sense and smells like a bug. Or maybe it was 
tricky to catch (the implementation of protected a bit of a hack).


In luametatex protected macros are native and in the process I also 
decided to *not* expand them in a \(if)csname where I expect (as said) 
protected macros to behave like in an edef. I nice side effect is that 
running wild no longer happens (but we still catch it) which can save 
quite some useless backup token list construction (needed because tex 
has to push back stuff in order to be able to report an error).


So, when you still don't understand it (which I can understand) I'm sure 
Wolfgang can explain it better now.


\starttext

  \def\foo{foo}
\protected\def\oof{oof}

\csname foo\endcsname
\csname oof\endcsname
\csname \foo\endcsname

% error in luametatex, ok in pdftex/luatex:

% \csname \oof\endcsname

\ifcsname  foo\endcsname yes\else nop\fi
\ifcsname  oof\endcsname yes\else nop\fi
\ifcsname \foo\endcsname yes\else nop\fi

% nop in luametatex (error intercepted), yes in pdftex/luatex

\ifcsname \oof\endcsname yes\else nop\fi

\stoptext

Now, one can argue that if I consider it a but in the other engines, why 
I don't argue that it should be solved. Well, there is too much legacy 
code already that might use it as feature so it will not change. But in 
luametatex we can 'fix' these things. (We also use the csname in a 
rather predictable way in context so i don't expect issues in the core.)


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
___


[NTG-context] new upload

2020-11-19 Thread Hans Hagen

Hi,

A new upload. Hopefully with the linux install fixed.

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
___


Re: [NTG-context] autostart included video

2020-11-19 Thread Hans Hagen

On 11/19/2020 8:12 AM, Aditya Mahajan wrote:


I use \externalfigure[filename.mp4] to include a video in a presentation. Is it 
possible to autostart the video automatically when the page is loaded?

This works here:

\setupinteraction[state=start]

\starttext
\gotobox{\externalfigure[cow.pdf]}[url(woodwork.mp4)]
\stoptext

instead of cow take a screendump of the first frame of the movie.

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
___


Re: [NTG-context] autostart included video

2020-11-19 Thread Hans Hagen

On 11/19/2020 8:12 AM, Aditya Mahajan wrote:


I use \externalfigure[filename.mp4] to include a video in a presentation. Is it 
possible to autostart the video automatically when the page is loaded?
Video (and audio) and acrobat ... any browser can play a video but it 
seems too complex for adobes pdf viewers and technology


It all started out simple: there was a video annotation with associated 
controls. It uses the quicktime plugin and when (i guess) apple and 
adobe fell out of love that one was ditched. Goodbye easy media support; 
it worked well and was quite robust too.


In the years following that mechanisms came and went and we got this 
redicoulous complex (split annotation) media subystem that, guess what, 
depended on flash to show something at all. One had to embed some flash 
wrapper. Then adobe fell out of love with flash.


(There was actually a time when SMIL was supported which was quite ok, 
but all my old demos (mediashow.pdf etc) now pop up with missing 
players. At least it was some kind of (probably as usual some reversed 
engineered application xml but I 'm not sure about that).


Now, although I never really needed it. I spent a lot of time on all 
that and end of this year flash will be removed so I'll probably remove 
all that stuff from lmtx too. Goodbye audio and video ... I'd better 
spent my time on reading books, listening music or watching movies.


I really don't understand those policies. Come up with a trivial 
annotation for video and audio, take a few stable formats and keep 
supporting that. How hard is that? Plenty of libraries for that too.


I guess that the next thing to fade away is this 3d subsystem, and after 
that widgets and javascript (some already gone).


So, probably best is some hyperlink to a simple local webpage that pops 
up the video. Don't rely on acrobat (and adobe) for long term support of
anything beyond text. It never pays back to waste time on dynamic 
annotations, widgets etc. It probably never pays back to invest in 
anything those large companies come up with anyway. Don't buy into the 
'there's a large company (or organization) behind it so it is okay and 
will stay'.


(Actually, anything beyond text and graphics rendering in pdf is kind of 
weird. So, let's for instance not try to analyze tagged pdf here.)


I'll probably add some code for url pop ups for media ... makes more 
sense. Delegate to a browser. But maybe it's better to first move the 
fancy annotation stuff to the attic.


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
___


Re: [NTG-context] LMTX fails with custom tags (MkIV continues to work)

2020-11-18 Thread Hans Hagen

On 11/18/2020 11:41 PM, Rik Kabel wrote:
Documents fail with an error when they include \startelement[tagname]. 
This started on or before the 2020.11.17T12:42 LMTX update, and 
continues with 2020.11.18 19:16 LMTX. MkIV continues to work as expected.


Example:

\setelementbackendtag[myTag]
\setelementnature[myTag][mixed]

\starttext

  \startelement[myTag] % <---

   This works with MkIV but fails with LMTX, complaining: {\tt
   tex error on line 17 in file G:/extract.mkvi: The file ended
   when scanning an argument.}

   It works in LMTX when marked lines are removed, but\unknown

  \stopelement  % <---

\stoptext
ha, i was to optimistic about using some low level macro (needs to 
extend it)


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
___


Re: [NTG-context] new upload

2020-11-18 Thread Hans Hagen

On 11/18/2020 10:21 PM, Wolfgang Schuster wrote:

Pablo Rodriguez schrieb am 18.11.2020 um 22:05:

On 11/18/20 7:42 PM, Hans Hagen wrote:

Hi,

A new upload ... still some 150 tex files to go (from mkiv to lmtx
speak) ... after that the lua ones ... some fixes applied, maybe some
new temp issues introduced ... thanks for testing.


Many thanks for the new upload, Hans.

Even headings and lists are indented now:

   \showframe\showgrid
   \setupindenting[yes, always, big]
   \starttext
   \placelist[section]
   \dorecurse{5}
 {\section{Section \recurselevel} \input{zapf}}
   \stoptext

I think this may be a bug.



Minimal example:

\showgrid

\starttext

\parindent\emwidth

text

\noindent text

\stoptext

found it ... fixed in next upload (relates to normalization)

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
___


Re: [NTG-context] upload

2020-11-18 Thread Hans Hagen

On 11/18/2020 9:29 PM, Pablo Rodriguez wrote:

On 11/17/20 3:15 PM, Hans Hagen wrote:

On 11/17/2020 2:57 PM, Pablo Rodriguez wrote:

[...]
What are we doing wrong that prevents the update of the installation?

I don't know. Nothing really changed in the installer.


It may be something unrelated, but I don’t know why the resolver
databases (I assume tex/texmf-*.tma) aren’t detected by the installer
(or it considers them outdated).

The second cuestion is that current is set to %S (but probably this is
only about not showing the right version).

   resolvers | resolving | warning: no lua configuration files found
   resolvers | resolving | no texmf paths are defined (using TEXMF)
   resolvers | resolving |
   mtxrun| the resolver databases are not present or outdated
   mtx-install   | server   : lmtx.pragma-ade.com
   mtx-install   | instance : install-lmtx
   mtx-install   | platform : linux-64
   mtx-install   | system   : unix
   mtx-install   | updating tex/texmf, 1541 files
   mtx-install   | updating tex/texmf-context, 3757 files
   mtx-install   | updating tex/texmf-linux-64, 6 files
   mtx-install   | skipping tex/texmf-linux-64/bin/context
   mtx-install   | skipping tex/texmf-linux-64/bin/mtxrun
   mtx-install   | current  : %S
   mtx-install   | target   : true
   mtx-install   | removing : mtxrun
   mtx-install   | removing : context
   mtx-install   | linked   : mtxrun
   mtx-install   | linked   : context

Just in case it might help,
it looks like lua can't load a file (no problem loading it in editors) 
so i need to hack around it (maybe something lua 5.4 that i need to 
investigate)


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
___


[NTG-context] new upload

2020-11-18 Thread Hans Hagen

Hi,

A new upload ... still some 150 tex files to go (from mkiv to lmtx 
speak) ... after that the lua ones ... some fixes applied, maybe some 
new temp issues introduced ... thanks for testing.


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
___


Re: [NTG-context] \infull not working

2020-11-18 Thread Hans Hagen

On 11/18/2020 4:12 PM, Nigel King wrote:



However the command \infull{Ch} now results in CH in small capitals.
\infull is already bound to abbreviations so it will take that ones 
settings


(your version doesn't yet define it anew which is fixed in a next upload)

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
___


Re: [NTG-context] \infull not working

2020-11-18 Thread Hans Hagen

On 11/18/2020 1:35 PM, Nigel King wrote:

Dear Group,
Thanks for your excellent work.

I have just got a new computer and installed Context as I normally do. 
Unfortunately there appears to be a bug, unless I have done something wrong. 
\infull appears not to be working. I have used the following test file which is 
from the wiki but split the line with \infull{Ch} in two to be certain.

\definesynonyms[test][tests][\infull]

\setupsynonyms[test][criterium=all]

  \test{ITU}{International Telecommunication Union}
  \test{MID}{Maritime Identification Digit}
  \test{Ch}{Switzerland}

\starttext

The \ITU\ is an
organisation in \infull{Ch}

\subject{Short is nice}
  \placelistoftests

\stoptext

The log message has this in it.

tex error   > tex error on line 12 in file 
/Users/nki001/OneDrive/MyDocuments/Context/NGAForIreland/test.tex: Undefined 
control sequence


fixed in next upload ... but ... on my machine, where I run with

  \overloadmode\plusfour % error, \plusthree is warning only

i then will get:

csname overload > fatal error, protection level 4, control sequence 
'infull', properties 'frozen instance protected', file './oeps.tex', line 4


because \infull is already used by the predefine abbreviations instance

no problem if you don't use that feature

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
___


Re: [NTG-context] Macro \spaceorpar seems gone in latest upload

2020-11-18 Thread Hans Hagen

On 11/17/2020 9:06 PM, Joseph wrote:

Dear list,

I use occasionally \spaceorpar and it looks like this macro is no longer 
defined, is this expected ? If so, is there a replacement please ?

hm, it was used only in one place and never a user macro

I can bring it back:

\permanent\protected\def\spaceorpar
  {\endgraf\ifhmode\space\fi}

but you have to bribe Wolfgang to add it to the interface specification 
then


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
___


Re: [NTG-context] Index formatting difference LMTX and MkIV redux

2020-11-18 Thread Hans Hagen

On 11/17/2020 10:14 PM, Pablo Rodriguez wrote:

On 11/17/20 9:34 PM, Rik Kabel wrote:

Bump.

This is still a problem. Can anyone acknowledge that the problem exists
outside my own installation? If so, is there a work-around? An explanation?


Hi Rik,

I can reproduce your problem, but I’m afraid I don’t know the
explanation for this or even a workaround.
We have a more accurate limiter so you get one more word (keep in mind 
that the ... is part of the width). Then, when being used stretch and 
shrink kick in and your '4cm' gives too much space. I'll enable the 
features that freezes the spacing to fit the width but even then you 
will overflow. So, you need to decrease the 4cm.


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
___


Re: [NTG-context] upload

2020-11-17 Thread Hans Hagen

On 11/17/2020 2:57 PM, Pablo Rodriguez wrote:

On 11/17/20 12:55 PM, Hans Hagen wrote:

Hi,

I uploaded a new version of lmtx (and mkiv). We're still in the process
of migrating code from mkiv to lmtx (using new features).


Hans,

many thanks for the new upload.

As I reported before, I’m afraid I’m not able to update LMTX unless I
remove the three tex/texmf-*.tma files (in both Windows and Linux).

Other users have reported that this is the only method to get the update
done. But this downloads all the files, overloading your servers (after
all, this isn’t an update, just a complete install over an already
installed system).

This used to work before LMTX from 2020.09.20.

In Linux, tex/install.sh from both versions (2020.11.17 and 2020.11.15)
are exactly the same. I used a diff tool to allow no error.

What are we doing wrong that prevents the update of the installation?

I don't know. Nothing really changed in the installer.

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
___


[NTG-context] upload

2020-11-17 Thread Hans Hagen

Hi,

I uploaded a new version of lmtx (and mkiv). We're still in the process 
of migrating code from mkiv to lmtx (using new features). Anyway, I also 
uploaded a few more (preliminary) 'manuals'


http://www.pragma-ade.com/general/manuals/lowlevel-macros.pdf
http://www.pragma-ade.com/general/manuals/lowlevel-security.pdf
http://www.pragma-ade.com/general/manuals/lowlevel-conditionals.pdf
http://www.pragma-ade.com/general/manuals/lowlevel-boxes.pdf

but some is work in progress. It shows a bit how things evolve(d) and 
what ws and i are dealing with now.  More (details) in due time.


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
___


Re: [NTG-context] format error with latest 2020-11-16 19:40 with mkiv (luatex)

2020-11-17 Thread Hans Hagen

On 11/17/2020 3:06 AM, Adam Reviczky wrote:

Hi,

I am getting the following error message trying to generate the formats 
(context --make) with the latest version (latest 2020-11-16 19:40) with 
luatex 1.13.0 7385 (not lmtx).


loading         > ConTeXt Typesetting Macros / Triggering Actions
resolvers       > lua > loading file 
'/usr/share/texmf/tex/context/base/mkiv/typo-inj.lua' succeeded


tex error       > tex error on line 49 in file 
/usr/share/texmf/tex/context/base/mkiv/typo-inj.mkiv: ! Parameters must 
be numbered consecutively



*
l.49 \permanent\tolerant\protected\def\checkinjector          [#1]#*
   
[#2]{\clf_checkinjector{#1}{#2}}

I'll upload a fixed zip.

\permanent\tolerant\protected\def\checkinjector[#1]#*[#2]{...}

is lmtx speak for pick up [#1], skip spaces, pickup [#2] but don't bark 
when these are missing (be \tolerant). And, prevent the user from 
overloading this macro {\permanent).


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
___


Re: [NTG-context] different outputfilename

2020-11-15 Thread Hans Hagen

On 11/15/2020 3:21 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

   \enablemode[presentation]

   \doifmodeelse{typesetting}
 {\disablemode[presentation]}
 {\enablemode[typesetting]}

   \startmode[typesetting]
 \environment[typeset-pages.tex]
   \stopmode

   \startmode[presentation]
 \environment[presentation.tex]
   \stopmode

This help me to generate from the same XML files either text or
presentations (they are different elements in the XML itself).

I have to invoke ConTeXt as ($source.tex has the content described above):

   context --purgeall --environment=$source.tex $source.xml

But this approach has two shortcommings.

It always generates a single file and using the same file name
(\jobname.pdf).

Is there no way to get the file with the outputfilename set to
\jobname-presentation?

Many thanks for your help,

--result=foo

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


Re: [NTG-context] latest lmtx

2020-11-15 Thread Hans Hagen

On 11/15/2020 12:05 AM, Thomas A. Schmitz wrote:

On 11/14/20 12:17 AM, j.ha...@xs4all.nl wrote:

Take today's upload.



Hi Hans,

since you mentioned that such buglets may occur, here's another one, but 
in this case, the error message is obscure to me, and I have no clue 
where in the environment file it is triggered (it's an xml-project):


tex error   > tex error on line 8 in file cont-yes.mkiv: ?


lua error:

     registered function call [382]: [string "..."]:5: attempt to 
call a nil value (global 'scanintegerargument')

stack traceback:
     [string "..."]:5: in function <[string "..."]:4>

Does that ring any bell?

>rgrep scanintegerargument *.l*
./toks-scn.lmt 44: local scanintegerargument = scanners.integerargument
./toks-scn.lmt263: scanintegerargument = scanintegerargument,

so

\ctxlua{print(tokens.scanners.integerargument)}

should print a function reference

if not, you have a mismatch between engine and context files

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
___


Re: [NTG-context] troubles when installing OpenBSD 64 binaries (install.sh?)

2020-11-15 Thread Hans Hagen

On 11/14/2020 9:23 PM, Damien Thiriet wrote:

Hi Hans,

Thanks for your answer.
I patched install.sh that way


*** install.sh  Fri Nov 13 19:14:48 2020
--- /usr/local/context/install.sh   Sat Nov 14 20:58:00 2020
***
*** 100,105 
--- 100,111 
  fi
   fi
   
+ if  test "$SYSTEM" = "OpenBSD" ; then

+if test $(grep -c $(uname -r) $PWD/bin/mtx-install.lua)="0"; then
+   sed -i "/openbsd/s/[0-9]\.[0-9]/$(uname -r)/" $PWD/bin/mtx-install.lua
+fi
+ fi
+
   $PWD/bin/mtxrun --script ./bin/mtx-install.lua --update --server="$LMTXSERVER" 
--instance="$LMTXINSTANCE" --platform="$PLATFORM" --erase --extras="$LMTXEXTRAS"
   
   cp $PWD/tex/texmf-$PLATFORM/bin/mtxrun$PWD/bin/mtxrun


I thought this patch might be usefull upstream.
It succeeds in patching mtx-install.lua (I checked commenting
all the lines below my patch) but somewhere during the install process,
this patched $PWD/bin/mtx-install.lua is replaced by the original one
and install fails.

What else should I do?
wait till there's an update (you migth have to do the replacement trick 
once but after that it should be ok)


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


Re: [NTG-context] troubles when installing OpenBSD 64 binaries (install.sh?)

2020-11-14 Thread Hans Hagen

On 11/14/2020 1:47 PM, Damien Thiriet wrote:

Hi,


I apologize for sending more or less the same message as last week, but
it went unnoticed on the mailing list. To sum up, looks like
that install.sh cannot fetch the openbsd 6.8 amd64 binaries.

I am aware of the *tma issue noticed by some list users, but since I am
ripping of anything in my /usr/local/context/ tree before upgrading,
shouldn't be an issue. Any help really welcomed, since texlive context
package doesn't compile either on my computer, an issue the packager
spend time on it and couldn't recreate/resolve. This means I am stick
with compiling via ssh on a debian box.

you need to adapt

mtx-install.lua

(search for openbsd and patch the number to 6.8)

the problem with openbsd is these incompatible versions and the fact 
that we have to support two versions (otherwise could omit that number)


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
___


Re: [NTG-context] LMTX, mathcases and noalign

2020-11-13 Thread Hans Hagen

On 11/13/2020 4:21 PM, Jean-Philippe Rey wrote:

Dear list,

I am trying to switch from MKIV to LMTX. I've just found a discrepancy with the 
following code which puts space between two lines in a math alignment. This 
minimum breaking example uses \startcases, but the same problem arises with 
other alignment macros.

\starttext
\startformula
\startcases
\NC 1 \NC if not null \NR
\noalign{\vskip2ex}
\NC 0 \NC if null \NR
\stopcases
\stopformula
\stoptext

This snippet works fine with MKIV but breaks in LMTX (see attached log file). 
Is this a bug in LMTX or is there another way to insert space between two lines?

I've already tried different other solutions, but none seems really appropriate:

- \intertext produces a vertical space of at least 3 lines and I haven't been 
able to make it smaller;

- adding an empty line (\NC \NR) produces a smaller space but I am unable to 
reduce its height below a minimum value (roughly a line);

- adding a \vrule to the above or below line works fine but it needs some 
calculation depending on the content of the line.
we're in the process of upgrading some code in lmtx ... so the next 
upload will provide \TB (as in other tabular like mechanisms)


Actually your code will not work in a recent lmtx. This has to do with 
the fact that a \noalign is always somewhat tricky (relates to the 
engine looking ahead for specific commands). In mkiv (an dolder lmtx) 
there is some \noalign overload magic that deals with that but in recent 
lmtx we use a different approach.


\starttext

The next code defines a macro \TB that is protected but still acceptable 
for alignment lookahead checking with an optional argument and that 
behaves like \blank.


\pushoverloadmode
\noaligned\tolerant\protected\def\TB[#1]{\noalign{\blank[#1]}}
\popoverloadmode

\startformula
\startcases
\NC 1 \NC if not null \NR
\TB[2ex]
\NC 0 \NC if null \NR
\TB[4*big]
\NC 0 \NC if null \NR
\stopcases
\stopformula

\stoptext

(There is a little more involved because we want to protect commands 
like \TB against overloading while at the same time we do overload them 
in all those different table mechanisms but this is not something users 
have to worry about.)


Btw, using \noalign is to be avoided because it assumes that the 
mechanism uses the alignment mechanism.


But best wait for the next upload.

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
___


Re: [NTG-context] non-ascii chars in cmd.exe (Windows)

2020-11-13 Thread Hans Hagen

On 11/13/2020 2:49 PM, Pablo Rodriguez wrote:

On 11/12/20 10:55 PM, Hans Hagen wrote:

On 11/12/2020 10:39 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

\starttext
\startluacode
io.write(' Name? ')
document.name = io.read() or ''
\stopluacode
\cldcontext{document.name} is the name.
\stoptext
[...]
I’m using current latest (ConTeXt MkIV 2020.11.08 12:42).

I’m not sure what I am missing or whether I have hit a bug.


This has been discussed before I think. It has to do with how you
configured your system (what encoding) and how consisteltly you take
that into account. If you have some mixed setup, just don't use non-ascii.


Many thanks for your reply, Hans.

I use chcp 65001. I have no problem displaying UTF-8 messages and
passing arguments with UTF-8 characters.


Anyway, in LMTX all file, commandline and systemn operations are utf 8
and on windows get translated into wide system calls so there it should
   work ok if you use utf8.


Well, according to https://ss64.com/nt/cmd.html the console uses
UTF-16LE. Or UCS-2 (as described in
https://devblogs.microsoft.com/commandline/windows-command-line-unicode-and-utf-8-output-text-buffer/#console-built-in-a-pre-unicode-dawn).

Since console input is UTF-16LE, I guess I may need something in Lua
similar to 'regimes.translate(str, "utf16le")'.
the console uses whatever code page you have configured and it also 
relates to the code page used for filenames .. the 16 bit values are 
used deep down and what you use gets translated into that (often folks 
still use some 8 bit code page so that then gets mapped) .. there is no 
way the system can know if what you provide is as it's bytes in whatever 
encoding used


so, you need to look what your system is configured for

(this is independent of the output to the console which is what the 
65001 does)


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
___


Re: [NTG-context] non-ascii chars in cmd.exe (Windows)

2020-11-12 Thread Hans Hagen

On 11/12/2020 10:39 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

   \starttext
   \startluacode
   io.write(' Name? ')
   document.name = io.read() or ''
   \stopluacode
   \cldcontext{document.name} is the name.
   \stoptext

Running it on Linux, I can input non-ascii characters.

When running in Windows, if the input chars contains a non-ascii one,
document.name is empty.

I have no problem passing arguments from cmd with Unicode characters
(such as in '--arguments="name={αβγ}"'.

I’m using current latest (ConTeXt MkIV 2020.11.08 12:42).

I’m not sure what I am missing or whether I have hit a bug.


This has been discussed before I think. It has to do with how you 
configured your system (what encoding) and how consisteltly you take 
that into account. If you have some mixed setup, just don't use non-ascii.


Anyway, in LMTX all file, commandline and systemn operations are utf 8 
and on windows get translated into wide system calls so there it should 
 work ok if you use utf8.


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
___


Re: [NTG-context] problems with signature fields

2020-11-11 Thread Hans Hagen

On 11/11/2020 9:46 PM, Pablo Rodriguez wrote:

Hans,



Back then, I thought it was an minor improvement. Now I realized that
this two objects for signature fiels are only valid for Acrobat.


te hother tools hould be fixed ... indirect objects are pretty valid


I wonder whether this improvement might be also easier to make in LMTX.


not without changing the implementation of fields (which makes no sense 
... in fact one can start to wonder about widgets of any kind now that 
flash is dropped which is needed/used for rendering of some image types 
in pdf)



Would it be possible that signature fields may have only one object, so
that mupdf-gl and other tools have no problem signing fields PDF
documents generated by ConTeXt?
all is possible but i'm not sure if i want to uglify the implementation 
for the sake of buggy viewers


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
___


Re: [NTG-context] removing many lines about font in log.

2020-11-09 Thread Hans Hagen

On 11/8/2020 8:05 PM, Jeong Dal wrote:


Hi,

The following example creates so many lines of messages about fonts in 
the log.


\definefontfeature [default] [default] [script=hang,language=kor]

\starttext
\definedfont[file:notoserifcjkkrregular*default]
Korean sentences.

한글이 아름답습니다.
\stoptext

fonts           > 'fallback modern-designsize rm 12pt' is loaded
fonts           > defining > font 'notoserifcjkkrregular', feature 
'vert', script 'grek', no language 'kor'
fonts           > defining > font 'notoserifcjkkrregular', feature 
'vert', script 'latn', no language 'kor'
fonts           > defining > font 'notoserifcjkkrregular', feature 
'vert', script 'kana', no language 'kor'
fonts           > defining > font 'notoserifcjkkrregular', feature 
'vert', script 'cyrl', no language 'kor'
fonts           > defining > font 'notoserifcjkkrregular', feature 
'vert', script 'dflt', no language 'kor'

fonts           > defining > f
...

Is there a way to suppress messages?
Of course, there is no problem to get the output.
it depends if you're interested in it ... i kept it for cases where 
users expect some feature to work while the font doesn't have it but I 
have no problem making it optional


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
___


Re: [NTG-context] \switchtobodyfont behaves differenctly with splitted parameters

2020-11-08 Thread Hans Hagen

On 11/8/2020 12:46 PM, Sylvain Hubert wrote:
On Sun, 8 Nov 2020 at 12:14, Hans Hagen <mailto:j.ha...@xs4all.nl>> wrote:


when yyou use several bodyfonts you can do this before \starttext:

\usebodyfont[face,24pt]
\usebodyfont[deface]

\starttext
    
\stoptext


Thank you for the information, Hans!

Could you please also shed some light on the relation/difference among 
\{setup,switchto,use}bodyfont?
There seems to be not much documentation on this. Can one conclude, from 
the wiki <https://wiki.contextgarden.net/Command/switchtobodyfont> and 
the source code 
<https://source.contextgarden.net/tex/context/base/mkiv/font-ini.mklx#l2287>, 
that they are mostly the same, except that \switchtobodyfont is 
restricted to the content area, and \usebodyfont is a helper to call 
\setupbodyfont in the beginning?


If this is the case, is it recommended to always put a 
\setupbodyfont[...] in the beginning, even if it's just a 
\setupbodyfont[modern]?
One reason might be that the following example somehow enlarges the page 
number in the header, intuitively contradicting what is claimed by the 
wiki <https://wiki.contextgarden.net/Command/switchtobodyfont>:


     \switchtobodyfont[dejavu]
     \starttext \switchtobodyfont[dejavu, 24pt]a\stoptext


\setup  is document wide
\switch is for local usage

(has to do with picking up font/space related issues after page breaks 
and when typesetting page ornaments like headers and footers)




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


Re: [NTG-context] \switchtobodyfont behaves differenctly with splitted parameters

2020-11-08 Thread Hans Hagen

On 11/8/2020 12:02 PM, Sylvain Hubert wrote:
On Sun, 8 Nov 2020 at 11:37, Pablo Rodriguez <mailto:oi...@gmx.es>> wrote:


On 11/8/20 11:18 AM, Sylvain Hubert wrote:
 > Hi Pablo,
 >
 > thanks for the suggestion. Here's the minimal example which shows the
 > difference:
 >
 >     \definefontfamily[face][rm][dejavuserif]
 >     \starttext\switchtobodyfont[face, 24pt]ɑ\stoptext
 >
 > this should warn:
 >
 >     fonts           > checking > char ɑ (U+00251) in font
 > 'LatinModernMath-Regular-4' with id 10: missing

Well, you are switching before setting up a body font.

I don’t know whether this might be a bug in ConTeXt (see previous
report), but I would set up the body font always first:

     \definefontfamily[face][rm][dejavuserif]
     \definefontfamily[deface][rm][dejavusans]
     \setupbodyfont[deface]
     \starttext a\switchtobodyfont[face, 24pt]ɑ\stoptext


Thanks, it works!

And I agree that it probably indicates the existence of a bug, since by 
changing "\setupbodyfont[deface]" to "\setupbodyfont[dejavu]" in your 
example, the problem reappears:


     \definefontfamily[face][rm][dejavuserif]
     \setupbodyfont[dejavu]
     \starttext a\switchtobodyfont[face, 24pt]ɑ\stoptext

when yyou use several bodyfonts you can do this before \starttext:

\usebodyfont[face,24pt]
\usebodyfont[deface]

\starttext
  
\stoptext


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


Re: [NTG-context] Scheherazade New loading issue

2020-11-07 Thread Hans Hagen

On 11/7/2020 6:58 PM, Alan Bowen wrote:
Though Scheherazade New font loads properly with the today’s LMTX, I 
cannot get it to load with LMTX from 2020.09.20 (which I must stay with 
for now because the latest one has its own complaints about my files).


\definefallbackfamily[mainface][][Scheherazade New]
[range=arabic]
\definefontfamily[mainface][rm][STIX Two Text]
\setupbodyfont [mainface, 24pt]

\starttext
Arabic—ؼ

  {\bf ؼ}
\stoptext

with  ConTeXt  ver: 2020.09.20 23:02
mkiv lua stats  > loaded fonts: 2 files: stix2text-bold.otf, 
stix2text-regular.otf


with ConTeXt  ver: 2020.11.07
mkiv lua stats  > loaded fonts: 4 files: stix2text-bold.otf, 
stix2text-regular.otf, scheherazadenew-bold.ttf, scheherazadenew-regular.ttf


I should add that the old Sheherazade font works well with v. 2020.09.20.
It looks like no font is loaded (found) but that part is for Wolfgang to 
sort out ...


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
___


[NTG-context] new upload lmts

2020-11-07 Thread Hans Hagen

with some fixes
--

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


Re: [NTG-context] How to define a {\bf}-compatible fake-bold switcher?

2020-11-07 Thread Hans Hagen

On 11/7/2020 6:45 PM, Pablo Rodriguez wrote:

On 11/7/20 6:18 PM, Sylvain Hubert wrote:

Thank you so much, Pablo. This is exactly what I needed.

Could you also tell me where you have learnt these features? I had been
searching for this for hours but \effect was still the best of what I've
got. Indeed, googling 'context+tex+boldened' or 'contextgarden+boldened'
results in nothing useful.


Well, I asked for that feature
(https://mailman.ntg.nl/pipermail/ntg-context/2018/091128.html), which
Ulrike Fischer requested a year before
(https://mailman.ntg.nl/pipermail/ntg-context/2017/090091.html).

And that year, BachoTeX included a presentation with the implemented
feature (also included in LMTX @
tex/texmf-context/doc/context/presentations/bachotex/2018/bachotex-2018-fonteffects.pdf
[also with sources]).

I was very interested on that particular feature, because the previous
fake bold feature was simple stretching.

FYI.

The literal based solution has been in context for a long time (already 
in mkii) .. the 'bachotex' one you refer to is different and although it 
does use pdf rendering primitives it is more about making sure that 
related dimensions etc are dealt with (more parameters and dimensions 
are involved in that).


Actually, in luatex slanting and expanding (which is also kind of 
bondeling) have been inherited from pdftex. Boldening text is one case, 
but dealing with math yet another and the luatex engine only has some 
additional font property (linewidth) but all the rest has do be dealt 
with in lua.


In lmtx the implementation of those specific font properties is a bit 
different. In the end it is not so much the linewidth that matters here 
(which is trivial) but the details which is why there are several 
parameters that one can tweak. For instance outlines are also done this 
way.


(But as with many features, I'm not so sure if they are really used. The 
main reason for supporting it is not in text, because one should choose 
a proper font, but for math where bold (+heavy alphabets) are not widely 
available but needed for section heads.)


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
___


Re: [NTG-context] fancybreak fails in LMTX

2020-11-07 Thread Hans Hagen

On 11/7/2020 5:51 PM, Wolfgang Schuster wrote:

Rik Kabel schrieb am 07.11.2020 um 17:13:


Hello all,

The following example produces the expected output in MkIV, but fails 
in LMTX (both dated 2020-11-07). The modules directory was copied into 
the LMTX tree from the MkIV tree, and the log indicates that the 
module is loaded. It gives no other clues. The output has a blank line 
where the break should be, as shown in the included snips.




I guess it's the same bug (related to a symbol check) as Pablo mentioned 
for the itemize environment.

yes, symbol checking


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


Re: [NTG-context] another error message in LMTX

2020-11-07 Thread Hans Hagen

On 11/7/2020 3:31 PM, Pablo Rodriguez wrote:

On 11/7/20 1:29 PM, Hans Hagen wrote:

[...]


Many thanks for your in-depth explanation, Hans.

This sample triggers the error:

 \appendtoks
\unexpanded\def\doverbatimspace{\char32\hskip\zeropoint}%
 \to \everyenableelements

 \setuptagging[state=start]

 \starttext
 \starttyping
 mtxrunjit --generate
 \stoptyping

 \startitemize[n]
 \startitem a\stopitem
 \stopitemize
 \stoptext

I have no idea why.


because \doverbatimspace is defined in a way that will look ahead

   \unexpanded\def\doverbatimspace{\char32\hskip\zeropoint\relax}

so

\starttyping
plus 10pt  --generate
\stoptyping

probably makes the "plus 10pt" disappear


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


Re: [NTG-context] Problem using a TTF font

2020-11-07 Thread Hans Hagen

On 11/6/2020 3:54 PM, n...@scorecrow.com wrote:

This, I'm certain, used to work with an LMTX from the beginning of the year but I've 
upgraded to "ConTeXt  ver: 2020.11.05 23:01 LMTX  fmt: 2020.11.6  int: 
english/english" and now it doesn't.

I have a single .tex file in a directory, containing:

---begin---
\definefont [TwelveC] [file:Bondi12CPlus.TTF at 14pt]
\starttext
Keycaps: \TwelveC 123.45 \tf and back again
\stoptext
---end---

In the same directory I have the TTF font file which can be obtained from 
<https://www.educalc.net/2336507.page>. It is calculator keycap images for use 
in documentation.

In the PDF I get just blank space where the keycaps should be and Adobe 
Reader's document info seems to think there is only one font in the file i.e. 
the keycap font didn't get embedded. However, the console output includes the 
lines:

mkiv lua stats  > result saved in file: 12C_test.pdf, compresslevel 3, 
objectcompresslevel 1
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > loaded fonts: 3 files: latinmodern-math.otf, 
lmroman12-regular.otf, bondi12cplus.ttf
mkiv lua stats  > font engine: otf 3.111, afm 1.513, tfm 1.000, 8 instances, 3 
shared in backend, 3 common vectors, 0 common hashes, load time 0.132 seconds
mkiv lua stats  > font embedding time: 0.006 seconds, 2 fonts

which suggests LMTX thinks it loaded the font but decided not to embed it for 
some reason.

I'm probably doing something silly since it's been several months since I last 
looked at this but I can't see what I might be doing wrong :-(  so any and all 
help much appreciated.

PS: The font installs and displays in MacOS fine.

I've also tried
   \definefont [TwelveC] [Bondi12CPlus at 14pt]
and that fails the same way.
for now rename the file to one with a lowercase suffix (i'll check for 
that)


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


Re: [NTG-context] wrong /Rect in link annotations

2020-11-07 Thread Hans Hagen

On 11/7/2020 12:47 PM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

   \setupinteraction[state=start]
   \enabledirectives[references.border]
   %~ \definemakeup[slide]
   \define[1]\newurl{\goto{\tt\hyphenatedurl{#1}}[url(#1)]}

   \starttext
   %~ \startmakeup[slide]
   \newurl{a}

   compared to \newurl{a}.
   %~ \stopmakeup
   \stoptext

I’m afraid that with current latest rectangles for links got to the end
of the line when nothing stops them.

Could anyone confirm the issue?

BTW, I include the makeup, because previously this issue only took place
within makeups.
no, it has to do with the period not being there i.e. it's the last item 
on the list


so, this is not an issue in the latest upload but older

in lmtx we normalize paragraphs wrt left/right skip, hanging and shape 
properties, as well as left/right parfill skips as well as boxes nto 
lying about their dimensions (by using shifts) and i have to check some 
mechanisms for that - read: can do them nicer now without guessing


i will hack a solution but eventually will split off the lmtx/mkiv code 
for those bits and pieces (takes some time so it will happen after the 
flagging effort)


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
___


Re: [NTG-context] another error message in LMTX

2020-11-07 Thread Hans Hagen

On 11/7/2020 12:41 PM, Pablo Rodriguez wrote:

Hans,

using latest from yesterday, I get the following error:

  tex error   > tex error on line 22 in file cont-yes.mkiv: Valid
  keyword expected, likely 'minus'

   mt
  xrunjit
  
  \relax
   \buff_verbatim_type_buffer_indeed ...rrentregime
  }tab{\typingparameter \c!tab }method{\p_buff_option
  }escape{\typingparameter \c!escape }nature{display}\relax
  \dostoptagged \endofverbatimlines \dostoptagged \stoppacked
  \typingparameter \c!after

  [...]

  You started a keyword but it seems to be an invalid one. The first
  character(s) might give you a clue. You might want to quit unwanted
  lookahead with \relax.

This comes from a book with > 300pp. It compiles perfectly fine with
MkIV, so the typo might be in LMTX itself.

I wonder whether it would be possible to add the invalid keyword (and
related command) to the error message. This would mean something like:

  tex error   > tex error on line 22 in file cont-yes.mkiv: Valid
  keyword expected, got "invalid one" (related to "command").

This would help a lot to figure out where to start searching for clues
for a MWE.

well, the clue is there: you have

you have a \hskip or \vskip someplace that is not properly terminated by 
\relax so tex keeps scanning for optional plus|minus keywords and in 
your case runs into "mtxrunjit"


in luametatex we have a slightly different keyword scanner

- in traditional tex it will just push back the 'non valid' keyword and 
continue


- but that actually obscures a potentential error when the \hskip is 
burried deep: maybe you are typesetting "minus" as is and then it *is* a 
valid keyword and probably an error wil be that no valid dimension is seen


- so, you'rve just been lucky so far

so, this new keyword scanner is more picky in the sense that when it 
notices a potential keywors start it will complain earlier which might 
actually catch potential errors ealier (in this case all follow up words 
that start with a 'p' or 'm'


another change in scanning is that in many cases order no longer 
matters; for instance in scanning skips it's a 'plus' spec followed by a 
'minus' spec but in rules it can be mized 'width', 'height', 'depths'

 in any order and repetitive

in luametatex (unless there is good reason) the order doesn't matter, 
and often repetition is ok (so, multiple plus and minus in a skip and in 
any order where the last one counts)


this also permits for instance an order like:

\dontleavehmode
\hbox to 20pt xoffset  3cm{1\hss}
\hbox to 20pt {\hss2\hss}
\hbox to 20pt xoffset -3cm{\hss3}

where previously the 'to' spec always came last and multiple 'to' are 
okay (offsets etc are a lmtx feature, and it means many more keywords 
have to be scanned, which was one reason for cooking up a better 
mechanism, even if right from the start that was already rather optimized).


now, in principle this brings the possibility to support partial 
keywords, so 'xo' 'xoff' etc (in fact i only need to change a few lines 
of code) which can be handy when for instance one passes many 
attributes) but first i want the main machinery to be stable


actually, this was already there for a while; the good news is that all 
this doesn't harm performance (we actually gain some here, not that it's 
normally noticeable)


so: more flexibility, better performance, earlier interception but of 
course the later might demand users to fix code (i actually had to fix 
context in one spot for this lookahead issue).


(I'll add \relaxes to the after handling but that just obscures the issue.)

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
___


Re: [NTG-context] \setuparranging broken in LMTX?

2020-11-07 Thread Hans Hagen

On 11/7/2020 10:57 AM, Pablo Rodriguez wrote:

Dear list,

I have the following sample:

   \setuparranging[2TOP]
   \setuplayout[page]
   \starttext
   \insertpages[file.pdf]
   \stoptext

With a simple PDF document, I cannot make \setuparranging work in LMTX.
Using latest from 2020.11.06 20:34.

It works perfectly fine with MkIV.

Could anyone confirm this issue?

a bit too agressive checking in the engine .. i'll fix it

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
___


Re: [NTG-context] new upload

2020-11-07 Thread Hans Hagen

Hi,

a version mismatch normally comes from the fact that i generate an lmtx 
update (for wolfgang to check, posted elsewhere) but nor a mkiv one and 
then upload to the website (as happened)


also, the update script itself doesn't get updated so when that gets 
adapted one has to get it from the bare install


(keep in mind that doing a fresh install doesn't hurt the system because 
texmf-projects and texmf-fonts are not affected)


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
___


[NTG-context] new upload

2020-11-06 Thread Hans Hagen

Hi,

Again a new lmtx upload. As these days are all about counting and 
numbers ... of the 19K visible macros some 14K are now flagged.


Question: do we really need all these 'named characters'  or can we at 
some point ditch many .. I assume that users who key in greek and 
cyrillic use unicode nowdays (no hurry, just wondering).


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
___


[NTG-context] color epub reader

2020-11-06 Thread Hans Hagen

Hi,

Playing with a pocketbook color epub reader (I just put some manuals on 
it):


- the colors are not bright enough, also not with lights on, why rgb and 
not cmyk (i only tested pdf)


- the viewer is buggy and freezes, color demands more mem i think, but 
after an upodate it got a bit better


- resolution not good enough (yet)

But we keep hoping ...

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
___


Re: [NTG-context] math symbol for "is an element of"

2020-11-06 Thread Hans Hagen

On 11/6/2020 12:24 AM, t...@projectivespace.com wrote:


In this particular case, as Wolfgang pointed out, \in actually does work to get 
the desired symbol in math mode. But it is good to know how to use text 
substitutions too.

WHen you are in doubt you can do this:

\meaning\in

it will show you that the commands is adapting itself to math mode. 
There are a few such commands with 'clashing' names.


A variant on this is \NC which is the column separator but has a 
different meaning depending on where it's used. That one gets set to 
some meaning in environments.


Another overloaded one is \\ and it could be a space or newline or ...

Actually the last two are candidates for protectiopn against overload.

btw, users can run context with

--overloadmode=warning
--overloadmode=error

to see if their usage of commands or definitions bring conflicts. 
Currently \in is not yet protected against overload but it will be.


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
___


Re: [NTG-context] Why is the textarea not centered by default?

2020-11-05 Thread Hans Hagen

On 11/5/2020 9:58 PM, Henning Hraban Ramm wrote:



Am 05.11.2020 um 16:21 schrieb Pablo Rodriguez :

I’m not expert on typesetting, but I read somewhere (too long ago to be
able to remember when) that printed papers should have wider outer
margins to put your fingers on it.


In classical book layout, the two inner margins (2*backspace) should equal one 
outer margin.

But this makes *only* sense with thread-bound books that you can open 
completely.

In glued (perfect bound) books, the inner margin should be at least the same if 
not bigger than the outer margins to get a similar view.

Modern books, independent of binding techniques, usually don’t use a classical 
book layout, because that uses a lot of whitespace, i.e. more pages = higher 
printing and shipping costs.

It’s still true that margins should be big enough for your fingers – but 
depending on size and content of the book, different uses might suggest 
different space placement. E.g. I’d use a big inner margin for guides that you 
usually keep in one hand, thumb in the middle. For textbooks, a big bottom 
margin makes sense, because you can put it in a stand. A song book / hymnal 
you’d hold in both hands, so it needs big enough outer margins.
When we started with context (long ago) it was mostly used for single 
sided documents with a staple in the corner and room fo rmaking notes.


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
___


Re: [NTG-context] Bug: context/mtxrun makes Firefox eat up cpu

2020-11-05 Thread Hans Hagen

On 11/5/2020 11:48 AM, Sylvain Hubert wrote:
After dozens of compilations of various minimal examples using the newly 
installed context, the problem reappeared.


Removing tex/texmf-cache does not help.
Removing firefoxe does ... when I open e.g. the cnn website in firefox 
(for instance to keep an eye on crazy elections), that program takes 650 
MB memory and 44% GPU while edge (or chrome) takes 270 MB mem and 3% 
GPU. Add a few more tabs and firefox will easily eat up gigs of mem.


Now, I don't know how it manages memory but the tex engine needs a few 
reasonable sized arrays but in large allocs and then it manages its own 
memory from that pool, Lua needs more mem (could be scattered due to 
allocs i guess), and soem garbage collection can kick in, and browsers 
... well i suppose lots of allocations and it also depends on the 
jasvascript vm.


So, I would not be surprised if after some runs of these programs you 
end up with scattered memory. I suppose that at some point the operating 
system (when in rest) will sort things out. When I make a format file it 
normally takes a few seconds. When I let firefox run wild on memory (top 
out mem and then let it give back some), it can take twice as much to 
make a format, but after quitting firefox it's all ok again.


Anyway, already long ago I decided that firefox is a memory hog so 
whenever I do something that takes more time than I susspect, I close 
firefox. Actually I often close browsers when i don't need them, also 
because they always seem to be busy with something (also the network).


Tex is just juggling some bytes. In the past tex and distributioen were 
considered large ... nowadays they are small compared to whatever you 
install and run. And in luametatex/context the performance bottleneck is 
lua, not the core tex engine.


Of course you could consider swithcing to another operating system.

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
___


Re: [NTG-context] About loading C libraries (again)

2020-11-05 Thread Hans Hagen

On 11/5/2020 3:42 AM, Jairo A. del Rio wrote:
Hi again. I grepped the new release and I see permitloadlib is already 
included in mtxrun. Just out of curiosity, is --permitloadlib called via 
context or should I use it from mtxrun?

context --permitloadlib file.tex still doesn't have any effect.

It does here (not that i have a lib to test) so maybe check your path:

.../tex-context/tex/texmf-win64/bin/lib/luametatex/foo/libfoo.dll

(put the file there and run mtxrun --generate)

The lua versions should match and there shopuld be the initialer function.

\enabletrackers[*lib*]

gives some info.

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
___


Re: [NTG-context] How does lua callback work?

2020-11-04 Thread Hans Hagen

On 11/4/2020 6:14 PM, Sylvain Hubert wrote:

Dear List,

I'm trying to intervene whenever context encounters a character that it 
cannot render in the current font. I guess this should have something to 
do with lua callbacks (pls correct me if I'm wrong), but the document 
<http://www.pragma-ade.nl/general/manuals/cld-mkiv.pdf> does not seem to 
elaborate on this.


Does anyone know how the aforementioned task can be done, or how lua 
callbacks work in terms of the meaning of the concerned events and 
parameters?

no callback

\checkcharactersinfont

will report missing chars


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


Re: [NTG-context] context.delayed as parameter of setuphead[before=...]

2020-11-04 Thread Hans Hagen

On 11/4/2020 4:53 PM, Sylvain Hubert wrote:

% Hans, sorry for having replied on the wrong channel before.

On Tue, 3 Nov 2020 at 09:03, Hans Hagen <mailto:j.ha...@xs4all.nl>> wrote:


On 11/3/2020 4:05 AM, Sylvain Hubert wrote:
 >  > as tables like those in setuphead({somehead}, {somesettings}) are
 > actual Lua tables and follow Lua, not TeX, rules
 > But there are lua apis that support delayed TeX like
 > `context.chapter(context.delayed'text')`.
 > Whether or not the function is stored in a table should be
theoretically
 > irrelevant.
 > I guess there should be a switch somewhere that let the command
 > recognized delayed function.
all is possible but not all is reasonable to support .. adding layer
upon layed doesn't make it more pretty

Indeed, but still it would be nice to have a complete and consistent 
interface between tex and lua unless it would harm the functionality.


it would harm performance because it involves parsing all values and 
also ways around cases where the title is "function" (lieral text).



anyway, chapter (section) titles go tinto a toc table and storing lua
delayed function definitions there makes not much sense

It might be helpful in cases like alternative coloring. Writing
    "function() local x=1; return function() x=1-x; return ({'black', 
'gray'})[x] end end"
can be way much easier for lua speakers than digging up a bunch of 
documentations to figure out whether it's implemented, or how it can be 
implemented in a language like TeX, or both which is worse. In such 
cases, it would also be much natural to write 'before=function()..' than 
'before=\ctxlua{function()...}` unless, again, the former harms the 
functionality.
Really? I have no clue what that function makec clearer than tex. And 
one still needs some documentation that explains what it does.


Often there often is a pretty clean way to do it with less code.

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
___


Re: [NTG-context] About loading C libraries (again)

2020-11-04 Thread Hans Hagen

On 11/4/2020 11:01 AM, Jairo A. del Rio wrote:
Hi. I've just read in the LuaMetaTeX manual that --permitloadlib allows 
loading compiled (.so/.dll) libraries. However, when I try it using 
ConTeXt I have an error message (example below):


%hello.tex

\starttext

\startluacode

local hello = require"hellolib" -- hellolib.so

context(hello.helloworld())

\stopluacode

\stoptext

%hello.c
#include 
#include 

static int helloworld (lua_State *L) {
     char hello[] = "Hello world!";
     lua_pushstring(L, hello);
     return 1;
}

static const struct luaL_Reg hellolib [] = {
       {"helloworld", helloworld},
       {NULL, NULL}
     };

int luaopen_hellolib (lua_State *L){
     luaL_newlib(L, hellolib);
     return 1;
}


error (lua loadlib): you can only load external libraries when 
--permitloadlib is given



On the other hand, manually calling LuaMetaTeX with the ConTeXt format 
and --permitloadlib gives the expected result (in this case, a "Hello 
world!").


How is the correct way to load those libraries? Thank you very much and 
sorry if my question seems to be weird.

i should add a --permitloadlib option to the context runner then

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
___


  1   2   3   4   5   6   7   8   9   10   >