Re: [NTG-context] Unexpected symbol with Enumeration

2019-10-15 Thread Otared Kavian
Hi Fabrice,

I use Lucida OT fonts for all my documents, but since I prefer the script fonts 
from another font I have the following setups for my font:

%%
%% Some Font Definitions
\definefallbackfamily[myfont][math][Asana Math]
[range={uppercasescript,lowercasescript}]

% lucida font
\definefontfamily[myfont][serif][Lucida Bright OT]
\definefontfamily[myfont][math][LucidaBrightMathOT]
\definefontfamily[myfont][sans][LucidaSansOT]
\definefontfamily[myfont][mono][LucidaSansTypewriterOT]

\setupbodyfont[myfont,9pt]

%% End of Font Definitions
%%

Then when I use for instance the command $\cal{C}$ the script font from Asana 
Math is used, instead of from Lucida OT.

Best regards: OK

> On 15 Oct 2019, at 21:57, Fabrice Couvreur  
> wrote:
> 
> Hello,
> Thanks to you two. 
> "Another solution is to define your own mixture of math fonts and text fonts."
> I thought you should not mix several fonts in one text. I know you're a 
> teacher, what are you doing to write your documents ?
> Fabrice
> 
> Le mar. 15 oct. 2019 à 19:11, Otared Kavian  > a écrit :
> Hi Fabrice,
> 
> Wolfgang gave the right answer, but I wanted to point out that it is better 
> not to use \setupbodyfont in the middle of your document, as you did in the 
> excerpt below: in this case it is better to use 
> 
> \switchtobodyfont[xits]
> 
> or even better define the character you want before using it as in
> 
> \define\CScript{\start\switchtobodyfont[xits] \m{\mathscript{C}} \stop}
> 
> and then use that command as in:
> 
> La droite \m{(AM)} est {\bf une sécante} à la courbe \CScript en \m{A}.
> 
> Another solution is to define your own mixture of math fonts and text fonts.
> 
> Best regards: OK
> 
> 
>> On 15 Oct 2019, at 18:39, Fabrice Couvreur > > wrote:
>> 
>>  La droite \m{(AM)} est {\bf une sécante} à la courbe 
>> {\setupbodyfont[xits]\m{{\mathscript C}}} en \m{A}.
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl  / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> 
> webpage  : http://www.pragma-ade.nl  / 
> http://context.aanhet.net 
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> 
> wiki : http://contextgarden.net 
> ___
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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


Re: [NTG-context] Unexpected symbol with Enumeration

2019-10-15 Thread Fabrice Couvreur
Hello,
Thanks to you two.
"Another solution is to define your own mixture of math fonts and text
fonts."
I thought you should not mix several fonts in one text. I know you're a
teacher, what are you doing to write your documents ?
Fabrice

Le mar. 15 oct. 2019 à 19:11, Otared Kavian  a écrit :

> Hi Fabrice,
>
> Wolfgang gave the right answer, but I wanted to point out that it is
> better not to use \setupbodyfont in the middle of your document, as you did
> in the excerpt below: in this case it is better to use
>
> \switchtobodyfont[xits]
>
> or even better define the character you want before using it as in
>
> \define\CScript{\start\switchtobodyfont[xits] \m{\mathscript{C}} \stop}
>
> and then use that command as in:
>
> La droite \m{(AM)} est {\bf une sécante} à la courbe \CScript en \m{A}.
>
> Another solution is to define your own mixture of math fonts and text
> fonts.
>
> Best regards: OK
>
>
> On 15 Oct 2019, at 18:39, Fabrice Couvreur 
> wrote:
>
>  La droite \m{(AM)} est {\bf une sécante} à la courbe
> {\setupbodyfont[xits]\m{{\mathscript C}}} en \m{A}.
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Unexpected symbol with Enumeration

2019-10-15 Thread Otared Kavian
Hi Fabrice,

Wolfgang gave the right answer, but I wanted to point out that it is better not 
to use \setupbodyfont in the middle of your document, as you did in the excerpt 
below: in this case it is better to use 

\switchtobodyfont[xits]

or even better define the character you want before using it as in

\define\CScript{\start\switchtobodyfont[xits] \m{\mathscript{C}} \stop}

and then use that command as in:

La droite \m{(AM)} est {\bf une sécante} à la courbe \CScript en \m{A}.

Another solution is to define your own mixture of math fonts and text fonts.

Best regards: OK


> On 15 Oct 2019, at 18:39, Fabrice Couvreur  
> wrote:
> 
>  La droite \m{(AM)} est {\bf une sécante} à la courbe 
> {\setupbodyfont[xits]\m{{\mathscript C}}} en \m{A}.

___
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] Unexpected symbol with Enumeration

2019-10-15 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 15.10.2019 um 18:39:

Hello,
Why items are numbered with a square instead of a bullet ?

Because the bullets for the default sans serif font are rectangular.

\starttext

\symbol[bullet]

{\ss\symbol[bullet]}

\blank

\setupsymbols[stylealternative=math]

\symbol[bullet]

{\ss\symbol[bullet]}

\stoptext

Wolfgang

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

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


[NTG-context] Unexpected symbol with Enumeration

2019-10-15 Thread Fabrice Couvreur
Hello,
Why items are numbered with a square instead of a bullet ?
Thanks.
Fabrice

  \definecolor[MyColorC][s=0.8784]
  \definecolor[MyColorD][m=0.27,y=1]

  \defineframed
  [FrameTitle]
  [frame=off,
   foregroundstyle=\bfx\ss,
   foregroundcolor=white,
   background=color,
   backgroundcolor=MyColorD,
   location=depth]

  \defineframedtext
  [FramedText]
  [offset=0.25em,
   style=\ss,
   toffset=\zeropoint,
   background=color,
   backgroundcolor=MyColorC,
   foregroundstyle={\switchtobodyfont[10pt]},
   align={right, broad},
   frame=off,
   corner=00,
   radius=0.5em,
   width=10cm]

  \definedescription
  [Info]
  [before=,
   after=,
   text=Vocabulaire,
   title=no,
   width=fit,
   distance=0.5em,
   headcommand=\FrameTitle,
   alternative=serried]
  \starttext
\startFramedText[width=7cm]
  \startInfo
\startitemize[1]
  \startitem
La droite \m{(AM)} est {\bf une sécante} à la courbe
{\setupbodyfont[xits]\m{{\mathscript C}}} en \m{A}.
  \stopitem \par
  \startitem
La position limite de la sécante \m{(AM)} lorsque \m{M} se
rapproche de \m{A} est {\bf la tangente à la courbe} au point \m{A}.
  \stopitem\par
  \startitem
Le coefficient directeur de la tangente est {\bf la
limite}, lorsque \m{h} tend vers 0, du taux de variation. On l'appelle {\bf
nombre dérivé} de la fonction \m{f} en 1.
  \stopitem
\stopitemize
  \stopInfo
\stopFramedText
  \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
___


Re: [NTG-context] PDF viewer poll

2019-10-15 Thread luigi scarso
On Sun, Oct 13, 2019 at 12:43 PM Henning Hraban Ramm  wrote:

> Hi, I’d like to update my list of (usable!) PDF viewers.
>

A recent android tablet 10" with HD display is quite ok with Adobe Reader
and  several others apps ( eg foxit pdf reader)
EBookDroid is another app  pdf +djvu reader ,  also quite ok to read a pdf
on screen.

-- 
luigi
___
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] PDF viewer poll

2019-10-15 Thread luigi scarso
On Tue, Oct 15, 2019 at 10:21 AM Hans Hagen  wrote:

> > Most of my PDF debugging is done using 'mutool clean’ (especially with
> the -d switch) and textmate / diff.
> qpdf also has something like that (with comments of where the objects
> come from)


it's the qdf export : pdf -> qdf -> (edit qdf)  -> pdf


-- 
luigi
___
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] PDF viewer poll

2019-10-15 Thread Hans Hagen

On 10/15/2019 10:12 AM, Taco Hoekwater wrote:




On 15 Oct 2019, at 06:42, Henning Hraban Ramm  wrote:

Thank you all for you valuable insights so far!
I’ll compile them to a wiki page and also complete the list in my upcoming book.


Am 2019-10-14 um 11:17 schrieb Hans Hagen :

When developing pdf specific code (like last months) I do use acrobat reader 
and an older acrobat x (which keeps telling me that it wants to be updated but 
the update fails) ... both have their different issues. Acrobat X has some 
validation on board and one can introspect the file (and fonts) to some extend 
but in the end it's often still trial and error.


Do you know any other tools for PDF debugging? Those few I know of cost four to 
five figures or were plugins to very old versions of Acrobat


Most of my PDF debugging is done using 'mutool clean’ (especially with the -d 
switch) and textmate / diff.
qpdf also has something like that (with comments of where the objects 
come from) and using both tools in parallel can normally reveal issues


there are catches: for instance some tools don't really use the xref 
table but just run through the objects so finding issues in the xref 
(and compressed object tables) is a bitch but luckily it seldom needed


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] PDF viewer poll

2019-10-15 Thread Marcin Borkowski

On 2019-10-15, at 06:42, Henning Hraban Ramm  wrote:

>> Basically javascript can be limited to (1) setting annotation properties, 
>> like toggling layers or button renditions, and (2) some simple calculations 
>> (for forms). Constructing pdf runtime using javascript is pretty braindead 
>> (use html instead then).
>
> D’accord.

Of course you are aware that limiting a powerful language is not an easy
task?

>> It is one of the puzzling areas to me: no problem in browsers and elsewhere 
>> but not in open source pdf viewers. It's not the most complex stuff so it 
>> probably indicates that no one cares much about these features.
>
> I wouldn’t say "no problem", because JS causes security problems everywhere.

It's not JS that causes problems.  Any other (powerful enough) language
not specifically designed with browser environment in mind could be
problematic here.  I guess that having Perl, Python or Ruby instead of
JS would create a similar set of problems.  (Lua might be an exception
due to its design and a possibility to whitelist functions for eval,
AFAIR.)

Just 2 cents from a JS programmer who actually thinks that JS is not the
worst Lisp dialect out there.

Best,

--
Marcin Borkowski
http://mbork.pl
___
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] PDF viewer poll

2019-10-15 Thread Marcin Borkowski
Hi,

I don't use ConTeXt anymore, but I still get the emails from the list,
and I quickly skimmed throught this thread to see if someone writes
about my pdf-viewer of choice - pdf-tools
(https://github.com/politza/pdf-tools).

On 2019-10-13, at 12:43, Henning Hraban Ramm  wrote:

> Hi, I’d like to update my list of (usable!) PDF viewers.
> Which one do you use? (Current version?)

pdf-tools (version 20190701.202)

> What are its pros and cons?

cons:
- no "continuous display"/"double page" modes

pros:
- searchable (also with regexen), also grep-like (i.e., display all
lines containing some regex and jump to them easily)
- annotations/comments are viewable (and jumpable to) w/o using the
mouse
- fast
- runs within Emacs (not sure if this is a "pro" for everyone...)

> Is it free (open source, freeware)?

yes (GPL3)

> Does it work on Win/Lin/Mac?

GNU/Linux, maybe Mac

> Does it have a localized interface? (I don’t care, but I work with
> people who don’t understand a lot of English.)

No.

> Can it handle comments, attachments?

Yes.

> Can it handle forms with or without JavaScript?

AFAIK, no.

> Does it support SyncTeX? (Who uses that anyway?)

Yes, and I do all the time!

> Does it update changed PDFs on its own (or does it even block
> overwriting)?

I guess it can be configured to do so (like Emacs in general)

> Which other features are essential for your choice?

As I said - I don't have to leave Emacs.  Also, incremental or grep-like
searching with literal text or regexen are killer features.

Best,

--
Marcin Borkowski
http://mbork.pl
___
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] \ctxlua and \startluacode ... \stopluacode

2019-10-15 Thread Hans Hagen

On 10/15/2019 10:04 AM, Taco Hoekwater wrote:

Hi Rudolf,


On 15 Oct 2019, at 00:50, Rudolf Bahr  wrote:

Now to your suggestion not to use "assert ()". Indeed it's a solution! My 
program
works! I append again its output (again just for fun!). Did you really try it or
has it been just an idea?


First, let me say that embedded lua versions are typically a little bit 
different
from standalone. Just how much different depends on the embedding program. 
Luatex
is actually pretty close to standalone lua. Luatex adds a bunch of extension 
libraries,
but it changes very little of the core language. And all those changes are 
documented
in the luatex manual. None of those changes affect your minimal example, except
that lua errors are handled a little differently.

Note that standalone lua *also* produces an error, as that is what assert() is
supposed to do. And when lua runs into an error, it ignores the rest of the 
current
chunk:

   “... whenever an error occurs, Lua ends the current chunk and returns
   to the application.” (from lua.org)

Standalone lua typically sees only one chunk (the file you pass on the command
line) but embedded lua implementation often see (sometimes many) more chunks.
In luatex’s case, each \directlua is a separate chunk (in ConTeXt, that means 
every
\startluacode block and every \ctxlua call is a separate chunk).

The only unusual thing here is that standalone lua silently quits and returns a
non-zero exit code to the shell, whereas luatex gives you the typical TeX-style
error prompt. The rationale for that is: lua errors can happen in many places in
your input file, and if they were silently ignored, your typeset pages could be
wrong without you realising it.


And to answer your question above: I did not have to try or guess. I know about
how assert() works because it is documented in the lua manual (and as it closely
mimics the assert() C function, that is easy for me to remember).

as you say, it's all normal lua behaviour:

if you do:

  print(io.open("crap.crap"))

one gets

  nil   crap.crap: No such file or directory2

and i think that assert then returns the second returned argument

but if one does

  context(io.open("crap.crap") and "yes" or "no")

then the first argument is checked against

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] PDF viewer poll

2019-10-15 Thread Taco Hoekwater


> On 15 Oct 2019, at 06:42, Henning Hraban Ramm  wrote:
> 
> Thank you all for you valuable insights so far!
> I’ll compile them to a wiki page and also complete the list in my upcoming 
> book.
> 
>> Am 2019-10-14 um 11:17 schrieb Hans Hagen :
>> 
>> When developing pdf specific code (like last months) I do use acrobat reader 
>> and an older acrobat x (which keeps telling me that it wants to be updated 
>> but the update fails) ... both have their different issues. Acrobat X has 
>> some validation on board and one can introspect the file (and fonts) to some 
>> extend but in the end it's often still trial and error.
> 
> Do you know any other tools for PDF debugging? Those few I know of cost four 
> to five figures or were plugins to very old versions of Acrobat

Most of my PDF debugging is done using 'mutool clean’ (especially with the -d 
switch) and textmate / diff.

Best wishes,
Taco


___
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] PDF viewer poll

2019-10-15 Thread Hans Hagen

On 10/15/2019 6:42 AM, Henning Hraban Ramm wrote:


Do you know any other tools for PDF debugging? Those few I know of cost four to 
five figures or were plugins to very old versions of Acrobat.


normally i trust my eyes and mind and 'standard' ... if it really get 
hairy there are a few folks one can ask for a second opinion



Acrobat used to be ok upto version 6 (I even remember the msdos version to be 
ok) but each version the user interface changed fo rthe worse  (very bad imo 
and an indication that it's not meant for power usage as there one wants at 
least an upward compatible interface) and it's slower compared to other viewers 
(probably due to color management).


I agree. Adobe needlessly changed the interface with every release, and it 
didn’t get better.
There were different translation errors (at least in the German interface) in 
every version, and they never got fixed with the updates.
Updates were announced by the Updater, but never installed.
Don’t know about the speed – some functions like certificate lookup were always 
dead slow, and the display speed was mostly ok. (I should benchmark different 
viewers with my OpenStreetMap vector maps…)


speed is ok, but when using acrobat one has to close/open which takes 
time (and then go to the right spot again)



I found Qoppa’s PDF Studio Pro a viable alternative to Acrobat Pro with a 
usable interface (default has ribbons, but you can switch it).
Their customer support is friendly, I hope they will also fix the problems I 
reported.


i must admit that i never used these alternatives (and i'm not going to 
spend money on programs just for testing)



=== javascript ===
Only acrobat offers that.


Not completely true. But there aren’t a lot of apps that support JS in PDF - for a reason: if you 
allow scripting, you create a lot of vulnerabilities that you can easily avoid leaving out this 
feature that "nobody" needs. It would have made sense to define a small and safe JS (or 
whatever scripting language) _subset_ from the start, but the early versions of Acrobat were 
completely "hackable", and they only much later thought about security (like in lots of 
other programs). PDF viruses existed.


i always wondered why they added all those 'editing features' ... the 
hold plugging was also kind of random



Basically javascript can be limited to (1) setting annotation properties, like 
toggling layers or button renditions, and (2) some simple calculations (for 
forms). Constructing pdf runtime using javascript is pretty braindead (use html 
instead then).


D’accord.


It is one of the puzzling areas to me: no problem in browsers and elsewhere but 
not in open source pdf viewers. It's not the most complex stuff so it probably 
indicates that no one cares much about these features.


I wouldn’t say "no problem", because JS causes security problems everywhere.


Depends: enabling a layer? checking a value in a field? turning a button 
appearance on / off? Only lousy programing can make that buggy. A 
reasonable subsset can be made pretty robust. Launching a video is also 
quite harmless.



=== annotations ===

Some useful stuff was dropped: like native sound and movies (was very simple: 
show a movie, play a sound, simple annotations). What seems to be natural to 
html became complex and unuseable in pdf ... the media subsystem is (obsolete) 
flash based, imo mostly driven by third party commercial pressure / demand / 
whatever. Not future safe, if working at all: from simple to complex to useless.


If I remember correctly, Adobe first based the media subsystem on Apple’s 
Quicktime until Apple discontinued that on Windows and Adobe bought Macromedia, 
including Flash. 3D media was a short hype, nobody used it. Anyway, doesn’t 
matter. Nowadays PDF doesn’t have any working media subsystem.


indeed. but just supporting mp3, flac and mp4 and maybe a few video 
formats would be enough ... i guess that there are plenty of libs out 
they that they vould use (but instead they went for flash and flash 
driven controls and pretty complex 3d stuff)



In a similar fashion forms (for some widgets bugs because features esp default 
rendering, inheritance, etc and also some strange relation with viewer 
settings, that change per version). It made me loose interest it those things 
that once were promising.


I can understand that, but at least ConTeXt’s radiobuttons *have* bugs; the few 
viewers that support forms stumble over some parsing/nesting error. Adobe 
catches it apparently.


they don't catch all (differs per version which is why the code changed 
over time) ... much has to do with appearances (mostly dingbat driven in 
acrobat itself, but we want different things, possible per standard, but 
these all have timing and initialization issues and some even have 
pseudo documented issues with what happens when a page opens ... i 
presume it works with their own tools but then these can impose 
limitations that texies never would like



(Some 

Re: [NTG-context] \ctxlua and \startluacode ... \stopluacode

2019-10-15 Thread Taco Hoekwater
Hi Rudolf,

> On 15 Oct 2019, at 00:50, Rudolf Bahr  wrote:
> 
> Now to your suggestion not to use "assert ()". Indeed it's a solution! My 
> program
> works! I append again its output (again just for fun!). Did you really try it 
> or
> has it been just an idea?

First, let me say that embedded lua versions are typically a little bit 
different 
from standalone. Just how much different depends on the embedding program. 
Luatex 
is actually pretty close to standalone lua. Luatex adds a bunch of extension 
libraries,
but it changes very little of the core language. And all those changes are 
documented
in the luatex manual. None of those changes affect your minimal example, except
that lua errors are handled a little differently.

Note that standalone lua *also* produces an error, as that is what assert() is 
supposed to do. And when lua runs into an error, it ignores the rest of the 
current 
chunk: 

  “... whenever an error occurs, Lua ends the current chunk and returns 
  to the application.” (from lua.org)

Standalone lua typically sees only one chunk (the file you pass on the command
line) but embedded lua implementation often see (sometimes many) more chunks.
In luatex’s case, each \directlua is a separate chunk (in ConTeXt, that means 
every 
\startluacode block and every \ctxlua call is a separate chunk).

The only unusual thing here is that standalone lua silently quits and returns a 
non-zero exit code to the shell, whereas luatex gives you the typical TeX-style 
error prompt. The rationale for that is: lua errors can happen in many places 
in 
your input file, and if they were silently ignored, your typeset pages could be 
wrong without you realising it.


And to answer your question above: I did not have to try or guess. I know about 
how assert() works because it is documented in the lua manual (and as it closely
mimics the assert() C function, that is easy for me to remember).

Best wishes,
Taco

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