[NTG-context] ConteXt commands in an rtl environment

2024-04-28 Thread Alan Bowen
I am having trouble entering ConteXt commands in an rtl language, in this
case Hebrew.

How does one make the last(left hand) letter of the Hebrew word
אשר
a superscript?

My experiments with \high{...} have not been successful so far in part, I
think, because I have not got the brackets right.

Any tips or pointers will be gratefully received.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why are ConTeXt-SBL endnotes empty?

2024-04-22 Thread Joel via ntg-context
 Changing location=none to location=text still left me with the bullet points 
appearing in a big list at the end of my chapter, but without any messages in 
them.

On Monday, April 22, 2024 at 07:54:39 AM MDT, Joel via ntg-context 
 wrote:  
 
 A few years back, I tried using endnotes with ConTeXt-SBL, and it failed to 
compile. I'm forced to try again (due to some other issue with footnotes), and 
instead of compiling to error, it compiles, but the footnote's message ends up 
being empty. 
Why is it appearing empty? Is there a fix?

Here is a minimum working example:
\usemodule[publ-imp-sbl]
\startbuffer [bib]

@Article{na2006,
title={Volcanoes \word{of} New Mexico},
year={2006},
journal={New Mexico Earth Matters},
publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral Resources},
volume={6},
number={1},
location={Socorro, New Mexico}
}

@Book{clark1989,
author = {Clark, William},
title = {Railroads \word{and} railroad towns \word{in} New Mexico},
publisher = {New Mexico Magazine},
year = {1989},
address = {Albuquerque, New Mexico},
isbn = {9780937206126}
}

\stopbuffer

\usebtxdataset[bib.buffer]

\setupbtx[dataset=default]
\usebtxdefinitions[sbl]
\setupbtx[sbl]

\setupnote[footnote][location=none]

\starttext

   \input knuth
    \cite[clark1989]

    \placenotes[footnote]

    
    \startchapter[title=Bibliography]
    \placelistofpublications
    \stopchapter

\stoptext

--Joel


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki    : https://wiki.contextgarden.net
___
  ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Why are ConTeXt-SBL endnotes empty?

2024-04-22 Thread Joel via ntg-context
A few years back, I tried using endnotes with ConTeXt-SBL, and it failed to 
compile. I'm forced to try again (due to some other issue with footnotes), and 
instead of compiling to error, it compiles, but the footnote's message ends up 
being empty. 
Why is it appearing empty? Is there a fix?

Here is a minimum working example:
\usemodule[publ-imp-sbl]
\startbuffer [bib]

@Article{na2006,
title={Volcanoes \word{of} New Mexico},
year={2006},
journal={New Mexico Earth Matters},
publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral Resources},
volume={6},
number={1},
location={Socorro, New Mexico}
}

@Book{clark1989,
author = {Clark, William},
title = {Railroads \word{and} railroad towns \word{in} New Mexico},
publisher = {New Mexico Magazine},
year = {1989},
address = {Albuquerque, New Mexico},
isbn = {9780937206126}
}

\stopbuffer

\usebtxdataset[bib.buffer]

\setupbtx[dataset=default]
\usebtxdefinitions[sbl]
\setupbtx[sbl]

\setupnote[footnote][location=none]

\starttext

   \input knuth
    \cite[clark1989]

    \placenotes[footnote]

    
    \startchapter[title=Bibliography]
    \placelistofpublications
    \stopchapter

\stoptext

--Joel


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Very bizarre bug

2024-04-07 Thread Hans Hagen

On 4/7/2024 7:08 PM, Thomas A. Schmitz wrote:

Hi everybody,

this is bizarre, but hear me out: a file that I have has a mixture of 
xml, TeX and Lua. It compiles cleanly, no problem, on macos and linux. I 
also have a little raspberry pi on which I have installed lmtx. The file 
compiles, BUT: it has one additional page. The first page of the 
document is empty and has the word "on" in the upper left hand corner of 
the text area. I have checked several times, it always comes out like 
this. Everything else is exactly the same - context version, file and 
environment files (everything under git, so really identical). The "on" 
does not appear if I just make a "hello world" document on the raspi. So 
my question is: how can I begin to explore where this word creeps in? I 
suspect it's something in the linux-aarch64 tree or some test for this 
architecture that is the culprit, but what would be a good way to trace it?


can you make a format with line 25 of context.mkxl uncommented to see if 
you get a message (not production, just a test)


Hans


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

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Very bizarre bug

2024-04-07 Thread Thomas A. Schmitz

Hi everybody,

this is bizarre, but hear me out: a file that I have has a mixture of 
xml, TeX and Lua. It compiles cleanly, no problem, on macos and linux. I 
also have a little raspberry pi on which I have installed lmtx. The file 
compiles, BUT: it has one additional page. The first page of the 
document is empty and has the word "on" in the upper left hand corner of 
the text area. I have checked several times, it always comes out like 
this. Everything else is exactly the same - context version, file and 
environment files (everything under git, so really identical). The "on" 
does not appear if I just make a "hello world" document on the raspi. So 
my question is: how can I begin to explore where this word creeps in? I 
suspect it's something in the linux-aarch64 tree or some test for this 
architecture that is the culprit, but what would be a good way to trace it?


All best

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] start/end pages in ToC

2024-03-26 Thread Alan Bowen
Our journal is currently in the process of moving to continuous publication
of items in a given volume as they are ready. This entails re-jigging the
ToC so that it now includes the start and end page numbers of each item. So
far, I have everything pretty much in the right place, but for the page
numbers I am getting only “??”. I am not sure why this is happening and
would be grateful if someone could tell me why or point me to
documentation that explains the problem and how to solve it.

Many thanks in advance.

My minimalish working example:

\definehead[SourceTitle][chapter]
\setuphead[SourceTitle][page=yes,
footer={ItemData}]

\definehead[StudyTitle][chapter]
\setuphead[StudyTitle][page=yes,
footer={ItemData}]

\definetext[ItemData][footer][
{\at[\Reference]–
\at[\namedstructureuservariable{}{authorInitials}endPage]}
]
\setuplist[SourceTitle][
state=start,
textcolor=black,
alternative=startendpages,
criterium=all,
headnumber=no,
interaction=page,
numberalign=flushright,
before={\blank[2.2ex, fixed]},
inbetween=\endgraf,
]

\setuplist[StudyTitle][
state=start,
textcolor=black,
alternative=startendpages,
criterium=all,
headnumber=no,
interaction=all,
numberalign=flushright,
before={\blank[2.2ex, fixed]},
inbetween=\endgraf,
]

\define\ToCEntry{%
\structurelistuservariable{author}\crlf
\structurelistuservariable{title}\hfill%
\at[\structurelistuservariable{reference}]–%
\at[\structurelistuservariable{authorInitials}endPage]
}

\definelistalternative[startendpages]
[renderingsetup=list:startendpages]

\startsetups[list:startendpages]
{\ToCEntry}
\vglue1pc
\stopsetups

\starttext

{\tfa\bf Contents}

\blank[line, fixed]
\WORD{Sources}
\blank[halfline, fixed]
\placelist[SourceTitle][criterium=all]

\blank[line, fixed]
\WORD{Studies}
\blank[halfline, fixed]
\placelist[StudyTitle][criterium=all]

\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSo01}
\startSourceTitle[reference={\Reference},
bookmark=Source01,
title={}][
title=Source01,
author=Author01,
authorInitials=ABC,
reference={\Reference},
]
\input knuth
\page
\dorecurse{25}{\input ward\par}
\reference[ABCendPage]{}
\stopSourceTitle
\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSo02}
\startSourceTitle[reference={\Reference},
bookmark=Source02,
title={}][
author=Author02,
title=Source02,
authorInitials=PQR,
reference={\Reference},
]

\input knuth
\page
\dorecurse{10}{\input ward\par}
\reference[PQRendPage]{}
\stopSourceTitle
\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSt01}
\startStudyTitle[reference={\Reference},
bookmark=Study01,
title={}][
author=Author03,
title=Study01,
authorInitials=XYZ,
reference={\Reference},
]
\input knuth
\blank[big]
\page
\dorecurse{15}{\input ward\par}
\reference[XYZendPage]{}
\stopStudyTitle
\page[makeup]
\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Wiki page : Mixed languages sample (French, Ancient Greek, Arabic, Chinese)

2024-03-01 Thread Jean-Pierre Delange
ι. ταῦτα δὴ ἐκαλλωπισάμην, ἵνα καλὸς 
παρὰ καλὸν ἴω}.


\noindent \quotation{Je rencontrai, dit-il, Socrate, sortant du bain et 
les pieds chaussés de sandales, ce qui n'est guère dans ses habitudes, 
et je lui demandai où il allait si beau. Il me répondit : «Je vais dîner 
chez Agathon. Je me suis dérobé hier à la fête qu'il a donnée en 
l'honneur de sa victoire, parce que je craignais la foule; mais je me 
suis engagé à venir le lendemain : voilà pourquoi je me suis paré; je 
voulais être beau pour venir chez un beau garçon}\inmargin{Platon, {\em 
Banquet}, 174a}.


\stopnarrower

On pourrait assurément faire mieux en matière d'édition. Par exemple, 
mettre le texte grec à gauche et sa traduction française à droite sur la 
même page, ce qui donnerait quelque chose comme ceci :


\startnarrower[1*left,1*right]\tfx\setupinterlinespace

\startTwoColumns

\quotation{Ἔφη γάρ οἱ Σωκράτη ἐντυχεῖν λελουμένον τε καὶ τὰς βλαύτας 
ὑποδεδεμένον, ἃ ἐκεῖνος ὀλιγάκις ἐποίει· καὶ ἐρέσθαι αὐτὸν ὅποι ἴοι οὕτω 
καλὸς γεγενημένος. καὶ τὸν εἰπεῖν ὅτι· Ἐπὶ δεῖπνον εἰς Ἀγάθωνος. χθὲς 
γὰρ αὐτὸν διέφυγον τοῖς ἐπινικίοις, φοβηθεὶς τὸν ὄχλον· ὡμολόγησα δ᾽ εἰς 
τήμερον παρέσεσθαι. ταῦτα δὴ ἐκαλλωπισάμην, ἵνα καλὸς παρὰ καλὸν 
ἴω}.\TwoColumns


\quotation{Je rencontrai, dit-il, Socrate, sortant du bain et les pieds 
chaussés de sandales, ce qui n'est guère dans ses habitudes, et je lui 
demandai où il allait si beau. Il me répondit : «Je vais dîner chez 
Agathon. Je me suis dérobé hier à la fête qu'il a donnée en l'honneur de 
sa victoire, parce que je craignais la foule ; mais je me suis engagé à 
venir le lendemain : voilà pourquoi je me suis paré ; je voulais être 
beau pour venir chez un beau garçon}.


\stopTwoColumns

\stopnarrower

\section{Éditer avec \LaTeX : l'alternative \ConTeXt}

Les lecteurs habitués ont reconnu dans les paragraphes précédents la 
marque et la technique du logiciel d'édition \LaTeX. Cependant, 
l'utilisation de ce logiciel repose sur un ensemble assez important de 
déclarations et il est nécessaire d'avoir une longue pratique pour 
arriver à jouer avec, sinon la puissance, du moins la finesse de \LaTeX. 
Les commandes sont très nombreuses et il faut recourir souvent à un 
Manuel pour se remémorer les subtilités qui ont permis d'atteindre tel 
rendu à l'impression. Bien entendu, il existe des logiciels commerciaux 
d'aide à l'édition professionnelle pour le secteur des Humanités. Mais 
d'une part ils sont payants et relativement coûteux pour une personne, 
sans parler du prix des licences pour les groupements professionnels 
d'enseignants et de chercheurs.


Devant cet état de choses, on peut se tourner vers \ConTeXt, qui n'est 
pas une alternative à \LaTeX, mais une manière plus synthétique (voire 
plus élégante) d'utiliser \LaTeX. \ConTeXt, de même que \LaTeX, est une 
suite logicielle qui contient les macros de \LaTeX, les routines du 
langage {\em Perl}, ainsi que les macros de \LuaTeX. On peut donc 
définir à peu près tout ce qui est exigé au niveau de l'édition 
professionnelle, sans entrer dans la connaissance technique du langage 
\LaTeX. Bien entendu, on n'échappera pas à un certain nombre de 
questions techniques, si l'on veut travailler avec ce type d'outil : 
pour le mathématicien, rendre possible la présentation et l'édition 
parfaites d'équations complexes, mais aussi de schémas et de tableaux 
nécessite un apprentissage assez poussé. C'est vrai aussi pour les les 
utilisateurs qui viennent des Humanités, qui connaissent leur domaine, 
et qui veulent rédiger un document simple, un article de revue, voir des 
chapitres entiers d'un ouvrage. Très certainement, ce sont les éditeurs 
qui se chargent de la mise en page (sur la base d'une feuille de style 
Word) du document que l'on veut publier. Mais parfois, s'il s'agit d'un 
dossier de plusieurs articles, voire d'une édition avec une aide 
financière à la publication, on aimerait avoir la main sur la qualité du 
document imprimé. C'est une des raisons qui font que l'on pourrait 
désirer maîtriser la chaîne éditoriale, non seulement pour se passer 
éventuellement d'un éditeur, mais pour disposer d'un aperçu de son 
propre travail.



\section{Faire coexister du Grec, du Chinois et de l'Arabe dans le même 
texte}


Il n'est pas d'usage commun de lire dans le même document du texte 
courant en français, une référence en grec, par exemple, lorsque dans le 
{\em Timée}, Platon indique que le plus difficile est de commencer par 
un commencement qui soit naturel (κατὰ φύσιν ἀρχήν)\inmargin{Platon, 
{\em Timée}, 29b.}, une indication du nom du philosophe chinois {\em 
Tchouang Tseu} (en {\em pinyin}\footnote{Le {\em pinyin} (chinois 
classique 漢語拼音, littéralement “assembler les sons de la langue des 
Han”), est une romanisation de la langue chinoise, qui est écrite en 
alphabet latin. Ainsi, au lieu d'écrire 漢語拼音 en chinois traditionnel, ou 
bien 汉语拼音 en chinois simplifié, on écrira {\em Hànyù Pīnyīn}.} Zhuangzi 
et en chinois classique et simplifié :

[NTG-context] Re: Works now! At Work, and a question to paragraphs in an Theorem

2024-02-27 Thread Pablo Rodriguez via ntg-context
On 2/27/24 10:10, Ursula Hermann wrote:
>[...]
> I have a question to my paragraphs:
>
> \definetextbackground[Paragaph][
> [...]
>   \startparagraph

Hi Uschi,

if you define Paragaph, then you should use \startParagaph (and
\stopParagaph).

> \starttext

Even if that works, it would be better to nest commands (\starttext
before \startparagraph).

> [...]
> So this is the example. What I like to do: The first paragraph should be
> normal written, but the second one should have more space between the
> words. Because of Math: Is \hspace the right way? The right command? And
> using \startnarrower, \stopnarrower?

Narrower refers to margins. Extra space between words would be something
different (at least, as far as I get it).

That being said, I have no idea how to get different inter-word spacing.

Just in case it might help,

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Emanuel Han via ntg-context
Thanks Mikael. This helped indeed.
I updated my example on the Metapost page in the wiki accordingly.

The`pagestate=start` functionality is not documented in the wiki. It's not 
clear for which context commands it can or should be used. Who is willing to 
help out here?
Best regards
Emanuel
On Feb. 19 2024, at 2:39 pm, Mikael Sundqvist  wrote:
> Hi,
>
> Try
> \startTEXpage[pagestate=start]
> /Mikael
> On Mon, Feb 19, 2024 at 2:31 PM Emanuel Han via ntg-context
>  wrote:
> >
> >  I just made a strange observation in the output pdf of the attached 
> > layer_set.tex, which is that when opening it with a pdf viewer like skim or 
> > macos preview and showing miniatures, all pages except the last one show 
> > page number 1 (the last showing page number 2).
> >
> > Which was not the case with the output pdf of the attached 
> > multipage_metapost_mwe-very_simple.tex.
> >
> > How can I change my code to have proper consecutive page numbering in a pdf 
> > viewer?
> >
> > On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context 
> >  wrote:
> >
> > I think I could solve all the problems. Attached the finalized working 
> > example. I created the 
> > https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages 
> > entry with it. Feel free to modify.
> >
> > Cheers
> > Emanuel
> >
> > On Feb. 16 2024, at 7:56 am, Mikael Sundqvist  wrote:
> >
> > Hi,
> >
> > not sure I get what you are missing. But you can try
> >
> > setbounds currentpicture to (fullsquare scaled 200) ;
> >
> > in base. And then do
> >
> > \dorecurse{5}{
> > \startTEXpage[offset=1DK]
> > \useMPgraphic{layerset#1}
> > \stopTEXpage
> > }
> >
> > if that is the looping you are after.
> >
> > /Mikael
> >
> > On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context
> >  wrote:
> > >
> > > Resp. the solution should be such that each generated PDF page has the 
> > > same dimension, the same background colour and a page number and the 
> > > metapost content on each page has the same scaling factor.
> > >
> > > On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context 
> > >  wrote:
> > >
> > > Dear Mikael,
> > >
> > > I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> > > on), because I need the "setbounds currentpicture to TheFrame" and also 
> > > because I need page numbering inside the MPpage, as done with draw 
> > > textext(decimal(currentime)).
> > >
> > > So, how can I use the \useMPgraphic{layerset1} etc. inside the 
> > > \dorecurse, assuming I name my layersets "layerset1", "layerset2", 
> > > "layerset3" etc.?
> > >
> > > Emanuel
> > >
> > > On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
> > >  wrote:
> > >
> > > Dear Mikael,
> > > thanks a lot!
> > > this seems to be the solution! And it looks beatiful enough to me 
> > > I'll try to port all my layers to this new method and see if I run into 
> > > new problems again 
> > >
> > > Emanuel
> > >
> > >
> > > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> > >
> > > Hi
> > >
> > > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> > >  wrote:
> > > >
> > > > Dear list,
> > > >
> > > > the attached .tex file is the minimal working example we discussed 
> > > > today in the online meeting.
> > > >
> > > > I realized that the approach of looping through k of p[k] is not 
> > > > fitting my needs, because it's not flexible enough.
> > > >
> > > > I need another approach, one which works with layer sets.
> > > >
> > > > I would stop using p as an array, because with the layer sets approach 
> > > > we don't have a fixed order of the layers.
> > > >
> > > > So the definition of the layers would be something like
> > > >
> > > > picture layerA;
> > > > layerA:=image(
> > > > label("Word 1", z1);
> > > > );
> > > >
> > > > picture layerW;
> > > > layerW:=image(
> > > > label("Mot 2", z2);
> > > > );
> > > >
> > > > picture layerM;
> > > > layerM:=image(
> > > > label("Parola 3"

[NTG-context] Re: Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Mikael Sundqvist
Hi,

Try

\startTEXpage[pagestate=start]

/Mikael

On Mon, Feb 19, 2024 at 2:31 PM Emanuel Han via ntg-context
 wrote:
>
>  I just made a strange observation in the output pdf of the attached 
> layer_set.tex, which is that when opening it with a pdf viewer like skim or 
> macos preview and showing miniatures, all pages except the last one show page 
> number 1 (the last showing page number 2).
>
> Which was not the case with the output pdf of the attached 
> multipage_metapost_mwe-very_simple.tex.
>
> How can I change my code to have proper consecutive page numbering in a pdf 
> viewer?
>
> On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context 
>  wrote:
>
> I think I could solve all the problems. Attached the finalized working 
> example. I created the 
> https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry 
> with it. Feel free to modify.
>
> Cheers
> Emanuel
>
> On Feb. 16 2024, at 7:56 am, Mikael Sundqvist  wrote:
>
> Hi,
>
> not sure I get what you are missing. But you can try
>
> setbounds currentpicture to (fullsquare scaled 200) ;
>
> in base. And then do
>
> \dorecurse{5}{
> \startTEXpage[offset=1DK]
> \useMPgraphic{layerset#1}
> \stopTEXpage
> }
>
> if that is the looping you are after.
>
> /Mikael
>
> On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context
>  wrote:
> >
> > Resp. the solution should be such that each generated PDF page has the same 
> > dimension, the same background colour and a page number and the metapost 
> > content on each page has the same scaling factor.
> >
> > On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context 
> >  wrote:
> >
> > Dear Mikael,
> >
> > I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> > on), because I need the "setbounds currentpicture to TheFrame" and also 
> > because I need page numbering inside the MPpage, as done with draw 
> > textext(decimal(currentime)).
> >
> > So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
> > assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
> >
> > Emanuel
> >
> > On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
> >  wrote:
> >
> > Dear Mikael,
> > thanks a lot!
> > this seems to be the solution! And it looks beatiful enough to me 
> > I'll try to port all my layers to this new method and see if I run into new 
> > problems again 
> >
> > Emanuel
> >
> >
> > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> >
> > Hi
> >
> > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> >  wrote:
> > >
> > > Dear list,
> > >
> > > the attached .tex file is the minimal working example we discussed today 
> > > in the online meeting.
> > >
> > > I realized that the approach of looping through k of p[k] is not fitting 
> > > my needs, because it's not flexible enough.
> > >
> > > I need another approach, one which works with layer sets.
> > >
> > > I would stop using p as an array, because with the layer sets approach we 
> > > don't have a fixed order of the layers.
> > >
> > > So the definition of the layers would be something like
> > >
> > > picture layerA;
> > > layerA:=image(
> > > label("Word 1", z1);
> > > );
> > >
> > > picture layerW;
> > > layerW:=image(
> > > label("Mot 2", z2);
> > > );
> > >
> > > picture layerM;
> > > layerM:=image(
> > > label("Parola 3", z3);
> > > );
> > >
> > > picture layerC;
> > > layerC:=image(
> > > label("Wort 4", z3+z1);
> > > );
> > >
> > > picture layerY;
> > > layerY:=image(
> > > label("Nummer 5", z2+z3);
> > > );
> > >
> > > picture layerU;
> > > layerU:=image(
> > > label("number 6", z2+z1);
> > > );
> > >
> > > After that, I would define layer sets and layer subsets. This will be 
> > > done manually for each layer set and each layer subset.
> > > I don't know the proper syntax to do that. Let's assume we could use a 
> > > variable type called "myset".
> > >
> > > myset layersubsetGamma;
> > > layersubsetGamma:={layerU,layerM};
> > >
> > > In my logic, the layers will be drawn i

[NTG-context] Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Emanuel Han via ntg-context
 I just made a strange observation in the output pdf of the attached layer_set.tex, which is that when opening it with a pdf viewer like skim or macos preview and showing miniatures, all pages except the last one show page number 1 (the last showing page number 2). Which was not the case with the output pdf of the attached multipage_metapost_mwe-very_simple.tex. How can I change my code to have proper consecutive page numbering in a pdf viewer?On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context  wrote:I think I could solve all the problems. Attached the finalized working example. I created the https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry with it. Feel free to modify.CheersEmanuelOn Feb. 16 2024, at 7:56 am, Mikael Sundqvist  wrote:Hi,not sure I get what you are missing. But you can trysetbounds currentpicture to (fullsquare scaled 200) ;in base. And then do\dorecurse{5}{\startTEXpage[offset=1DK]\useMPgraphic{layerset#1}\stopTEXpage}if that is the looping you are after./MikaelOn Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context wrote:>> Resp. the solution should be such that each generated PDF page has the same dimension, the same background colour and a page number and the metapost content on each page has the same scaling factor.>> On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context  wrote:>> Dear Mikael,>> I actually need to keep the \dorecurse mechanism of the mwe (from line 44 on), because I need the "setbounds currentpicture to TheFrame" and also because I need page numbering inside the MPpage, as done with draw textext(decimal(currentime)).>> So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?>> Emanuel>> On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context  wrote:>> Dear Mikael,> thanks a lot!> this seems to be the solution! And it looks beatiful enough to me > I'll try to port all my layers to this new method and see if I run into new problems again >> Emanuel>>> On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:>> Hi>> On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context>  wrote:> >> > Dear list,> >> > the attached .tex file is the minimal working example we discussed today in the online meeting.> >> > I realized that the approach of looping through k of p[k] is not fitting my needs, because it's not flexible enough.> >> > I need another approach, one which works with layer sets.> >> > I would stop using p as an array, because with the layer sets approach we don't have a fixed order of the layers.> >> > So the definition of the layers would be something like> >> > picture layerA;> > layerA:=image(> > label("Word 1", z1);> > );> >> > picture layerW;> > layerW:=image(> > label("Mot 2", z2);> > );> >> > picture layerM;> > layerM:=image(> > label("Parola 3", z3);> > );> >> > picture layerC;> > layerC:=image(> > label("Wort 4", z3+z1);> > );> >> > picture layerY;> > layerY:=image(> > label("Nummer 5", z2+z3);> > );> >> > picture layerU;> > layerU:=image(> > label("number 6", z2+z1);> > );> >> > After that, I would define layer sets and layer subsets. This will be done manually for each layer set and each layer subset.> > I don't know the proper syntax to do that. Let's assume we could use a variable type called "myset".> >> > myset layersubsetGamma;> > layersubsetGamma:={layerU,layerM};> >> > In my logic, the layers will be drawn in the order of their appearance within the {}. In the example, drawn content of layerM might cover drawn content of layerU.> >> > Contrary to a layer subset, each layer set will result in a PDF page, and thus the layer sets are related to each other by an inner order. That's why I would use an array variable here with [].> >> > I don't know how to append a set. In the following example, I assumed there would be a function myappend(, )> >> > myset layerset[];> > layerset1 := {layerW,layerA};> > layerset2 := myappend{layerset1, layerY};> > layerset3 := myappend{layerset2, layersubsetGamma};> > layerset4 := myappend{layerset2, layerU};> > layerset5 := myappend{layerset4, layersubsetGamma};> >> > Finally, I would need each layerset[k] typeset on its own pdf page. And of course on each page k, only the layers which appear in the definition of the layerset[k] should be drawn on top of each other in the order as they appear in that definition.> >>

[NTG-context] Re: manuals

2024-02-18 Thread Jean-Pierre Delange

Hello everyone!
 As an eternal newbie (with a memory like a goldfish), I started by 
building my own documentation from the web pages constructed by Bertrand 
Masson (prehistory archaeologist in Northern France) "les fiches à 
Bébert" (obsolete version here: http://bertrandmasson.free.fr/; new 
recommended version here: 
http://lesfichesabebert.fr/TeX/context/context-intro.html). As 
mentionned by Alain Delmotte.
Bertrand Masson always keeps his site up to date, as he gives references 
to the documentation compiled by Garulfo (Joaquín Ataz López ), 
available in several languages, which I personally found well-done, 
useful and welcome. It's interesting to note with a rather positive 
smile that documentations, even if they're never really up to date in 
the details of ConTeXt's evolution, copy each other: that's what I did 
to write the beginning of a Wikibook in French 
(https://fr.wikibooks.org/wiki/ConTeXt/Qu%27est-ce_que_ConTeXt_%3F). I 
took things written by Bertrand Masson and was partially taken over by 
Garulfo and so on.
Fortunately, the ConTeXT discussion list offers MWEs: all you have to do 
is to test them and save these examples on your system in the CTX-TESTS 
document folder. The next step is to classify these examples under the 
appropriate headings, then insert them into a coding system for a 
complex document that always calls for requests for explanations from 
discussion list participants.


This question of documentation seems to me to be an age-old snake, not 
only on a technical subject which can be complex, as ConTeXt can be, but 
also concerning other types of documentation. For my part, although I 
haven't yet exhausted all the available documentation resources, whether 
internal to the distribution, or online like the ConTeXt Garden wiki, I 
think (but this has been better expressed here by others than me) that a 
real documentation refresh could be carried out collectively, with the 
great ambition of keeping obsolete documentation in an archive, while 
proposing a wiki with the date of update visible, in correlation with 
the PDF version. I have no idea how this documentation update could be 
achieved, but the fact is that it would be desirable to devote a section 
to the purely technical and basic aspects of CTX installation and font 
availability on Windows, Mac OS, Linux, BSD, etc., with MWEs and 
examples a little more detailed. Once this documentation has been passed 
as an introductory part (itself containing chapters explaining how this 
page of documentation was put together, with notes in the margins, 
etc.), this book could introduce MKIV, LuaTeX, MetaPost and so on, but 
with a clear distinction between the objectives sought: writing 
documentation with figures, writing a thesis in mathematics and physics, 
how to construct figures, or a bibliography. Not to mention the handling 
of photographs in an aesthetically demanding layout; all this with the 
possibility of showing complete or partial examples of work produced...


In a nutshell: even if I give the impression that I'm asking you to 
reinvent the wheel, in reality it's a question of collating relevant 
existing information in a way that is intelligible and clear to the 
neophyte, but that also meets the demands of experienced users, who 
don't all use ConTeXt for the same reasons. Don't get me wrong: I'm not 
telling you what to do, I'm just giving you my opinion. Basically, I'm 
saying: documentation exists, but it has to be reliable, up to date, 
easy to find and enable you to make progress in difficult situations. As 
I said, I found Garulfo's work very welcome. It's not obsolete and 
doesn't need replacing. But perhaps it could be amended on certain 
points and completed and made available both in PDF and online in the 
ConTeXt Garden wiki pages?


So, if by hypothesis the relevant documentation exists, here and there, 
but it's in the middle of pages that are in the past, it can be 
considered a daunting task to go looking for information that you 
realize is no longer up to date, because experience shows that it's no 
longer reliable. If confusion reigns, those seeking to apply what 
they've read risk turning away from ConTeXt, or asking the same 
questions over and over again.


So there's plenty of food for thought to be had when it comes to methods 
for overhauling existing documentation. It's not a question of thinking 
long and hard about the availability of this documentation (on line or 
as a PDF?), but rather of knowing whether to build an encyclopedia, or a 
series of manuals, each of which is intended to circumscribe as closely 
as possible the problems encountered when attempting this or that form 
of page layout.


I remember being astonished to discover, when I first started learning 
ConTeXt, all the vocabulary that existed around page layout (in French: 
Grand fond, petit fond, blanc de tête, blanc de pied, etc.), vocabulary 
that we ignore when we come from Word office autom

[NTG-context] Re: Working with layer sets with Metapost

2024-02-17 Thread Emanuel Han via ntg-context
I think I could solve all the problems. Attached the finalized working example. 
I created the 
https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry 
with it. Feel free to modify.

Cheers
Emanuel

On Feb. 16 2024, at 7:56 am, Mikael Sundqvist  wrote:
> Hi,
>
> not sure I get what you are missing. But you can try
> setbounds currentpicture to (fullsquare scaled 200) ;
> in base. And then do
> \dorecurse{5}{
> \startTEXpage[offset=1DK]
> \useMPgraphic{layerset#1}
> \stopTEXpage
> }
>
> if that is the looping you are after.
> /Mikael
> On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context
>  wrote:
> >
> > Resp. the solution should be such that each generated PDF page has the same 
> > dimension, the same background colour and a page number and the metapost 
> > content on each page has the same scaling factor.
> >
> > On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context 
> >  wrote:
> >
> > Dear Mikael,
> >
> > I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> > on), because I need the "setbounds currentpicture to TheFrame" and also 
> > because I need page numbering inside the MPpage, as done with draw 
> > textext(decimal(currentime)).
> >
> > So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
> > assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
> >
> > Emanuel
> >
> > On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
> >  wrote:
> >
> > Dear Mikael,
> > thanks a lot!
> > this seems to be the solution! And it looks beatiful enough to me 
> > I'll try to port all my layers to this new method and see if I run into new 
> > problems again 
> >
> > Emanuel
> >
> >
> > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> >
> > Hi
> >
> > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> >  wrote:
> > >
> > > Dear list,
> > >
> > > the attached .tex file is the minimal working example we discussed today 
> > > in the online meeting.
> > >
> > > I realized that the approach of looping through k of p[k] is not fitting 
> > > my needs, because it's not flexible enough.
> > >
> > > I need another approach, one which works with layer sets.
> > >
> > > I would stop using p as an array, because with the layer sets approach we 
> > > don't have a fixed order of the layers.
> > >
> > > So the definition of the layers would be something like
> > >
> > > picture layerA;
> > > layerA:=image(
> > > label("Word 1", z1);
> > > );
> > >
> > > picture layerW;
> > > layerW:=image(
> > > label("Mot 2", z2);
> > > );
> > >
> > > picture layerM;
> > > layerM:=image(
> > > label("Parola 3", z3);
> > > );
> > >
> > > picture layerC;
> > > layerC:=image(
> > > label("Wort 4", z3+z1);
> > > );
> > >
> > > picture layerY;
> > > layerY:=image(
> > > label("Nummer 5", z2+z3);
> > > );
> > >
> > > picture layerU;
> > > layerU:=image(
> > > label("number 6", z2+z1);
> > > );
> > >
> > > After that, I would define layer sets and layer subsets. This will be 
> > > done manually for each layer set and each layer subset.
> > > I don't know the proper syntax to do that. Let's assume we could use a 
> > > variable type called "myset".
> > >
> > > myset layersubsetGamma;
> > > layersubsetGamma:={layerU,layerM};
> > >
> > > In my logic, the layers will be drawn in the order of their appearance 
> > > within the {}. In the example, drawn content of layerM might cover drawn 
> > > content of layerU.
> > >
> > > Contrary to a layer subset, each layer set will result in a PDF page, and 
> > > thus the layer sets are related to each other by an inner order. That's 
> > > why I would use an array variable here with [].
> > >
> > > I don't know how to append a set. In the following example, I assumed 
> > > there would be a function myappend(,  > > initial set should be appended with>)
> > >
> > > myset layerset[];
> > > layerset1 := {layerW,layerA};
> > > layerset2 := myappend{layerset1, layerY};
> > > layerset3 := myapp

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Mikael Sundqvist
Hi,

not sure I get what you are missing. But you can try

setbounds currentpicture to (fullsquare scaled 200) ;

in base. And then do

\dorecurse{5}{
\startTEXpage[offset=1DK]
\useMPgraphic{layerset#1}
\stopTEXpage
}

if that is the looping you are after.

/Mikael

On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context
 wrote:
>
> Resp. the solution should be such that each generated PDF page has the same 
> dimension, the same background colour and a page number and the metapost 
> content on each page has the same scaling factor.
>
> On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context 
>  wrote:
>
> Dear Mikael,
>
> I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> on), because I need the "setbounds currentpicture to TheFrame" and also 
> because I need page numbering inside the MPpage, as done with draw 
> textext(decimal(currentime)).
>
> So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
> assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
>
> Emanuel
>
> On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
>  wrote:
>
> Dear Mikael,
> thanks a lot!
> this seems to be the solution! And it looks beatiful enough to me 
> I'll try to port all my layers to this new method and see if I run into new 
> problems again 
>
> Emanuel
>
>
> On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
>
> Hi
>
> On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
>  wrote:
> >
> > Dear list,
> >
> > the attached .tex file is the minimal working example we discussed today in 
> > the online meeting.
> >
> > I realized that the approach of looping through k of p[k] is not fitting my 
> > needs, because it's not flexible enough.
> >
> > I need another approach, one which works with layer sets.
> >
> > I would stop using p as an array, because with the layer sets approach we 
> > don't have a fixed order of the layers.
> >
> > So the definition of the layers would be something like
> >
> > picture layerA;
> > layerA:=image(
> > label("Word 1", z1);
> > );
> >
> > picture layerW;
> > layerW:=image(
> > label("Mot 2", z2);
> > );
> >
> > picture layerM;
> > layerM:=image(
> > label("Parola 3", z3);
> > );
> >
> > picture layerC;
> > layerC:=image(
> > label("Wort 4", z3+z1);
> > );
> >
> > picture layerY;
> > layerY:=image(
> > label("Nummer 5", z2+z3);
> > );
> >
> > picture layerU;
> > layerU:=image(
> > label("number 6", z2+z1);
> > );
> >
> > After that, I would define layer sets and layer subsets. This will be done 
> > manually for each layer set and each layer subset.
> > I don't know the proper syntax to do that. Let's assume we could use a 
> > variable type called "myset".
> >
> > myset layersubsetGamma;
> > layersubsetGamma:={layerU,layerM};
> >
> > In my logic, the layers will be drawn in the order of their appearance 
> > within the {}. In the example, drawn content of layerM might cover drawn 
> > content of layerU.
> >
> > Contrary to a layer subset, each layer set will result in a PDF page, and 
> > thus the layer sets are related to each other by an inner order. That's why 
> > I would use an array variable here with [].
> >
> > I don't know how to append a set. In the following example, I assumed there 
> > would be a function myappend(,  > set should be appended with>)
> >
> > myset layerset[];
> > layerset1 := {layerW,layerA};
> > layerset2 := myappend{layerset1, layerY};
> > layerset3 := myappend{layerset2, layersubsetGamma};
> > layerset4 := myappend{layerset2, layerU};
> > layerset5 := myappend{layerset4, layersubsetGamma};
> >
> > Finally, I would need each layerset[k] typeset on its own pdf page. And of 
> > course on each page k, only the layers which appear in the definition of 
> > the layerset[k] should be drawn on top of each other in the order as they 
> > appear in that definition.
> >
> > I'm very curious to hear your suggestions.
> >
>
> Not beautiful, perhaps, but maybe something like this could work? I
> think there is no way out of doing some manual work to tell what you
> want included on each page.
>
> \startuseMPgraphic{base}
> z1 = origin ;
> z2 = (10,50) ;
> z3 = (40,30) ;
>
> picture layerA;
> layerA:=image(
> label("Word 1", z1);

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
Resp. the solution should be such that each generated PDF page has the same 
dimension, the same background colour and a page number and the metapost 
content on each page has the same scaling factor.

On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context  
wrote:
> Dear Mikael,
>
> I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> on), because I need the "setbounds currentpicture to TheFrame" and also 
> because I need page numbering inside the MPpage, as done with draw 
> textext(decimal(currentime)).
> So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
> assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
> Emanuel
> On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
>  wrote:
> > Dear Mikael,
> > thanks a lot!
> > this seems to be the solution! And it looks beatiful enough to me 
> > I'll try to port all my layers to this new method and see if I run into new 
> > problems again 
> >
> > Emanuel
> >
> > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> > > Hi
> > >
> > > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> > >  wrote:
> > > >
> > > > Dear list,
> > > >
> > > > the attached .tex file is the minimal working example we discussed 
> > > > today in the online meeting.
> > > >
> > > > I realized that the approach of looping through k of p[k] is not 
> > > > fitting my needs, because it's not flexible enough.
> > > >
> > > > I need another approach, one which works with layer sets.
> > > >
> > > > I would stop using p as an array, because with the layer sets approach 
> > > > we don't have a fixed order of the layers.
> > > >
> > > > So the definition of the layers would be something like
> > > >
> > > > picture layerA;
> > > > layerA:=image(
> > > > label("Word 1", z1);
> > > > );
> > > >
> > > > picture layerW;
> > > > layerW:=image(
> > > > label("Mot 2", z2);
> > > > );
> > > >
> > > > picture layerM;
> > > > layerM:=image(
> > > > label("Parola 3", z3);
> > > > );
> > > >
> > > > picture layerC;
> > > > layerC:=image(
> > > > label("Wort 4", z3+z1);
> > > > );
> > > >
> > > > picture layerY;
> > > > layerY:=image(
> > > > label("Nummer 5", z2+z3);
> > > > );
> > > >
> > > > picture layerU;
> > > > layerU:=image(
> > > > label("number 6", z2+z1);
> > > > );
> > > >
> > > > After that, I would define layer sets and layer subsets. This will be 
> > > > done manually for each layer set and each layer subset.
> > > > I don't know the proper syntax to do that. Let's assume we could use a 
> > > > variable type called "myset".
> > > >
> > > > myset layersubsetGamma;
> > > > layersubsetGamma:={layerU,layerM};
> > > >
> > > > In my logic, the layers will be drawn in the order of their appearance 
> > > > within the {}. In the example, drawn content of layerM might cover 
> > > > drawn content of layerU.
> > > >
> > > > Contrary to a layer subset, each layer set will result in a PDF page, 
> > > > and thus the layer sets are related to each other by an inner order. 
> > > > That's why I would use an array variable here with [].
> > > >
> > > > I don't know how to append a set. In the following example, I assumed 
> > > > there would be a function myappend(,  > > > initial set should be appended with>)
> > > >
> > > > myset layerset[];
> > > > layerset1 := {layerW,layerA};
> > > > layerset2 := myappend{layerset1, layerY};
> > > > layerset3 := myappend{layerset2, layersubsetGamma};
> > > > layerset4 := myappend{layerset2, layerU};
> > > > layerset5 := myappend{layerset4, layersubsetGamma};
> > > >
> > > > Finally, I would need each layerset[k] typeset on its own pdf page. And 
> > > > of course on each page k, only the layers which appear in the 
> > > > definition of the layerset[k] should be drawn on top of each other in 
> > > > the order as they appear in 

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
Dear Mikael,

I actually need to keep the \dorecurse mechanism of the mwe (from line 44 on), 
because I need the "setbounds currentpicture to TheFrame" and also because I 
need page numbering inside the MPpage, as done with draw 
textext(decimal(currentime)).
So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
Emanuel
On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context  
wrote:
> Dear Mikael,
> thanks a lot!
> this seems to be the solution! And it looks beatiful enough to me 
> I'll try to port all my layers to this new method and see if I run into new 
> problems again 
>
> Emanuel
>
> On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> > Hi
> >
> > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> >  wrote:
> > >
> > > Dear list,
> > >
> > > the attached .tex file is the minimal working example we discussed today 
> > > in the online meeting.
> > >
> > > I realized that the approach of looping through k of p[k] is not fitting 
> > > my needs, because it's not flexible enough.
> > >
> > > I need another approach, one which works with layer sets.
> > >
> > > I would stop using p as an array, because with the layer sets approach we 
> > > don't have a fixed order of the layers.
> > >
> > > So the definition of the layers would be something like
> > >
> > > picture layerA;
> > > layerA:=image(
> > > label("Word 1", z1);
> > > );
> > >
> > > picture layerW;
> > > layerW:=image(
> > > label("Mot 2", z2);
> > > );
> > >
> > > picture layerM;
> > > layerM:=image(
> > > label("Parola 3", z3);
> > > );
> > >
> > > picture layerC;
> > > layerC:=image(
> > > label("Wort 4", z3+z1);
> > > );
> > >
> > > picture layerY;
> > > layerY:=image(
> > > label("Nummer 5", z2+z3);
> > > );
> > >
> > > picture layerU;
> > > layerU:=image(
> > > label("number 6", z2+z1);
> > > );
> > >
> > > After that, I would define layer sets and layer subsets. This will be 
> > > done manually for each layer set and each layer subset.
> > > I don't know the proper syntax to do that. Let's assume we could use a 
> > > variable type called "myset".
> > >
> > > myset layersubsetGamma;
> > > layersubsetGamma:={layerU,layerM};
> > >
> > > In my logic, the layers will be drawn in the order of their appearance 
> > > within the {}. In the example, drawn content of layerM might cover drawn 
> > > content of layerU.
> > >
> > > Contrary to a layer subset, each layer set will result in a PDF page, and 
> > > thus the layer sets are related to each other by an inner order. That's 
> > > why I would use an array variable here with [].
> > >
> > > I don't know how to append a set. In the following example, I assumed 
> > > there would be a function myappend(,  > > initial set should be appended with>)
> > >
> > > myset layerset[];
> > > layerset1 := {layerW,layerA};
> > > layerset2 := myappend{layerset1, layerY};
> > > layerset3 := myappend{layerset2, layersubsetGamma};
> > > layerset4 := myappend{layerset2, layerU};
> > > layerset5 := myappend{layerset4, layersubsetGamma};
> > >
> > > Finally, I would need each layerset[k] typeset on its own pdf page. And 
> > > of course on each page k, only the layers which appear in the definition 
> > > of the layerset[k] should be drawn on top of each other in the order as 
> > > they appear in that definition.
> > >
> > > I'm very curious to hear your suggestions.
> > >
> >
> > Not beautiful, perhaps, but maybe something like this could work? I
> > think there is no way out of doing some manual work to tell what you
> > want included on each page.
> >
> > \startuseMPgraphic{base}
> > z1 = origin ;
> > z2 = (10,50) ;
> > z3 = (40,30) ;
> >
> > picture layerA;
> > layerA:=image(
> > label("Word 1", z1);
> > );
> >
> > picture layerW;
> > layerW:=image(
> > label("Mot 2", z2);
> > );
> >
> > picture layerM;
> > layerM:=image(
> > label("Parola 3", z3);
> > 

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
Dear Mikael,
thanks a lot!
this seems to be the solution! And it looks beatiful enough to me 
I'll try to port all my layers to this new method and see if I run into new 
problems again 

Emanuel

On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> Hi
>
> On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
>  wrote:
> >
> > Dear list,
> >
> > the attached .tex file is the minimal working example we discussed today in 
> > the online meeting.
> >
> > I realized that the approach of looping through k of p[k] is not fitting my 
> > needs, because it's not flexible enough.
> >
> > I need another approach, one which works with layer sets.
> >
> > I would stop using p as an array, because with the layer sets approach we 
> > don't have a fixed order of the layers.
> >
> > So the definition of the layers would be something like
> >
> > picture layerA;
> > layerA:=image(
> > label("Word 1", z1);
> > );
> >
> > picture layerW;
> > layerW:=image(
> > label("Mot 2", z2);
> > );
> >
> > picture layerM;
> > layerM:=image(
> > label("Parola 3", z3);
> > );
> >
> > picture layerC;
> > layerC:=image(
> > label("Wort 4", z3+z1);
> > );
> >
> > picture layerY;
> > layerY:=image(
> > label("Nummer 5", z2+z3);
> > );
> >
> > picture layerU;
> > layerU:=image(
> > label("number 6", z2+z1);
> > );
> >
> > After that, I would define layer sets and layer subsets. This will be done 
> > manually for each layer set and each layer subset.
> > I don't know the proper syntax to do that. Let's assume we could use a 
> > variable type called "myset".
> >
> > myset layersubsetGamma;
> > layersubsetGamma:={layerU,layerM};
> >
> > In my logic, the layers will be drawn in the order of their appearance 
> > within the {}. In the example, drawn content of layerM might cover drawn 
> > content of layerU.
> >
> > Contrary to a layer subset, each layer set will result in a PDF page, and 
> > thus the layer sets are related to each other by an inner order. That's why 
> > I would use an array variable here with [].
> >
> > I don't know how to append a set. In the following example, I assumed there 
> > would be a function myappend(,  > set should be appended with>)
> >
> > myset layerset[];
> > layerset1 := {layerW,layerA};
> > layerset2 := myappend{layerset1, layerY};
> > layerset3 := myappend{layerset2, layersubsetGamma};
> > layerset4 := myappend{layerset2, layerU};
> > layerset5 := myappend{layerset4, layersubsetGamma};
> >
> > Finally, I would need each layerset[k] typeset on its own pdf page. And of 
> > course on each page k, only the layers which appear in the definition of 
> > the layerset[k] should be drawn on top of each other in the order as they 
> > appear in that definition.
> >
> > I'm very curious to hear your suggestions.
> >
>
> Not beautiful, perhaps, but maybe something like this could work? I
> think there is no way out of doing some manual work to tell what you
> want included on each page.
>
> \startuseMPgraphic{base}
> z1 = origin ;
> z2 = (10,50) ;
> z3 = (40,30) ;
>
> picture layerA;
> layerA:=image(
> label("Word 1", z1);
> );
>
> picture layerW;
> layerW:=image(
> label("Mot 2", z2);
> );
>
> picture layerM;
> layerM:=image(
> label("Parola 3", z3);
> );
>
> picture layerC;
> layerC:=image(
> label("Wort 4", z3+z1);
> );
>
> picture layerY;
> layerY:=image(
> label("Nummer 5", z2+z3);
> );
>
> picture layerU;
> layerU:=image(
> label("number 6", z2+z1);
> );
> \stopuseMPgraphic
>
> \startuseMPgraphic{Gamma}
> draw layerU ;
> draw layerM ;
> \stopuseMPgraphic
>
> \startuseMPgraphic{layerset1}
> \includeMPgraphic{base}
> draw layerW ;
> draw layerA ;
> \stopuseMPgraphic
>
> \startuseMPgraphic{layerset2}
> \includeMPgraphic{layerset1} ;
> draw layerY ;
> \stopuseMPgraphic
>
> \startuseMPgraphic{layerset3}
> \includeMPgraphic{layerset2} ;
> \includeMPgraphic{Gamma} ;
> \stopuseMPgraphic
>
>
> \startuseMPgraphic{layerset4}
> \includeMPgraphic{layerset2} ;
> draw layerU ;
> \stopuseMPgraphic
>
> \startuseMPgraphic{layerset5}
> \includeMPgraphic{layerset4} ;
> \includeMPgraphic{Gamma} ;
> \stopuseMPgraphi

[NTG-context] Re: Working with layer sets with Metapost

2024-02-14 Thread Mikael Sundqvist
Hi

On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
 wrote:
>
> Dear list,
>
> the attached .tex file is the minimal working example we discussed today in 
> the online meeting.
>
> I realized that the approach of looping through k of p[k] is not fitting my 
> needs, because it's not flexible enough.
>
> I need another approach, one which works with layer sets.
>
> I would stop using p as an array, because with the layer sets approach we 
> don't have a fixed order of the layers.
>
> So the definition of the layers would be something like
>
> picture layerA;
> layerA:=image(
> label("Word 1", z1);
> );
>
> picture layerW;
> layerW:=image(
> label("Mot 2", z2);
> );
>
> picture layerM;
> layerM:=image(
> label("Parola 3", z3);
> );
>
> picture layerC;
> layerC:=image(
> label("Wort 4", z3+z1);
> );
>
> picture layerY;
> layerY:=image(
> label("Nummer 5", z2+z3);
> );
>
> picture layerU;
> layerU:=image(
> label("number 6", z2+z1);
> );
>
> After that, I would define layer sets and layer subsets. This will be done 
> manually for each layer set and each layer subset.
> I don't know the proper syntax to do that. Let's assume we could use a 
> variable type called "myset".
>
> myset layersubsetGamma;
> layersubsetGamma:={layerU,layerM};
>
> In my logic, the layers will be drawn in the order of their appearance within 
> the {}. In the example, drawn content of layerM might cover drawn content of 
> layerU.
>
> Contrary to a layer subset, each layer set will result in a PDF page, and 
> thus the layer sets are related to each other by an inner order. That's why I 
> would use an array variable here with [].
>
> I don't know how to append a set. In the following example, I assumed there 
> would be a function myappend(,  should be appended with>)
>
> myset layerset[];
> layerset1 := {layerW,layerA};
> layerset2 := myappend{layerset1, layerY};
> layerset3 := myappend{layerset2, layersubsetGamma};
> layerset4 := myappend{layerset2, layerU};
> layerset5 := myappend{layerset4, layersubsetGamma};
>
> Finally, I would need each layerset[k] typeset on its own pdf page. And of 
> course on each page k, only the layers which appear in the definition of the 
> layerset[k] should be drawn on top of each other in the order as they appear 
> in that definition.
>
> I'm very curious to hear your suggestions.
>

Not beautiful, perhaps, but maybe something like this could work? I
think there is no way out of doing some manual work to tell what you
want included on each page.

\startuseMPgraphic{base}
z1 = origin ;
z2 = (10,50) ;
z3 = (40,30) ;

picture layerA;
layerA:=image(
label("Word 1", z1);
);

picture layerW;
layerW:=image(
label("Mot 2", z2);
);

picture layerM;
layerM:=image(
label("Parola 3", z3);
);

picture layerC;
layerC:=image(
label("Wort 4", z3+z1);
);

picture layerY;
layerY:=image(
label("Nummer 5", z2+z3);
);

picture layerU;
layerU:=image(
label("number 6", z2+z1);
);
\stopuseMPgraphic

\startuseMPgraphic{Gamma}
draw layerU ;
draw layerM ;
\stopuseMPgraphic

\startuseMPgraphic{layerset1}
\includeMPgraphic{base}
draw layerW ;
draw layerA ;
\stopuseMPgraphic

\startuseMPgraphic{layerset2}
\includeMPgraphic{layerset1} ;
draw layerY ;
\stopuseMPgraphic

\startuseMPgraphic{layerset3}
\includeMPgraphic{layerset2} ;
\includeMPgraphic{Gamma} ;
\stopuseMPgraphic


\startuseMPgraphic{layerset4}
\includeMPgraphic{layerset2} ;
draw layerU ;
\stopuseMPgraphic

\startuseMPgraphic{layerset5}
\includeMPgraphic{layerset4} ;
\includeMPgraphic{Gamma} ;
\stopuseMPgraphic

\starttext

\startTEXpage[offset=1DK]
\useMPgraphic{layerset1}
\stopTEXpage

\startTEXpage[offset=1DK]
\useMPgraphic{layerset2}
\stopTEXpage

\startTEXpage[offset=1DK]
\useMPgraphic{layerset3}
\stopTEXpage

\startTEXpage[offset=1DK]
\useMPgraphic{layerset4}
\stopTEXpage

\startTEXpage[offset=1DK]
\useMPgraphic{layerset5}
\stopTEXpage

\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Working with layer sets with Metapost

2024-02-14 Thread Emanuel Han via ntg-context
Dear list,

the attached .tex file is the minimal working example we discussed today in the 
online meeting.
I realized that the approach of looping through k of p[k] is not fitting my 
needs, because it's not flexible enough.
I need another approach, one which works with layer sets.
I would stop using p as an array, because with the layer sets approach we don't 
have a fixed order of the layers.
So the definition of the layers would be something like
picture layerA;
layerA:=image(
label("Word 1", z1);
);

picture layerW;
layerW:=image(
label("Mot 2", z2);
);

picture layerM;
layerM:=image(
label("Parola 3", z3);
);

picture layerC;
layerC:=image(
label("Wort 4", z3+z1);
);

picture layerY;
layerY:=image(
label("Nummer 5", z2+z3);
);

picture layerU;
layerU:=image(
label("number 6", z2+z1);
);

After that, I would define layer sets and layer subsets. This will be done 
manually for each layer set and each layer subset.
I don't know the proper syntax to do that. Let's assume we could use a variable 
type called "myset".

myset layersubsetGamma;
layersubsetGamma:={layerU,layerM};

In my logic, the layers will be drawn in the order of their appearance within 
the {}. In the example, drawn content of layerM might cover drawn content of 
layerU.
Contrary to a layer subset, each layer set will result in a PDF page, and thus 
the layer sets are related to each other by an inner order. That's why I would 
use an array variable here with [].
I don't know how to append a set. In the following example, I assumed there 
would be a function myappend(, )
myset layerset[];
layerset1 := {layerW,layerA};
layerset2 := myappend{layerset1, layerY};
layerset3 := myappend{layerset2, layersubsetGamma};
layerset4 := myappend{layerset2, layerU};
layerset5 := myappend{layerset4, layersubsetGamma};

Finally, I would need each layerset[k] typeset on its own pdf page. And of 
course on each page k, only the layers which appear in the definition of the 
layerset[k] should be drawn on top of each other in the order as they appear in 
that definition.
I'm very curious to hear your suggestions.
Thanks
Emanuel



multipage_metapost_mwe-very_simple.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Seeindex with zie instead of see?

2024-02-14 Thread Henning Hraban Ramm

Am 14.02.24 um 10:42 schrieb G.C.H.M. Verhaag via ntg-context:

Hi ConTeXt users,

Wondering whether there is a possibility to modify the word *see* into 
the Dutch word *zie* in the use of the \seeindex command?


Did you set \mainlanguage[nl]?

Hraban

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Seeindex with zie instead of see?

2024-02-14 Thread Gerard Verhaag via ntg-context
Hi ConTeXt users,

Wondering whether there is a possibility to modify the word 'see' into the 
Dutch word 'zie' in the use of the \seeindex command?

Regards,

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Seeindex with zie instead of see?

2024-02-14 Thread G.C.H.M. Verhaag via ntg-context

Hi ConTeXt users,

Wondering whether there is a possibility to modify the word *see* into 
the Dutch word *zie* in the use of the \seeindex command?


Regards,

Gerard

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to print the book title and section title where \reference is located?

2024-02-09 Thread Bruce Horrocks


> On 7 Feb 2024, at 03:47, Joel via ntg-context  wrote:
> 
> I have an extensive multi-book project. Each book has a nickname, like TB for 
> "Textbook", "WB 1" for the "Workbook, Vol. 1":
> 
> TB -- 01_textbook.tex
> WB 1 -- 03_workbook.tex
> WB 2 -- 04_workbook.tex
> WB 3 -- 05_workbook.tex
> WB 4 -- 06_workbook.tex
> TG -- 08_teachersguide.tex
> 
> I have to prove to a government agency that the content meets several 
> requirements, so I'm giving them a simple file that says something like 
> "Requirement A is met in TB, "Cats", p. 11" basically letting the reader know 
> its in the textbook, section called "Cats", on p. 11. To mark the pages, I'm 
> simply dropping in macros called "\requirementA" "\requirementB" on whichever 
> page of whichever book demonstrates it meets the requirement, then the file 
> will aquatically list the book, section, and page number by searching for 
> that macro.

[snip]

> Here is a sample message what the output should give:
> 
> "Requirement A is met in WB 3, "Bears", p. 33."

Taking you literally in that you want a *file* listing the occurences and not a 
typeset page listing the occurrences then you could try using the following in 
your document at the places where you currently put \requirementA etc:

\writestatus{RequirementMet}{Requirement A is met in section 
\fetchmark[section][current], p. \pagenumber}

This will write the current section title and page number to the console 
listing, prefixed by the word "RequirementMet". To produce the file for your 
customer all you have to do is filter these lines out of the .log file that is 
produced when you compile your book. In Unix-like systems that is a simple: 
grep RequirementMet file.log

Regards,
—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: cont-new.mkiv and \everymathematics

2024-01-21 Thread Hans Hagen via ntg-context

On 1/20/2024 7:49 PM, Rogers, Michael K wrote:

Hi all,

In writing class notes, I frequently make one-letter macros for formatted 
symbols, such \v and \w for vectors. Generally speaking, one-letter names for 
function/macros/variables is frowned upon in programming, but I find this 
localized use very convenient.

In cont-new.mkiv, one finds definitions of \t and \w (via \let) appended to 
\everymathematics, which overwrites my definition of \w every time TeX enters 
math mode. I can fix this by appending my definition to \everymathematics. The 
inefficiency seems minor, and I can live with it. I have a question and a 
couple of points:

1. Is there a better way than adding the definition to \everymathematics?

2. I don’t think these definitions should be in ConTeXt. Let users add them if 
they wish. Or add a ‘useshortcuts’ option to \setupmathematics.

3. \t and \w are undocumented, \mathword is undocumented, and it took me a 
while to track down the bug it created for me. In particular, they overwrote my 
definition only in math mode, and “\show\w” did not work in math mode. 
Frustrating.  I could add a wikipage, I suppose, but I’m not proud of the 
extent of my knowledge: “\mathword{word} typesets “word” in math mode in a 
normal text font, somewhat like \text{word}, and \w is an abbreviation of it 
that is added to \everymathematics on startup.”
adding to \everymathematics can work fine as long as you're the last one 
adding


when you overload built in commands,

\enabledirectives[overloadmode=error] % or warning

can give you some protection

Hans

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

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] cont-new.mkiv and \everymathematics

2024-01-20 Thread Rogers, Michael K
Hi all,

In writing class notes, I frequently make one-letter macros for formatted 
symbols, such \v and \w for vectors. Generally speaking, one-letter names for 
function/macros/variables is frowned upon in programming, but I find this 
localized use very convenient.

In cont-new.mkiv, one finds definitions of \t and \w (via \let) appended to 
\everymathematics, which overwrites my definition of \w every time TeX enters 
math mode. I can fix this by appending my definition to \everymathematics. The 
inefficiency seems minor, and I can live with it. I have a question and a 
couple of points:

1. Is there a better way than adding the definition to \everymathematics?

2. I don’t think these definitions should be in ConTeXt. Let users add them if 
they wish. Or add a ‘useshortcuts’ option to \setupmathematics.

3. \t and \w are undocumented, \mathword is undocumented, and it took me a 
while to track down the bug it created for me. In particular, they overwrote my 
definition only in math mode, and “\show\w” did not work in math mode. 
Frustrating.  I could add a wikipage, I suppose, but I’m not proud of the 
extent of my knowledge: “\mathword{word} typesets “word” in math mode in a 
normal text font, somewhat like \text{word}, and \w is an abbreviation of it 
that is added to \everymathematics on startup.” 

Thank you very much,

Michael

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] How to Create Asymmetrical Continuous Columns in ConTeXt?

2024-01-18 Thread seyal . zavira
Hi all,

I have a lengthy text that I wish to seamlessly incorporate using the 
\input{mytext} command in ConTeXt. 
Additionally, I aim to present it in asymmetrical continuous columns, where the 
text flows over several pages.

I have tried paragraphs and columns, but in paragraphs, I can't flow text 
across several pages without manually breaking it, and in columns, I haven't 
found a way to implement asymmetric columns.

How can I achieve this layout in ConTeXt? this is a MWE but it does not work 
properly:

\definecolumnset[mymixedcolumn][n=2]
\setupcolumnset[mymixedcolumn:1][width=4cm]
\setupcolumnset[mymixedcolumn:2][width=7cm]

\starttext
\startcolumnset[mymixedcolumn]
\dorecurse{5}{
\input{knuth}
}
\stopcolumnset
\stoptext

also is there a mechanism to automatically continue text between desired 
frames? For example, is there a way to write a function that, if the text 
reaches the end of the line and there is not enough space for another line in 
that frame, it continues the text in another frame that is already specified? 
in other word How do you make text flow to another part of a page?

Thanks in advance.
Best regards,
Seyal
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: LMTX schema for poster

2024-01-11 Thread Henning Hraban Ramm

Am 11.01.24 um 22:04 schrieb Bruce Horrocks:


1. "ConTeXt" should be the biggest word - or as an obvious title for the 
poster, away from the actual drawing.


This will be only a part of the poster. I imagine a 3x3 grid with a 
title above and some information (website etc.) below.

The 9 elements of the grid will be
- such a diagram that explains the building blocks / general workflow
– the diagram of the layout areas
– the project structure (environment, product, component)
– some examples of code and results
I wanted to use the “christmas card” squares for borders around and 
inbetween.



2. Don't add the "MkXL" bit - it's a distracting detail that no one needs to know at this 
stage. Also it looks like "Mk 40" in Roman numerals, or extra large.


ok. But “extra large” is intentional, I guess.


3. I though Hans had stopped using the TeX style capitalisation now i.e. just 
"Context"?


Hans uses different versions.
We use “context group”, but I keep ConTeXt; esp. in the context of LaTeX 
(DANTE booth!), I’d like to stress that it’s still TeX.



4. It's not clear whether the intersecting boxes are simply decorative or meant 
to present some sort of logical structure. I'm happy for it to be decorative, 
in which case fewer labels might be better.


ConTeXt “wraps” the LuaMetaTeX binary, since it handles the input as 
well as the output. I wasn’t sure how to show what controls what.



5. Similar to the box structure comment is that it's not clear which words I 
should be looking at. Ask yourself: what word(s) do I want the viewer to 
remember when they walk away?

6. Consider swapping the TeX and MetaPost circles so that Lua, MetaPost and TeX are read 
left to right as they appear in the acronym LMTX. Perhaps invert the "triangle" 
so that there are two circles at the top.


My first idea was to show that TeX and MP are under Lua control, but 
Hans disagreed. So while the 3 subsystems interact, I wanted to keep TeX 
on top.



7. It doesn't really tell the viewer that Context is a typesetting system - it 
looks like it is a system for producing XMLs and PDFs. (Which is what it is 
but... much more)


I’ll show some typography on the poster, and there will be books around.


8. Don't forget space for a URL and/or a QR code to the Contextgarden website.


See above.


Sorry if the above sounds harsh - not meant to be - just brain storming.


No problem, thank you!


I have a suggestion though. Use the Christmas card code / memory game code to 
produce patterns to use as the dots in the QR code? If the QR is large enough 
for people to distinguish the individual dots then it would provide a talking 
point? Or maybe have a copy of the card game to hand and challenge them to find 
a randomly drawn card in the QR code?


I don’t think I understand your intention. I wouldn’t construct a QR 
code out of other stuff, it would become too big.


Hraban

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: LMTX schema for poster

2024-01-11 Thread Bruce Horrocks


> On 11 Jan 2024, at 19:15, vm via ntg-context  wrote:
> 
> 
> 
> On 11/01/2024 19:52, Henning Hraban Ramm wrote:
>> Here’s a preliminary schema of LMTX. What do you think?
> 
> as is, it is difficult to understand where to look.
> what does is describe?
> 
> e.g. what is the distinction between the 'source' (lua tex) and the 
> 'resources' (fonts icc lib) and the 'frontend' (tex xml png ...mp)
> (no lua?)

Agreed.

In no particular order:

1. "ConTeXt" should be the biggest word - or as an obvious title for the 
poster, away from the actual drawing.

2. Don't add the "MkXL" bit - it's a distracting detail that no one needs to 
know at this stage. Also it looks like "Mk 40" in Roman numerals, or extra 
large.

3. I though Hans had stopped using the TeX style capitalisation now i.e. just 
"Context"?

4. It's not clear whether the intersecting boxes are simply decorative or meant 
to present some sort of logical structure. I'm happy for it to be decorative, 
in which case fewer labels might be better.

5. Similar to the box structure comment is that it's not clear which words I 
should be looking at. Ask yourself: what word(s) do I want the viewer to 
remember when they walk away?

6. Consider swapping the TeX and MetaPost circles so that Lua, MetaPost and TeX 
are read left to right as they appear in the acronym LMTX. Perhaps invert the 
"triangle" so that there are two circles at the top.

7. It doesn't really tell the viewer that Context is a typesetting system - it 
looks like it is a system for producing XMLs and PDFs. (Which is what it is 
but... much more)

8. Don't forget space for a URL and/or a QR code to the Contextgarden website.

Sorry if the above sounds harsh - not meant to be - just brain storming.

I have a suggestion though. Use the Christmas card code / memory game code to 
produce patterns to use as the dots in the QR code? If the QR is large enough 
for people to distinguish the individual dots then it would provide a talking 
point? Or maybe have a copy of the card game to hand and challenge them to find 
a randomly drawn card in the QR code?

—
Bruce Horrocks
Hampshire, UK

—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Chemnitz, Leipzig, Call for Poster

2024-01-11 Thread Fabrice L
Dear list, dear Hraban,

> Le 7 janv. 2024 à 13:58, Henning Hraban Ramm  a écrit :
> 
> Am 07.01.24 um 17:11 schrieb garulfo:
>> does this kind of poster would make sense ?
>> https://wiki.contextgarden.net/Cover_Pages#Poster_01_-_proposal_for_Libre_Planet_2021
> 
> Thank you, that looks good but it’s not what I had in mind.
> 
> I meant a poster _about_ ConTeXt, not only made with our toolset (I have a 
> stack of books for that). Maybe something about typography.
> 
> Here’s how the DANTE booth at FrOSCon 2023 looked like:
> https://yemaya.fiee.net/s/qTkeXAmXmJeosJc
> (The “mindmap” diagram on the left shows projects supported by DANTE, in the 
> middle a drawing by Duane Bibby, on the right a Tux with its TikZ source code 
> in the back.)
> We also had posters that show the architecture of TeX/LaTeX, but they were 
> seriously outdated.
> 
> Some elements that might fit:
> – some example code (like from Mikael’s BachoTeX presentation)
> – anatomy of a word and a formula (with all those little boxes and measures), 
> maybe also in Arabic
> – dodo & cow drawings from Mikael’s math manual
> – overview of layout areas (I re-made Sietse’s drawing from the wiki for my 
> book)
> - workflow diagrams
> – parts of LuaMetaTeX
> – artwork by Eçir Baff (art-aleatoire.com)
> – Hans’ recent christmas card / memory game artwork
> 
> But I don’t want just a wild collection of stuff, there should be something 
> connecting them. It should be interesting to look at as well as basic 
> information about ConTeXt.
> Hraban
> 

The suite ConTeXt/Metafun is so powerful, and can do so much different things, 
as already mentioned, that it can be difficult to present it in a coherent way. 
Perhaps this angle is that Context is a real Swiss Army knife: not only can it 
do lots of different things, it can do them very very well! 
You can take (and or I can provide in PDF of) any artwork from 
art-aleatoire.com <http://art-aleatoire.com/>, and if you wish/need I can 
contribute to an « art » part ! 

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Chemnitz, Leipzig, Call for Poster

2024-01-07 Thread Henning Hraban Ramm

Am 07.01.24 um 17:11 schrieb garulfo:

does this kind of poster would make sense ?

https://wiki.contextgarden.net/Cover_Pages#Poster_01_-_proposal_for_Libre_Planet_2021


Thank you, that looks good but it’s not what I had in mind.

I meant a poster _about_ ConTeXt, not only made with our toolset (I have 
a stack of books for that). Maybe something about typography.


Here’s how the DANTE booth at FrOSCon 2023 looked like:
https://yemaya.fiee.net/s/qTkeXAmXmJeosJc
(The “mindmap” diagram on the left shows projects supported by DANTE, in 
the middle a drawing by Duane Bibby, on the right a Tux with its TikZ 
source code in the back.)
We also had posters that show the architecture of TeX/LaTeX, but they 
were seriously outdated.


Some elements that might fit:
– some example code (like from Mikael’s BachoTeX presentation)
– anatomy of a word and a formula (with all those little boxes and 
measures), maybe also in Arabic

– dodo & cow drawings from Mikael’s math manual
– overview of layout areas (I re-made Sietse’s drawing from the wiki for 
my book)

- workflow diagrams
– parts of LuaMetaTeX
– artwork by Eçir Baff (art-aleatoire.com)
– Hans’ recent christmas card / memory game artwork

But I don’t want just a wild collection of stuff, there should be 
something connecting them. It should be interesting to look at as well 
as basic information about ConTeXt.


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: multipage metapost output from ConTeXt

2024-01-06 Thread Emanuel Han via ntg-context
Hi Mikael,

with the solution provided by you, I could work on my graphic which grows from 
page to page. So far I have already 28 pages. Now I would like to go back to 
the summed graphic of p1 to p21 and add the coming p29, p30 etc. to only that 
(that means contents of p22 to p28 should not be visible on pages 29 and 
forward).
I don't bother you with my code which is too long. Let's use the mwe provided 
by you (I added it here for convenience), where we have 3 pages. How can I have 
the content of p2 not be added on page 3 and forward?
\startuseMPgraphic{base}
picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);

p1:=image(
label("Word 1", z1);
);

p2:=image(
label("Mot 2", z2);
);

p3:=image(
label("Parola 3", z3);
);

\stopuseMPgraphic
\starttext
\dorecurse{3}{ % Frame
\startMPpage[pagestate=start]
\includeMPgraphic{base}
currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in)
withcolor magenta ;
for k=1 upto currentime: addto currentpicture also p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );
\stopMPpage
}

\stoptext
On Dez. 2 2023, at 7:46 pm, Mikael Sundqvist  wrote:
> Hi,
>
> I don't know if \startMPinclusions \stopMPinclusions shall work with
> \startMPpage and \stopMPpage. In this case, one can use a separate
> graphics:
>
> \startuseMPgraphic{base}
> picture p[];
> path TheFrame ;
> TheFrame := fullsquare scaled 5in ;
> z1 = (60,40);
> z2 = (40,90);
> z3 = (10,70);
>
> p1:=image(
> label("Word 1", z1);
> );
>
> p2:=image(
> label("Mot 2", z2);
> );
>
> p3:=image(
> label("Parola 3", z3);
> );
>
> \stopuseMPgraphic
> \starttext
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]
> \includeMPgraphic{base}
> currentime := #1 ;
> % Just for learning :
> draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> draw textext("T="(currentime)) scaled 2 shifted(0,2in)
> withcolor magenta ;
> for k=1 upto currentime: addto currentpicture also p[k]; endfor
> setbounds currentpicture to TheFrame ;
>
> desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> \stopMPpage
> }
>
> \stoptext
> /Mikael
> On Sat, Dec 2, 2023 at 6:14 PM Emanuel Han via ntg-context
>  wrote:
> >
> > Hi Mikael,
> >
> > here's a very simple mwe for the label(textext()) issue. On page 1, the 
> > text "Word 1" should be drawn in position z1. On page 2, the same text in 
> > the same position should be visible, and the text "Mot 2" in position p2 
> > should be added. And so on.
> >
> > \startMPinclusions
> >
> > picture p[];
> > path TheFrame ;
> > TheFrame := fullsquare scaled 5in ;
> >
> > z1 = (60,40);
> > z2 = (40,90);
> > z3 = (10,70);
> >
> > p1:=image(
> > label(textext("Word 1"), z1);
> > );
> >
> > p2:=image(
> > label(textext("Mot 2"), z2);
> > );
> >
> > p3:=image(
> > label(textext("Parola 3"), z3);
> > );
> >
> > \stopMPinclusions
> >
> > \starttext
> >
> > \dorecurse{3}{ % Frame
> > \startMPpage[pagestate=start]
> > currentime := #1 ;
> > % Just for learning :
> > draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> > draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> > magenta ;
> > for k=1 upto currentime: draw p[k]; endfor
> > setbounds currentpicture to TheFrame ;
> >
> > desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> > currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> >
> > \stopMPpage
> > }
> >
> > \stoptext
> >
> > On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> >
> > Hi Emanuel,
> >
> > I am not sure I understand your question, and since you use fonts that
> > i do not have, I cannot test your example as is. But, maybe, if you
> > want to redraw a picture, you can do
> >
> > addto currentpicture also p1;
> >
> > where you want it.
> >
> > /Mikael
> >
> > PS For the text thing, I did not get it. Could one have a _very
> > simple_ example showing only that problem and no other problem?
> >
> > On Sat, Dec 2, 2

[NTG-context] How to implement word corrections

2023-12-27 Thread Jairo A. del Rio
Hi, list! I'm writing a small module to print word corrections, e.g.,
things like "irregardless" > "regardless"or "alverja" > "arveja" ('pea' in
Spanish) with overstrikes and underlines, but I want feedback to make a
module in the ConTeXt fashion. I hope the PDF attached explains better what
I mean. Just in case, I want to know if anyone else in the mailing list is
acquainted with grammar and orthography quizzes/exercises/exams in ConTeXt.
Merry Christmas and Happy New Year!

Best regards,

Jairo


correction_draft.tex
Description: Binary data


correction_draft.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-04 Thread Fabrice L
Dear Emanuel,

> Le 2 déc. 2023 à 12:08, Emanuel Han via ntg-context  a 
> écrit :
> 
> Hi Mikael,
> 
> here's a very simple mwe for the label(textext()) issue. On page 1, the text 
> "Word 1" should be drawn in position z1. On page 2, the same text in the same 
> position should be visible, and the text "Mot 2" in position p2 should be 
> added. And so on.
> 
> \startMPinclusions
> 
> picture p[];
>  path TheFrame ;
>  TheFrame := fullsquare scaled 5in ;
>  
>  z1 = (60,40);
>  z2 = (40,90); 
>  z3 = (10,70);
> 
> p1:=image(
> label(textext("Word 1"), z1);
> );
> 
> p2:=image(
> label(textext("Mot 2"), z2);
> );
> 
> p3:=image(
> label(textext("Parola 3"), z3);
> );
> 
> \stopMPinclusions
> 
> \starttext
> 
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]  
>  currentime := #1 ;
>  % Just for learning :
>  draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
>  draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> magenta ;
>  for k=1 upto currentime: draw p[k]; endfor
>  setbounds currentpicture to TheFrame ;
> 
>  desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
>  currentpicture := currentpicture xysized (desiredformat ,desiredformat );
>  
> \stopMPpage
> }
> 
> \stoptext
> 
> On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> Hi Emanuel,
> 
> I am not sure I understand your question, and since you use fonts that
> i do not have, I cannot test your example as is. But, maybe, if you
> want to redraw a picture, you can do
> 
> addto currentpicture also p1;
> 
> where you want it.
> 
> /Mikael
> 
> PS For the text thing, I did not get it. Could one have a _very
> simple_ example showing only that problem and no other problem?
> 
> On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> >
> > You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> > The other issue, I can't help.
> >
> > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> >>
> >> So is there a way to circumvent these issues? Or an explanation for this 
> >> behavior, so that I can try to find a solution by myself?
> >>
> >> Thanks
> >> Emanuel
> >>
> >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> >>  wrote:
> >>
> >> Dear Aditya and Fabrice,
> >> thanks for your responses.
> >>
> >> I included some of Fabrice's code into mine for testing purpose, and 
> >> indeed the multipage works now.
> >> What is bizarre is that issues appear now that didn't appear before:
> >>
> >> Path A is drawn with color red on page 1, and in color black on all 
> >> following pages, while it should stay red.
> >> textext(, ) is overwriting  with 
> >> "T="(currentime) which has been used previously in textext() 
> >> before the for k=1 endfor loop. This overwriting happens only for the 
> >> first textext() which occurs inside the for k=1 endfor loop. All other 
> >> textext() inside the for k=1 endfor loop are not drawn at all. If the line 
> >> « draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> >> magenta ; » is commented out, the first textext() inside the for k=1 
> >> endfor loop is not drawn neither. It must be an issue with textext(), 
> >> because when I replace textext() by lmt_outline[], the text is drawn.
> >>
> >> Adjusted mwe:
> >>
> >> \enableregime[utf] % enable unicoded input
> >>
> >> \definefontfamily [RomanFont] [rm] [calluna]
> >>
> >> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> >>
> >> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> >>
> >> \definefontfeature
> >> [fea]
> >> [mode=node,language=dflt,script=arab,
> >> init=yes,
> >> medi=yes,
> >> fina=yes,
> >> isol=yes,
> >> calt=yes,
> >> rlig=yes,
> >> tlig=yes,
> >> trep=yes,
> >> curs=yes,
> >> kern=yes,
> >> mark=yes
> >> ]
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsy

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
Thank you Mikael,
this works!
Emanuel

On Dez. 2 2023, at 7:46 pm, Mikael Sundqvist  wrote:
> Hi,
>
> I don't know if \startMPinclusions \stopMPinclusions shall work with
> \startMPpage and \stopMPpage. In this case, one can use a separate
> graphics:
>
> \startuseMPgraphic{base}
> picture p[];
> path TheFrame ;
> TheFrame := fullsquare scaled 5in ;
> z1 = (60,40);
> z2 = (40,90);
> z3 = (10,70);
>
> p1:=image(
> label("Word 1", z1);
> );
>
> p2:=image(
> label("Mot 2", z2);
> );
>
> p3:=image(
> label("Parola 3", z3);
> );
>
> \stopuseMPgraphic
> \starttext
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]
> \includeMPgraphic{base}
> currentime := #1 ;
> % Just for learning :
> draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> draw textext("T="(currentime)) scaled 2 shifted(0,2in)
> withcolor magenta ;
> for k=1 upto currentime: addto currentpicture also p[k]; endfor
> setbounds currentpicture to TheFrame ;
>
> desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> \stopMPpage
> }
>
> \stoptext
> /Mikael
> On Sat, Dec 2, 2023 at 6:14 PM Emanuel Han via ntg-context
>  wrote:
> >
> > Hi Mikael,
> >
> > here's a very simple mwe for the label(textext()) issue. On page 1, the 
> > text "Word 1" should be drawn in position z1. On page 2, the same text in 
> > the same position should be visible, and the text "Mot 2" in position p2 
> > should be added. And so on.
> >
> > \startMPinclusions
> >
> > picture p[];
> > path TheFrame ;
> > TheFrame := fullsquare scaled 5in ;
> >
> > z1 = (60,40);
> > z2 = (40,90);
> > z3 = (10,70);
> >
> > p1:=image(
> > label(textext("Word 1"), z1);
> > );
> >
> > p2:=image(
> > label(textext("Mot 2"), z2);
> > );
> >
> > p3:=image(
> > label(textext("Parola 3"), z3);
> > );
> >
> > \stopMPinclusions
> >
> > \starttext
> >
> > \dorecurse{3}{ % Frame
> > \startMPpage[pagestate=start]
> > currentime := #1 ;
> > % Just for learning :
> > draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> > draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> > magenta ;
> > for k=1 upto currentime: draw p[k]; endfor
> > setbounds currentpicture to TheFrame ;
> >
> > desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> > currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> >
> > \stopMPpage
> > }
> >
> > \stoptext
> >
> > On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> >
> > Hi Emanuel,
> >
> > I am not sure I understand your question, and since you use fonts that
> > i do not have, I cannot test your example as is. But, maybe, if you
> > want to redraw a picture, you can do
> >
> > addto currentpicture also p1;
> >
> > where you want it.
> >
> > /Mikael
> >
> > PS For the text thing, I did not get it. Could one have a _very
> > simple_ example showing only that problem and no other problem?
> >
> > On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> > >
> > > You didn't specify the color of path A in p2 and p4. So it's drawn in 
> > > black.
> > > The other issue, I can't help.
> > >
> > > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> > >>
> > >> So is there a way to circumvent these issues? Or an explanation for this 
> > >> behavior, so that I can try to find a solution by myself?
> > >>
> > >> Thanks
> > >> Emanuel
> > >>
> > >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> > >>  wrote:
> > >>
> > >> Dear Aditya and Fabrice,
> > >> thanks for your responses.
> > >>
> > >> I included some of Fabrice's code into mine for testing purpose, and 
> > >> indeed the multipage works now.
> > >> What is bizarre is that issues appear now that didn't appear before:
> > >>
> > >> Path A is drawn with color red on page 1, and in color black on all 
> > >> following pages, while it should stay red.
> > >> textext(, ) is overwriting  with 
> > >> "T="(currentime) which has been used previously in textext() 
> > >> b

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Mikael Sundqvist
Hi,

I don't know if \startMPinclusions \stopMPinclusions shall work with
\startMPpage and \stopMPpage. In this case, one can use a separate
graphics:

\startuseMPgraphic{base}

picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);

p1:=image(
label("Word 1", z1);
);

p2:=image(
label("Mot 2", z2);
);

p3:=image(
label("Parola 3", z3);
);

\stopuseMPgraphic

\starttext

\dorecurse{3}{ % Frame

\startMPpage[pagestate=start]

\includeMPgraphic{base}

currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in)
withcolor magenta ;
for k=1 upto currentime: addto currentpicture also p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );
\stopMPpage
}

\stoptext

/Mikael

On Sat, Dec 2, 2023 at 6:14 PM Emanuel Han via ntg-context
 wrote:
>
> Hi Mikael,
>
> here's a very simple mwe for the label(textext()) issue. On page 1, the text 
> "Word 1" should be drawn in position z1. On page 2, the same text in the same 
> position should be visible, and the text "Mot 2" in position p2 should be 
> added. And so on.
>
> \startMPinclusions
>
> picture p[];
>  path TheFrame ;
>  TheFrame := fullsquare scaled 5in ;
>
>  z1 = (60,40);
>  z2 = (40,90);
>  z3 = (10,70);
>
> p1:=image(
> label(textext("Word 1"), z1);
> );
>
> p2:=image(
> label(textext("Mot 2"), z2);
> );
>
> p3:=image(
> label(textext("Parola 3"), z3);
> );
>
> \stopMPinclusions
>
> \starttext
>
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]
>  currentime := #1 ;
>  % Just for learning :
>  draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
>  draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> magenta ;
>  for k=1 upto currentime: draw p[k]; endfor
>  setbounds currentpicture to TheFrame ;
>
>  desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
>  currentpicture := currentpicture xysized (desiredformat ,desiredformat );
>
> \stopMPpage
> }
>
> \stoptext
>
> On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
>
> Hi Emanuel,
>
> I am not sure I understand your question, and since you use fonts that
> i do not have, I cannot test your example as is. But, maybe, if you
> want to redraw a picture, you can do
>
> addto currentpicture also p1;
>
> where you want it.
>
> /Mikael
>
> PS For the text thing, I did not get it. Could one have a _very
> simple_ example showing only that problem and no other problem?
>
> On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> >
> > You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> > The other issue, I can't help.
> >
> > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> >>
> >> So is there a way to circumvent these issues? Or an explanation for this 
> >> behavior, so that I can try to find a solution by myself?
> >>
> >> Thanks
> >> Emanuel
> >>
> >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> >>  wrote:
> >>
> >> Dear Aditya and Fabrice,
> >> thanks for your responses.
> >>
> >> I included some of Fabrice's code into mine for testing purpose, and 
> >> indeed the multipage works now.
> >> What is bizarre is that issues appear now that didn't appear before:
> >>
> >> Path A is drawn with color red on page 1, and in color black on all 
> >> following pages, while it should stay red.
> >> textext(, ) is overwriting  with 
> >> "T="(currentime) which has been used previously in textext() 
> >> before the for k=1 endfor loop. This overwriting happens only for the 
> >> first textext() which occurs inside the for k=1 endfor loop. All other 
> >> textext() inside the for k=1 endfor loop are not drawn at all. If the line 
> >> « draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> >> magenta ; » is commented out, the first textext() inside the for k=1 
> >> endfor loop is not drawn neither. It must be an issue with textext(), 
> >> because when I replace textext() by lmt_outline[], the text is drawn.
> >>
> >> Adjusted mwe:
> >>
> >> \enableregime[utf] % enable unicoded input
> >>
> >> \definefontfamily [RomanFont] [rm] [calluna]
> >>
>

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
Hi Mikael,

here's a very simple mwe for the label(textext()) issue. On page 1, the text 
"Word 1" should be drawn in position z1. On page 2, the same text in the same 
position should be visible, and the text "Mot 2" in position p2 should be 
added. And so on.
\startMPinclusions
picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;

z1 = (60,40);
z2 = (40,90);
z3 = (10,70);

p1:=image(
label(textext("Word 1"), z1);
);

p2:=image(
label(textext("Mot 2"), z2);
);

p3:=image(
label(textext("Parola 3"), z3);
);

\stopMPinclusions
\starttext
\dorecurse{3}{ % Frame
\startMPpage[pagestate=start]
currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
magenta ;
for k=1 upto currentime: draw p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );

\stopMPpage
}

\stoptext
On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> Hi Emanuel,
>
> I am not sure I understand your question, and since you use fonts that
> i do not have, I cannot test your example as is. But, maybe, if you
> want to redraw a picture, you can do
>
> addto currentpicture also p1;
> where you want it.
> /Mikael
> PS For the text thing, I did not get it. Could one have a _very
> simple_ example showing only that problem and no other problem?
>
> On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> >
> > You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> > The other issue, I can't help.
> >
> > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> >>
> >> So is there a way to circumvent these issues? Or an explanation for this 
> >> behavior, so that I can try to find a solution by myself?
> >>
> >> Thanks
> >> Emanuel
> >>
> >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> >>  wrote:
> >>
> >> Dear Aditya and Fabrice,
> >> thanks for your responses.
> >>
> >> I included some of Fabrice's code into mine for testing purpose, and 
> >> indeed the multipage works now.
> >> What is bizarre is that issues appear now that didn't appear before:
> >>
> >> Path A is drawn with color red on page 1, and in color black on all 
> >> following pages, while it should stay red.
> >> textext(, ) is overwriting  with 
> >> "T="(currentime) which has been used previously in textext() 
> >> before the for k=1 endfor loop. This overwriting happens only for the 
> >> first textext() which occurs inside the for k=1 endfor loop. All other 
> >> textext() inside the for k=1 endfor loop are not drawn at all. If the line 
> >> « draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> >> magenta ; » is commented out, the first textext() inside the for k=1 
> >> endfor loop is not drawn neither. It must be an issue with textext(), 
> >> because when I replace textext() by lmt_outline[], the text is drawn.
> >>
> >> Adjusted mwe:
> >>
> >> \enableregime[utf] % enable unicoded input
> >>
> >> \definefontfamily [RomanFont] [rm] [calluna]
> >>
> >> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> >>
> >> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> >>
> >> \definefontfeature
> >> [fea]
> >> [mode=node,language=dflt,script=arab,
> >> init=yes,
> >> medi=yes,
> >> fina=yes,
> >> isol=yes,
> >> calt=yes,
> >> rlig=yes,
> >> tlig=yes,
> >> trep=yes,
> >> curs=yes,
> >> kern=yes,
> >> mark=yes
> >> ]
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \stoptypescript
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \usetypescript[serif][fallback]
> >> \definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
> >> \definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
&g

[NTG-context] Re: [ how to force hyphenation all words ]

2023-11-16 Thread Marco Patzer
On Thu, 16 Nov 2023 21:40:08 +0100
vm via ntg-context  wrote:

> Is there a command in context to force every word in a text to
> hyphenate? e.g to typeset a text with "ge-dach-ten-streep-jes"

Like this?

\starttext
  \hyphenatedword{\samplefile{knuth}}
\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] [ how to force hyphenation all words ]

2023-11-16 Thread vm via ntg-context

Is there a command in context to force every word in a text to
hyphenate? e.g to typeset a text with "ge-dach-ten-streep-jes"

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: context not producing synctex output that my synctex program can use

2023-11-15 Thread Jim
Henning and Hans,

thanks for the replies.  I have two follow-up questions below, as well as
some other comments which other synctex users might find useful.

On Sun, Nov 12, 2023 at 10:26 (+0100), Henning Hraban Ramm wrote:

> Am 12.11.23 um 00:59 schrieb Jim:
>> Hi,

>> I've read the wiki, looked at workflows-synctex.tex, searched the web, and
>> scratched my head, all to no avail.  So here I am, cap in hand...

>> When I run context, I get a .synctex file which has some information in it,
>> but I can't find any invocation of synctex to return anything useful.  Nor
>> does the okular example in the wiki (https://wiki.contextgarden.net/SyncTeX)
>> work for me.  Ocular starts, but always on the first page, regardless of
>> what line number I give it.

>> On the other hand, pdftex creates a .synctex file which my copy of synctex
>> find useful.

>> I am using the synctex from the current version of texlive:
>> This is SyncTeX command line utility, version 1.5

>> Can anyone either
>> (a) enlighten me on what I am doing wrong; or
>> (b) definitively confirm that context is not currently playing nicely with
>> synctex (the wiki notwithstanding) and I should give up this quest for
>> now.

> ConTeXt doesn’t work with the synctex binary, but with
> mtxrun --script synctex

Thanks for that pointer.

Q1: Should that be in the wiki (https://wiki.contextgarden.net/SyncTeX)
somewhere?

When I try that out, for example with
mtxrun --script synctex --edit --name=a.tex --line=222 a.tex 
I am rewarded with
sandbox | variable 'linenumber' has no checker
(I tried various variations on that line I won't bore you with, but I keep
getting that error message.)

I also tried
mtxrun --script synctex --goto --page=4 --x=100 --y=100 a.synctex 
and that silently returns without apparently doing anything.  (While I
don't have a 'scite' editor, I created a program called 'scite' that pops a
message up on the screen if it is called.)

Similar to --edit,
mtxrun --script synctex --goto --page=19 --x=400 --y=180 --tolerance=99 
--editor=scite  a.synctex
complains
sandbox | variable 'tolerance' has no checker

Although I don't know lua, the code is easy enough to read, but a short
dive in to mtx-synctex.lua did not enlighten me.

Q2: any enlightening comments on why I am getting these complaints.

In any case, --find and --report (appear to) give meaningful results, so I
can work with those.

> Unfortunately, it’s not a drop-in replacement, so it doesn’t work with most
> editors. (I was thinking about a translating wrapper script, but didn’t do
> anything yet.)

So much code to write, so little time ...:-)

My immediate concern is forward search (i.e., editor tells viewer which
page to display) and that one should be easy for me to create a wrapper.
(I use emacs + auctex, which calls the synctex program, so writing my own
synctex wrapper looks easy.  Hopefully I won't regret using the word "easy"
later.)


> AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s
> workflow.

I've been thinking of patching some of evince's more annoying features,
if I do, maybe I should look into making it work with context.

> ConTeXt’s synctex format is much simpler than the “standard” LaTeX one and
> should be at least as good, but alas it needs support from the editors.

Indeed!




On Sun, Nov 12, 2023 at 12:00 (+0100), Hans Hagen wrote:

> On 11/12/2023 10:26 AM, Henning Hraban Ramm wrote:
>> Am 12.11.23 um 00:59 schrieb Jim:
>>> Hi,

>>> 

>> ConTeXt doesn’t work with the synctex binary, but with
>> mtxrun --script synctex

> afaik there is no binary ... there is a library that has to be compiled into
> a pdf viewer that intercept some 'goto the text file' command and then
> launches an editor (afik the library has some heuristics build in wrt boxes
> and nesting and so); at the tex end there is also a library that kicks in
> addiional code for nodes and the backend (which is why enabling synctex will
> have an impact on runtime)

> wrt the synctex file, that one is generated by context (so we don't use the
> synctex code in luatex and as luametatex has no backend there it's even
> completely absent ... context generates the file itself which is also a bit
> more efficient)

>> Unfortunately, it’s not a drop-in replacement, so it doesn’t work with
>> most editors. (I was thinking about a translating wrapper script, but
>> didn’t do anything yet.)

>> AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s
>> workflow.

> indeed texshop uses the approach that avoids the library and just calls
> mtxrun to figure out the file/line that relates to the position; this is
> more reliable because there is no need to re

[NTG-context] Re: checkbox in fields show the word yes

2023-10-05 Thread juh via ntg-context
Hi,

three years later I would like to hint to this thread again and ask if
there is hope that checkboxes will work better in Acrobat any time soon. 

Am Fri, Dec 11, 2020 at 06:28:36PM +0100 schrieb Hans Hagen:
> On 12/11/2020 6:13 PM, Andres Conrado Montoya wrote:
> > Firefox doesn't show the "yes", nor Acrobat X, but SumatraPDF does. I
> > modified your definition as:
> > 
> > \definefield[test][check][cbox][][]
> > 
> > And now the "yes" doesn't appear. However, I don't know how this affects
> > the functionality of the form.
> these symbols (esp how deafults are handles) has alwaye been a bit of a mess
> in acrobat (read: different per version) and relates to appearance streams
> and such (when a form is made in acrobat these streams get added, it could
> even be some dingbat kicking in or being vectorized or ... seen all kind of
> variants) ... officially a rendering should listen to some keys that relate
> to it but this is not always the case
> 
> (part of the problem is, i think, that esp for check fields a bugs or
> behaviour  has become a feature which makes it kin dof inconsisten twith the
> rest of the widgets .. it's even worse when one uses parent / child across
> pages ... it hasn;t helped that hardly any viewer supported it which in turn
> means no feedback)
> 
> (in lmtx iu could probably generate appearance streams but i'll only do that
> when i have an application for these widgets so that i can test 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
> ___

-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context 
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Toggling the symbol for the zero-width joiner and related Unicode control characters

2023-09-23 Thread Hamid,Idris

-- Original Message --
From "Hans Hagen via ntg-context" 
mailto:ntg-context@ntg.nl>>
To "ntg-context@ntg.nl<mailto:ntg-context@ntg.nl>" 
mailto:ntg-context@ntg.nl>>
Cc "Hans Hagen" mailto:j.ha...@freedom.nl>>
Date 9/22/2023 10:44:38 AM
Subject [NTG-context] Re: Toggling the symbol for the zero-width joiner and 
related Unicode control characters

(It seems he never considered making it an opentype feature in the font itself, 
but since his focus is/was XeTeX/HB (HB is rather rigid and dictatorial) I 
guess that's not surprising.)

I admit that I don't follow what happens with xetex (they changed the
rendere at some point indeed) not HB (I only notice that it gets updates
frequently in the tex live repository which makes me wonder how one
retains compatility unless one freezes). I actually kept the lib binding
code that can use it around for your font testing (we wanted to see what
uniscribe does), not sure if it still works.
I remember the experimental uniscribe binding, don't recall that it was ever 
officially released. (Did Kai Bormann ever work with it?).

I hope that it still works or can be resurrected when the time comes for 
testing -)


Anyway, we're entering the bug cq. side effect becomes feature area
here; just like yesterdays perfect bidi algorithm is todays less pefect
one replaced by ...

But therein lies the problem: ConTeXt shows the rendering by default, and we 
need to turn it off. Since most non-Latin typography targets Uniscribe 
applications which allows for toggling, the font developers (commercial or 
free) don't have to concern themselves with this issue.

if context shows it then it is not a feature but hard coded shapes which
is weird; how does one know what to 'remove' or not? And in what stage?
If they are zero width it is simple to ignore them in the backend, if
they have dimensions (w/h/d) then they contributed and wiping is tricky

The metrics should be dimensionless and most Arabic fonts do that, but Lotus 
Linotype gives them width (one wonders why).

Perhaps the Lotus designers thought that giving them width makes them easier to 
edit, which is indeed the case. And perhaps they were satisfied that 
Word/InDesign would be able, as needed, to toggle the metrics on and off as 
well as the shape. That WYSIWYG-DTP curse again..

\setcharacterstripping[1] gives the right results with Lotus (at least so far) 
-- see attached. Was pleasantly surprised that the spurious width was also 
suppressed.

\setcharacterstripping[0] toggles back -- another pleasant result -)


Since Word rules the world, most font designers target it. Since Word provides 
for toggling the symbols -- needed for editing purposes -- there was no need 
for Arabic-script font designers to worry about the symbols showing up where 
they are not wanted.

(I suppose that InDesign behaves the same way.)

I don't know ... irr these dtp programs are more like "if you want this
feature applied select a range of characters and apply it"

That's what was meant when I spoke of the continued effects of the WYSIWYG 
curse: It saved font designers from having to think much about this issue.

In some way it's also flaws in the open type approach. Basically that
happens when application stuff becomes a standard and one forgets that
it was (is) application driven. (And you haven't seen variable fonts and
color fonts yet ... no pretty standards either.)

I'm in the process of switching from Multiple Masters sources to variable, so 
will surely encounter it soon.

Unfortunately there is indeed a frustrating gray area in this arena between 
knowing where the standards end and where the diktats of corporations (or even 
free-software consortiums like HB) begin, as we've discussed in the past. With 
variable fonts, one has to add some degree of arbitrariness..


Not really -) This brings us to the point of consistency: For Arabic-script 
fonts, hard symbolic rendering of the Unicode control characters is the rule, 
not the exception. So not "an inconsistent mess" -- at least not as far as 
Arabic-script typography is concerned.

Funny rules ... but I'm not going top enable 'wipe' by default: after
all, one gets what one deserves, nto what one likes (which can differ
per day). But you can enable the wiping. We can of course ignore in the
backend when zero width but then how to explain that they contributed to
the ht/dp (unless we wipe these dimensions) ... all slow-downers
So far \setcharacterstripping[1] is giving the right results. If the relevant 
trackers are available, could add them to the attached test. But presumably you 
know how and why it works even for a non-dimensionless glyph.


so you want to see soem zwj sumbol in a rendered text?

Only in verbatim/\type'd text where it is appropriate, even necessary. Thanks 
to Word/WYSIWYG, the rule is de facto, but it is not de jure -)

Ideally, Scintilla (Scite, Notepad++, etc.) should do the same

[NTG-context] Re: Toggling the symbol for the zero-width joiner and related Unicode control characters

2023-09-22 Thread Hans Hagen via ntg-context

On 9/22/2023 3:51 PM, Hamid,Idris wrote:


-- Original Message --
 From "Hans Hagen" mailto:j.ha...@xs4all.nl>>
To "ntg-context@ntg.nl<mailto:ntg-context@ntg.nl>" 
mailto:ntg-context@ntg.nl>>
Date 9/22/2023 7:15:25 AM
Subject [NTG-context] Re: Toggling the symbol for the zero-width joiner and 
related Unicode control characters

** Caution: EXTERNAL Sender **

On 9/22/2023 2:39 PM, Hamid,Idris wrote:

b. we want all Unicode control symbols to be suppressed in final pdf output 
(for, e.g., printing).

they basically are unless some font features keeps them around which is
out of our control

irr it was you who wanted them to be wiped decades ago as some fonts
visualized them by default

Yes, that's exactly the point: Somewhere along the course of history, it became 
standard for Arabic-script fonts (and other cursive-script fonts as well) to 
include symbols for the control characters.

In typo-rep there is also

%D \starttyping
%D \definefontfeature[default][default][mode=node,formatters=strip]
%D \stoptyping

You included some notes about Khaled, so I guess he faced the same issue. His 
Amiri font displays the symbols by default, as do other Arabic fonts.

(It seems he never considered making it an opentype feature in the font itself, 
but since his focus is/was XeTeX/HB (HB is rather rigid and dictatorial) I 
guess that's not surprising.)


I admit that I don't follow what happens with xetex (they changed the 
rendere at some point indeed) not HB (I only notice that it gets updates 
frequently in the tex live repository which makes me wonder how one 
retains compatility unless one freezes). I actually kept the lib binding 
code that can use it around for your font testing (we wanted to see what 
uniscribe does), not sure if it still works.


Anyway, we're entering the bug cq. side effect becomes feature area 
here; just like yesterdays perfect bidi algorithm is todays less pefect 
one replaced by ...



But therein lies the problem: ConTeXt shows the rendering by default, and we 
need to turn it off. Since most non-Latin typography targets Uniscribe 
applications which allows for toggling, the font developers (commercial or 
free) don't have to concern themselves with this issue.


if context shows it then it is not a feature but hard coded shapes which 
is weird; how does one know what to 'remove' or not? And in what stage? 
If they are zero width it is simple to ignore them in the backend, if 
they have dimensions (w/h/d) then they contributed and wiping is tricky



Since Word rules the world, most font designers target it. Since Word provides 
for toggling the symbols -- needed for editing purposes -- there was no need 
for Arabic-script font designers to worry about the symbols showing up where 
they are not wanted.

(I suppose that InDesign behaves the same way.)


I don't know ... irr these dtp programs are more like "if you want this 
feature applied select a range of characters and apply it"



That's what was meant when I spoke of the continued effects of the WYSIWYG 
curse: It saved font designers from having to think much about this issue.


In some way it's also flaws in the open type approach. Basically that 
happens when application stuff becomes a standard and one forgets that 
it was (is) application driven. (And you haven't seen variable fonts and 
color fonts yet ... no pretty standards either.)



Not really -) This brings us to the point of consistency: For Arabic-script fonts, hard 
symbolic rendering of the Unicode control characters is the rule, not the exception. So 
not "an inconsistent mess" -- at least not as far as Arabic-script typography 
is concerned.


Funny rules ... but I'm not going top enable 'wipe' by default: after 
all, one gets what one deserves, nto what one likes (which can differ 
per day). But you can enable the wiping. We can of course ignore in the 
backend when zero width but then how to explain that they contributed to 
the ht/dp (unless we wipe these dimensions) ... all slow-downers



so you want to see soem zwj sumbol in a rendered text?

Only in verbatim/\type'd text where it is appropriate, even necessary. Thanks 
to Word/WYSIWYG, the rule is de facto, but it is not de jure -)

Ideally, Scintilla (Scite, Notepad++, etc.) should do the same, or provide a 
toggle, as MS Notepad does.

(Tangent: In terms of Unicode functionality, MS Notepad is still unrivalled, 
even in 2023!)

We agree that for final printed output it is not appropriate (except perhaps in 
a paper that discusses Unicode, fonts, etc., in which case it can be rendered 
using the figures or symbols mechanism -- or toggled as needed.)

so what is it now:

- for verbatim you can use almfixed and they show up (when they have a 
glyph)
- for other fonts if they have them they show up (unless gone in the 
process ot rendering)

- but you 

[NTG-context] Re: Toggling the symbol for the zero-width joiner and related Unicode control characters

2023-09-22 Thread Hamid,Idris

-- Original Message --
From "Hans Hagen" mailto:j.ha...@xs4all.nl>>
To "ntg-context@ntg.nl<mailto:ntg-context@ntg.nl>" 
mailto:ntg-context@ntg.nl>>
Date 9/22/2023 7:15:25 AM
Subject [NTG-context] Re: Toggling the symbol for the zero-width joiner and 
related Unicode control characters

** Caution: EXTERNAL Sender **

On 9/22/2023 2:39 PM, Hamid,Idris wrote:

b. we want all Unicode control symbols to be suppressed in final pdf output 
(for, e.g., printing).

they basically are unless some font features keeps them around which is
out of our control

irr it was you who wanted them to be wiped decades ago as some fonts
visualized them by default

Yes, that's exactly the point: Somewhere along the course of history, it became 
standard for Arabic-script fonts (and other cursive-script fonts as well) to 
include symbols for the control characters.

In typo-rep there is also

%D \starttyping
%D \definefontfeature[default][default][mode=node,formatters=strip]
%D \stoptyping

You included some notes about Khaled, so I guess he faced the same issue. His 
Amiri font displays the symbols by default, as do other Arabic fonts.

(It seems he never considered making it an opentype feature in the font itself, 
but since his focus is/was XeTeX/HB (HB is rather rigid and dictatorial) I 
guess that's not surprising.)



But therein lies the problem: ConTeXt shows the rendering by default, and we 
need to turn it off. Since most non-Latin typography targets Uniscribe 
applications which allows for toggling, the font developers (commercial or 
free) don't have to concern themselves with this issue.

?

Since Word rules the world, most font designers target it. Since Word provides 
for toggling the symbols -- needed for editing purposes -- there was no need 
for Arabic-script font designers to worry about the symbols showing up where 
they are not wanted.

(I suppose that InDesign behaves the same way.)

That's what was meant when I spoke of the continued effects of the WYSIWYG 
curse: It saved font designers from having to think much about this issue.



Not really -) This brings us to the point of consistency: For Arabic-script 
fonts, hard symbolic rendering of the Unicode control characters is the rule, 
not the exception. So not "an inconsistent mess" -- at least not as far as 
Arabic-script typography is concerned.

so you want to see soem zwj sumbol in a rendered text?

Only in verbatim/\type'd text where it is appropriate, even necessary. Thanks 
to Word/WYSIWYG, the rule is de facto, but it is not de jure -)

Ideally, Scintilla (Scite, Notepad++, etc.) should do the same, or provide a 
toggle, as MS Notepad does.

(Tangent: In terms of Unicode functionality, MS Notepad is still unrivalled, 
even in 2023!)

We agree that for final printed output it is not appropriate (except perhaps in 
a paper that discusses Unicode, fonts, etc., in which case it can be rendered 
using the figures or symbols mechanism -- or toggled as needed.)

I hope the above made sense.

Best wishes
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Toggling the symbol for the zero-width joiner and related Unicode control characters

2023-09-22 Thread Hamid,Idris


-- Original Message --
From "Hans Hagen via ntg-context" 
mailto:ntg-context@ntg.nl>>
To "ntg-context@ntg.nl<mailto:ntg-context@ntg.nl>" 
mailto:ntg-context@ntg.nl>>
Cc "Hans Hagen" mailto:j.ha...@freedom.nl>>
Date 9/22/2023 3:53:03 AM
Subject [NTG-context] Re: Toggling the symbol for the zero-width joiner and 
related Unicode control characters
1. Can this approach be generalized to get what we want, viz., a way to toggle 
the symbols?

given the inconsistency in what is or is not in a font the only way out
is to have our own visualization (consistent across fonts) and even then
it would add some mess because we're talking of a mix of characters that
can have gone (as part of rendering) or are not characters at all but
spacing

so, in that case only 'verbatim' is a candidate for visualization, not
so much typeset text

Hm, ok. Since almfixed is based on Knuth's mono, perhaps its visuals of the 
control characters can be extracted and used as fallback symbols.

Yes: For typeset text/printing visualization is generally unnecessary (the 
point of this thread).

2. \enabletrackers[typesetters.nbsp] gives a colored box, which is at least 
something.. But how can we get the NBSP symbol that's alerady in the font?

it's gone by that time ... the line break mmechanism uses glue, not
characters

Ok

3. Ideally:
a. we want all Unicode control symbols to show up in verbatim or in \typebuffer 
(as in a text editor);

only there (with some non interfering rendering i guess) and even then
it's probably an additonal pass over the node list

Ok, that would be good.

b. we want all Unicode control symbols to be suppressed in final pdf output 
(for, e.g., printing).

they basically are unless some font features keeps them around which is
out of our control

If the symbols are in the font, then they are not suppressed. See below.

But some fonts meant for printing have symbols for Unicode control chars -- 
that poses a challenge.

so an inconsistent mess not worth wasting time on (as this is hobbyism
only fun can be a motivational factir)

But there is a certain consistency -- see below.

And some fonts meant for verbatim/editing do not have symbols for the control 
chars -- that also poses a challenge. AlmFixed, of course, has them.

Most minimally decent Arabic fonts have symbols for the Unicode control chars 
as default, including Scheherazade, Amiri, Uthmanic, and Noto Naskh Arabic -- 
all free fonts.

Industry workhorses like Linotype Lotus (Arabic) also have them.

i'm not interested in those .. can't afford them for playing around
purposes .. we only look into commercial fonts if we get a dozen
unresticted copies for context developers

Except for Linotype Lotus, each of the Arabic-script fonts mentioned above is 
free, not commercial -)

(There is also a free version of Lotus -- it also has the symbolic rendering of 
the contol chars.)

Uniscribe applications like Notepad/Word allow for toggling in a WYSIWYG 
context -- can't speak for HarfBuzz -- so there is no harm in having explicit 
symbols in the font.

sure, as long as there is no rendering ... they show the input

But therein lies the problem: ConTeXt shows the rendering by default, and we 
need to turn it off. Since most non-Latin typography targets Uniscribe 
applications which allows for toggling, the font developers (commercial or 
free) don't have to concern themselves with this issue.

Yet another curse of the WYSIWYG paradigm, which mixes form and content -)

The upshot is that, for non-Latin scripts, some toggling capability in ConTeXt 
is important to have -- even inescapable for Arabic-script piblishing.

a bit subjectiev arguing -)

Not really -) This brings us to the point of consistency: For Arabic-script 
fonts, hard symbolic rendering of the Unicode control characters is the rule, 
not the exception. So not "an inconsistent mess" -- at least not as far as 
Arabic-script typography is concerned.

(Yes, for the upcoming Husayni I can add a font feature that does the trick, 
but that will be an exception to the rule.)

Perhaps others who use Arabic-script or Indic, etc., can chime in.. Am hopeful 
that we can figure something out!
sore, but not with 'instant priority' (unless it is some project)

My immediate project (no Husayni) is a book that features English translation 
of an Arabic text (hence the interest in the recent streams thread). Using some 
Unicode control characters will be unavoidable to get the rendering effects 
correct, but the symbols will need to be suppressed.

Am thinking/hoping that a ConTeXt-specific font feature can do the trick. Since 
there appears to be consistency across Arabic fonts in this matter it should 
not be messy at all, simply a fallback that sends the symbols to some no-man's 
land.

(A thought: Some of the code you kindly provided for transliteration might be 
reusable as well.. But a general solution for all ConTeXt users woul

[NTG-context] Re: Toggling the symbol for the zero-width joiner and related Unicode control characters

2023-09-22 Thread Hans Hagen via ntg-context

On 9/22/2023 6:16 AM, Hamid,Idris wrote:



-- Original Message --
 From "Hans Hagen" mailto:j.ha...@xs4all.nl>>
To "Hamid,Idris" mailto:idris.ha...@colostate.edu>>; "mailing list 
for ConTeXt users" mailto:ntg-context@ntg.nl>>
Date 9/21/2023 3:29:22 PM
Subject Re: [NTG-context] Re: Toggling the symbol for the zero-width joiner and 
related Unicode control characters
   Many thanks, Hans. The method appears to work only for nbsp, not zwj etc. 
Here is the updated MWE:

===
\startTEXpage[offset=1em]
\disabletrackers[typesetters.directions]
\disabletrackers[typesetters.zwj]
\disabletrackers[typesetters.zwnj]
\disabletrackers[typesetters.nbsp]
\definedfont[almfixed at 14pt]
ZWJ: ‌
ZWNJ: ‍
NBSP:
\stopTEXpage
===

See attached, please advise.
joiners are part of replacement etc and can come and go ... they are
characters (we could visualize them but one never knows for sure if one
sees them)

nbsp are spaces and become glue that we can trace reliable in the node list

Many thanks. Ok, here is another MWE featuring a workaround using fallbacks:

==
\definefontfallback[nosymbols] [file:lmmono10-regular] [200C,200D] [force=yes]
\starttypescript [serif] [alm] [name]
 \definefontsynonym [Serif] [ArabicLatinSerif]
\stoptypescript
\starttypescript [mono] [alm] [name]
 \definefontsynonym [Mono]  [ArabicLatinMono]
\stoptypescript
\starttypescript [serif] [alm]
 \definefontsynonym [ArabicLatinSerif] [file:almfixed] % 
[fallbacks=nosymbols]
\stoptypescript
\starttypescript [mono] [alm]
 \definefontsynonym [ArabicLatinMono] [file:almfixed] [fallbacks=nosymbols]
\stoptypescript
\starttypescript [almfixed-nosymbols]
\definetypeface [\typescriptone] [rm] [serif] [alm] [default]
\definetypeface [\typescriptone] [tt] [mono] [alm] [default]
\stoptypescript
\usetypescript[almfixed-nosymbols]
\setupbodyfont[almfixed-nosymbols,12pt]
\startTEXpage[offset=1em]
\rm
ZWJ: ‌
ZWNJ: ‍
NBSP:
\tt
ZWJ: ‌
ZWNJ: ‍
NBSP:
\stopTEXpage
==

Under \rm we get the symbols, and under \tt they are suppressed. Of course it 
doesn't matter what fallback font one uses, as long as it has no 
control-character symbols.

1. Can this approach be generalized to get what we want, viz., a way to toggle 
the symbols?


given the inconsistency in what is or is not in a font the only way out 
is to have our own visualization (consistent across fonts) and even then 
it would add some mess because we're talking of a mix of characters that 
can have gone (as part of rendering) or are not characters at all but 
spacing


so, in that case only 'verbatim' is a candidate for visualization, not 
so much typeset text



2. \enabletrackers[typesetters.nbsp] gives a colored box, which is at least 
something.. But how can we get the NBSP symbol that's alerady in the font?


it's gone by that time ... the line break mmechanism uses glue, not 
characters



3. Ideally:
a. we want all Unicode control symbols to show up in verbatim or in \typebuffer 
(as in a text editor);


only there (with some non interfering rendering i guess) and even then 
it's probably an additonal pass over the node list



b. we want all Unicode control symbols to be suppressed in final pdf output 
(for, e.g., printing).


they basically are unless some font features keeps them around which is 
out of our control



But some fonts meant for printing have symbols for Unicode control chars -- 
that poses a challenge.


so an inconsistent mess not worth wasting time on (as this is hobbyism 
only fun can be a motivational factir)



And some fonts meant for verbatim/editing do not have symbols for the control 
chars -- that also poses a challenge.  AlmFixed, of course, has them.

Most minimally decent Arabic fonts have symbols for the Unicode control chars 
as default, including Scheherazade, Amiri, Uthmanic, and Noto Naskh Arabic -- 
all free fonts.

Industry workhorses like Linotype Lotus (Arabic) also have them.


i'm not interested in those .. can't afford them for playing around
purposes .. we only look into commercial fonts if we get a dozen 
unresticted copies for context developers



Uniscribe applications like Notepad/Word allow for toggling in a WYSIWYG 
context -- can't speak for HarfBuzz -- so there is no harm in having explicit 
symbols in the font.


sure, as long as there is no rendering ... they show the input


The upshot is that, for non-Latin scripts, some toggling capability in ConTeXt 
is important to have -- even inescapable for Arabic-script piblishing.


a bit subjectiev arguing -)


Perhaps others who use Arabic-script or Indic, etc., can chime in.. Am hopeful 
that we can figure something out!

sore, but not with 'instant priority' (unless it is some project)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 4

[NTG-context] Re: Toggling the symbol for the zero-width joiner and related Unicode control characters

2023-09-21 Thread Hamid,Idris


-- Original Message --
From "Hans Hagen" mailto:j.ha...@xs4all.nl>>
To "Hamid,Idris" mailto:idris.ha...@colostate.edu>>; 
"mailing list for ConTeXt users" mailto:ntg-context@ntg.nl>>
Date 9/21/2023 3:29:22 PM
Subject Re: [NTG-context] Re: Toggling the symbol for the zero-width joiner and 
related Unicode control characters
  Many thanks, Hans. The method appears to work only for nbsp, not zwj etc. 
Here is the updated MWE:

===
\startTEXpage[offset=1em]
\disabletrackers[typesetters.directions]
\disabletrackers[typesetters.zwj]
\disabletrackers[typesetters.zwnj]
\disabletrackers[typesetters.nbsp]
\definedfont[almfixed at 14pt]
ZWJ: ‌
ZWNJ: ‍
NBSP:
\stopTEXpage
===

See attached, please advise.
joiners are part of replacement etc and can come and go ... they are
characters (we could visualize them but one never knows for sure if one
sees them)

nbsp are spaces and become glue that we can trace reliable in the node list

Many thanks. Ok, here is another MWE featuring a workaround using fallbacks:

==
\definefontfallback[nosymbols] [file:lmmono10-regular] [200C,200D] [force=yes]
\starttypescript [serif] [alm] [name]
\definefontsynonym [Serif] [ArabicLatinSerif]
\stoptypescript
\starttypescript [mono] [alm] [name]
\definefontsynonym [Mono]  [ArabicLatinMono]
\stoptypescript
\starttypescript [serif] [alm]
\definefontsynonym [ArabicLatinSerif] [file:almfixed] % 
[fallbacks=nosymbols]
\stoptypescript
\starttypescript [mono] [alm]
\definefontsynonym [ArabicLatinMono] [file:almfixed] [fallbacks=nosymbols]
\stoptypescript
\starttypescript [almfixed-nosymbols]
\definetypeface [\typescriptone] [rm] [serif] [alm] [default]
\definetypeface [\typescriptone] [tt] [mono] [alm] [default]
\stoptypescript
\usetypescript[almfixed-nosymbols]
\setupbodyfont[almfixed-nosymbols,12pt]
\startTEXpage[offset=1em]
\rm
ZWJ: ‌
ZWNJ: ‍
NBSP:
\tt
ZWJ: ‌
ZWNJ: ‍
NBSP:
\stopTEXpage
==

Under \rm we get the symbols, and under \tt they are suppressed. Of course it 
doesn't matter what fallback font one uses, as long as it has no 
control-character symbols.

1. Can this approach be generalized to get what we want, viz., a way to toggle 
the symbols?

2. \enabletrackers[typesetters.nbsp] gives a colored box, which is at least 
something.. But how can we get the NBSP symbol that's alerady in the font?

3. Ideally:
a. we want all Unicode control symbols to show up in verbatim or in \typebuffer 
(as in a text editor);
b. we want all Unicode control symbols to be suppressed in final pdf output 
(for, e.g., printing).

But some fonts meant for printing have symbols for Unicode control chars -- 
that poses a challenge.

And some fonts meant for verbatim/editing do not have symbols for the control 
chars -- that also poses a challenge.  AlmFixed, of course, has them.

Most minimally decent Arabic fonts have symbols for the Unicode control chars 
as default, including Scheherazade, Amiri, Uthmanic, and Noto Naskh Arabic -- 
all free fonts.

Industry workhorses like Linotype Lotus (Arabic) also have them.

Uniscribe applications like Notepad/Word allow for toggling in a WYSIWYG 
context -- can't speak for HarfBuzz -- so there is no harm in having explicit 
symbols in the font.

The upshot is that, for non-Latin scripts, some toggling capability in ConTeXt 
is important to have -- even inescapable for Arabic-script piblishing.

Perhaps others who use Arabic-script or Indic, etc., can chime in.. Am hopeful 
that we can figure something out!

Best wishes
Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: XML: flush to lua function

2023-09-12 Thread Taco Hoekwater
Hi,

xml.text(t) is safer than directly accessing t.dt[1].

Note: you may need to strip some XML tags from that content. 

If the element is not straight-up data but has nested elements, then this will 
return the full xml representation instead:

 A short title=> ‘A short title'
 A short title=> ‘'
 A short title => 'A short 
title'


Best wishes,
Taco

> On 12 Sep 2023, at 08:56,   wrote:
> 
> Ok, I’ve found a way, see below.
> But maybe someone has some nice lua (or other) tricks to share… (I’m not sure 
> accessing t.dt[1] is particularly safe when operating on nested structures.)
>  Best,
> Denis
>  \startbuffer[test]
> 
> 
> 
> A short title
> asdf asdf asdf jklö jklö jklö
>   
>   
> A longer title bla bla bla bla bla bla bla bla
> 
> asdf asdf asdf jklö jklö jklö
> 
>   
> 
> \stopbuffer
>  \startxmlsetups xml:test
> \xmlsetsetup{#1}{*}{-}
> \xmlsetsetup{#1}{doc|chapter|p}{xml:*}
> \stopxmlsetups
>  \xmlregisterdocumentsetup{test}{xml:test}
>  \startxmlsetups xml:doc
>\xmlflush{#1}
> \stopxmlsetups
>  \setuphead[chapter][expansion=yes] % make sure the stuff gets expanded on 
> time
> \startxmlsetups xml:chapter
> \startchapter
>[
>
> title={\xmlfilter{#1}{/title/command(xml:chapter:title)}},
>
> marking={\xmlfilter{#1}{/title/command(xml:chapter:title:marking)}},
>]
>\xmlflush{#1}
> \stopchapter
> \stopxmlsetups
>  \startxmlsetups xml:p
> \xmlflush{#1}\par
> \stopxmlsetups
>  \startluacode
> function xml.functions.getMarking(t)
> _,n = t.dt[1]:gsub("%S+","")
> if n > 10 then   local words = {} 
>   for word in t.dt[1]:gmatch("%S+") do table.insert(words, word) end
>   local resWords = {}
>   resWords =  { unpack( words, 1, 7 ) }
>   res = table.concat(resWords, " ") .. " …"
> else   res = t.dt[1]
> end
> context(res)
> end
> \stopluacode
>  \startxmlsetups xml:chapter:title:marking
> \xmlfunction{#1}{getMarking}
> \stopxmlsetups
>  \startxmlsetups xml:chapter:title
> \xmlflush{#1}
> \stopxmlsetups
>   \setupheadertexts[chapter]
>  \starttext
>  \xmlprocessbuffer{test}{test}{}
>  \stoptext
>   Von: denis.ma...@unibe.ch  
> Gesendet: Montag, 11. September 2023 16:47
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] XML: flush to lua function
>  Hi,
> I have the following xml setup with a lua function:
>  \startluacode
> function markingLength(s)
> _,n = s:gsub("%S+","")
> if n > 3 then context("yes" .. " …") else 
> context("no") end
> end
> \stopluacode
>  \startxmlsetups xml:ink:ink-title:marking
> %\ctxlua{markingLength(\xmlflush{#1})}  % does not work
> \ctxlua{markingLength{"1 2 3 4"}}
> \stopxmlsetups
>  While the function works, I cannot use xmlflush here. How can I properly 
> pass the xml content to the lua function?
>  Best,
> Denis
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___


— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)


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

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

[NTG-context] Re: XML: flush to lua function

2023-09-12 Thread denis.maier
Ok, I've found a way, see below.
But maybe someone has some nice lua (or other) tricks to share... (I'm not sure 
accessing t.dt[1] is particularly safe when operating on nested structures.)

Best,
Denis

\startbuffer[test]



A short title
asdf asdf asdf jklö jklö jklö
  
  
A longer title bla bla bla bla bla bla bla bla

asdf asdf asdf jklö jklö jklö

  

\stopbuffer

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{doc|chapter|p}{xml:*}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

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

\setuphead[chapter][expansion=yes] % make sure the stuff gets expanded on time
\startxmlsetups xml:chapter
\startchapter
   [
   
title={\xmlfilter{#1}{/title/command(xml:chapter:title)}},
   
marking={\xmlfilter{#1}{/title/command(xml:chapter:title:marking)}},
   ]
   \xmlflush{#1}
\stopchapter
\stopxmlsetups

\startxmlsetups xml:p
\xmlflush{#1}\par
\stopxmlsetups

\startluacode
function xml.functions.getMarking(t)
_,n = t.dt[1]:gsub("%S+","")
if n > 10 then
  local words = {}
      for word in t.dt[1]:gmatch("%S+") do table.insert(words, 
word) end
  local resWords = {}
  resWords =  { unpack( words, 1, 7 ) }
  res = table.concat(resWords, " ") .. " ..."
else
  res = t.dt[1]
end
context(res)
end
\stopluacode

\startxmlsetups xml:chapter:title:marking
\xmlfunction{#1}{getMarking}
\stopxmlsetups

\startxmlsetups xml:chapter:title
\xmlflush{#1}
\stopxmlsetups


\setupheadertexts[chapter]

\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext


Von: denis.ma...@unibe.ch 
Gesendet: Montag, 11. September 2023 16:47
An: ntg-context@ntg.nl
Betreff: [NTG-context] XML: flush to lua function

Hi,
I have the following xml setup with a lua function:

\startluacode
function markingLength(s)
_,n = s:gsub("%S+","")
if n > 3 then
context("yes" .. " ...") else context("no") end
end
\stopluacode

\startxmlsetups xml:ink:ink-title:marking
%\ctxlua{markingLength(\xmlflush{#1})}  % does not work
\ctxlua{markingLength{"1 2 3 4"}}
\stopxmlsetups

While the function works, I cannot use xmlflush here. How can I properly pass 
the xml content to the lua function?

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

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

[NTG-context] Re: Trimming (rearranging) long section name

2023-09-04 Thread Wolfgang Schuster

Lukas via ntg-context schrieb am 04.09.2023 um 13:33:

Hello,

just

"
\setuphead[section][distance=1.25em]
\setuphead[section][style=\bfc]
"

Lukas


On 2023-09-04 11:25, Henning Hraban Ramm wrote:

Am 04.09.23 um 13:06 schrieb Lukas via ntg-context:

IOW to force the word "stavby" not to cross the right border (see the
green vertical line) but to appear on the next line?

I played with "strict", "verytolerant" and similar options but they 
seem

not to affect section titles.


What’s your section setup, esp. the align settings?


Please try to provide a *working* minimal example the next time, 
otherwise we have

to fill the missing parts (\starttext ... \stoptext).

\mainlanguage[cz]

\setuphead
  [section]
  [distance=1.25em,
   style=\bfc,
   align={flushleft,broad,nothyphenated}]

\setupbodyfont[8pt]

\starttext

\chapter{Dummy}

\samplefile{lorem}

\section{Specifické požadavky pro předpokládanou technologii stavby 
(přístupy, přívody el. energie, skladovací plochy, montážní a pomocné 
plochy, montážní a pomocné konstrukce, ...)}


\stoptext

Wolfgang

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

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

[NTG-context] Re: Trimming (rearranging) long section name

2023-09-04 Thread Lukas via ntg-context

Hello,

just

"
\setuphead[section][distance=1.25em]
\setuphead[section][style=\bfc]
"

Lukas


On 2023-09-04 11:25, Henning Hraban Ramm wrote:

Am 04.09.23 um 13:06 schrieb Lukas via ntg-context:

IOW to force the word "stavby" not to cross the right border (see the
green vertical line) but to appear on the next line?

I played with "strict", "verytolerant" and similar options but they 
seem

not to affect section titles.


What’s your section setup, esp. the align settings?

Hraban

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

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

[NTG-context] Re: Trimming (rearranging) long section name

2023-09-04 Thread Henning Hraban Ramm

Am 04.09.23 um 13:06 schrieb Lukas via ntg-context:

IOW to force the word "stavby" not to cross the right border (see the
green vertical line) but to appear on the next line?

I played with "strict", "verytolerant" and similar options but they seem
not to affect section titles.


What’s your section setup, esp. the align settings?

Hraban

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

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

[NTG-context] Trimming (rearranging) long section name

2023-09-04 Thread Lukas via ntg-context

Hello,

is there a way to alter the section name to be

"
Specifické požadavky pro předpokládanou technologii
stavby (přístupy, přívody el. energie, skladovací plochy,
montážní a pomocné plochy, montážní a pomocné konstrukce,
...)
"

instead of

"
Specifické požadavky pro předpokládanou technologii stavby
(přístupy, přívody el. energie, skladovací plochy, mon-
tážní a pomocné plochy, montážní a pomocné konstrukce,
...)
"

IOW to force the word "stavby" not to cross the right border (see the
green vertical line) but to appear on the next line?

I played with "strict", "verytolerant" and similar options but they seem
not to affect section titles.

(MkIV solution preferably.)

Best regards,

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

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

[NTG-context] Re: XML processing beginner's question

2023-08-21 Thread Michael Löscher
Yes, I have done that. But I don't seem to have the basic context of how 
the processing works in order. All I have so far is this as a starting 
point:


\startxmlsetups xml:mysetup

\xmlsetsetup{main}{document|element|mdata|tdata|name|date|num|content|shortdescription|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetup}

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

\startxmlsetups xml:mysetup:element
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:mdata
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:tdata
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:name
\xmlflush
\stopxmlsetups

\startxmlsetups xml:mysetup:num
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:content
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:shortdescription
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:p
\xmlflush{#1}\par
\stopxmlsetups

\starttext
  \xmlprocessbuffer {mysetup}{xmlcontent}{}
\stoptext

Am 21.08.2023 um 17:45 schrieb Thomas A. Schmitz:
Have you looked at chapter 3.10 "Testing" of the manual xml-mkiv.pdf? 
There are a lot of commands there that should help you, such as


\xmldoiftext {#1} {/mdata/date}
  {\bf \xmlflush {#1}}

or \xmldoifelsetext.

There's also \xmlfilter, which you can use to test for the content of 
tags. And of course, you can process in Lua and search for strings or 
use lpeg. However, your question is a bit vague now. Show us some code 
you have and we can take it from there; that's easier than writing the 
whole setup for you.


Thomas


On 8/21/23 17:29, Michael Löscher wrote:

Hello list,

having the xml data at the bottom, I would like to process it so that 
the result is like this:


---
What it is (e.g. bold formatted)
date: 2023-08-01 (italic)
Description (small font size)
Another text (small font size)

hd1 - Header 1

§ 1 First  (A first short description)
AA
BB

§ 2 Second (A second short description)
CC
DD

§ 3 Third (A third short description)
EE
FF
---

How can I process the s differently? The first element 
contains a  tag and so it differs from the other ones. The 
second element's  tag contains the word "Header" which makes it 
different again. The other elements contain a  tag 
that they all have in common.


What could be the appropriate xml setups to generate the above output?

Michael

---
xml data:
\startbuffer[xmlcontent]


   
 
   What it is
   2023-08-01
 
 
   
 Description
 Another text
   
 
   
   
 
   hd1
   Header 1
 
 
   
 Text of Header 1
   
 
   
   
 
   1
   First
   A first short description
 
 
   
 AA
 BB
   
 
   
   
 
   2
   Second
   A second short description
 
 
   
 CC
 DD
   
 
   
   
 
   3
   Third
   A third short description
 
 
   
 EE
 FF
   
 
   

\stopbuffer



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


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

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

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

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

[NTG-context] Re: XML processing beginner's question

2023-08-21 Thread Thomas A. Schmitz
Have you looked at chapter 3.10 "Testing" of the manual xml-mkiv.pdf? 
There are a lot of commands there that should help you, such as


\xmldoiftext {#1} {/mdata/date}
 {\bf \xmlflush {#1}}

or \xmldoifelsetext.

There's also \xmlfilter, which you can use to test for the content of 
tags. And of course, you can process in Lua and search for strings or 
use lpeg. However, your question is a bit vague now. Show us some code 
you have and we can take it from there; that's easier than writing the 
whole setup for you.


Thomas


On 8/21/23 17:29, Michael Löscher wrote:

Hello list,

having the xml data at the bottom, I would like to process it so that 
the result is like this:


---
What it is (e.g. bold formatted)
date: 2023-08-01 (italic)
Description (small font size)
Another text (small font size)

hd1 - Header 1

§ 1 First  (A first short description)
AA
BB

§ 2 Second (A second short description)
CC
DD

§ 3 Third (A third short description)
EE
FF
---

How can I process the s differently? The first element contains 
a  tag and so it differs from the other ones. The second element's 
 tag contains the word "Header" which makes it different again. 
The other elements contain a  tag that they all have 
in common.


What could be the appropriate xml setups to generate the above output?

Michael

---
xml data:
\startbuffer[xmlcontent]


   
     
   What it is
   2023-08-01
     
     
   
     Description
     Another text
   
     
   
   
     
   hd1
   Header 1
     
     
   
     Text of Header 1
   
     
   
   
     
   1
   First
   A first short description
     
     
   
     AA
     BB
   
     
   
   
     
   2
   Second
   A second short description
     
     
   
     CC
     DD
   
     
   
   
     
   3
   Third
   A third short description
     
     
   
     EE
     FF
   
     
   

\stopbuffer



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

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

[NTG-context] XML processing beginner's question

2023-08-21 Thread Michael Löscher

Hello list,

having the xml data at the bottom, I would like to process it so that 
the result is like this:


---
What it is (e.g. bold formatted)
date: 2023-08-01 (italic)
Description (small font size)
Another text (small font size)

hd1 - Header 1

§ 1 First  (A first short description)
AA
BB

§ 2 Second (A second short description)
CC
DD

§ 3 Third (A third short description)
EE
FF
---

How can I process the s differently? The first element contains 
a  tag and so it differs from the other ones. The second element's 
 tag contains the word "Header" which makes it different again. 
The other elements contain a  tag that they all have 
in common.


What could be the appropriate xml setups to generate the above output?

Michael

---
xml data:
\startbuffer[xmlcontent]


  

  What it is
  2023-08-01


  
Description
Another text
  

  
  

  hd1
  Header 1


  
Text of Header 1
  

  
  

  1
  First
  A first short description


  
AA
BB
  

  
  

  2
  Second
  A second short description


  
CC
DD
  

  
  

  3
  Third
  A third short description


  
EE
FF
  

  

\stopbuffer

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

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

[NTG-context] unsubscribe

2023-08-18 Thread Thomas Floeren via ntg-context


> On 18. Aug 2023, at 20:17, Carlos  wrote:
> 
> On Fri, Aug 18, 2023 at 06:20:29PM +0200, Mikael Sundqvist wrote:
>> Hi,
>> 
>> It is extremely difficult to follow what you write.
>> 
>> On Fri, Aug 18, 2023 at 11:43 AM Carlos  wrote:
>>> 
>>> If I have the following, with these linebreaks as in:
>>> 
>>> {\par But a system cannot be successful if it is too strongly
>>> influenced by a single person. {\obeylines Once the initial design is
>>> complete and fairly robust, the real test begins as people
>>> with many different viewpoints undertake their own
>>> experiments.}}
>> 
>> Is that the complete document? What do you have in mind with obeying
>> lines in the middle of a paragraph?
> 
> it's the only possible way off the top of my head to circumvent body
> font size with a given width, while keeping both: the kern of \TeX\
> and the double spacing that lmtx injects following a sentence,
> within sanity check, hence the nonfrenchspacing
> 
> The separation of any of these four components would have hurt T
> E X sig­
> nificantly.
> If I had not participated fully in all these activities, literally
> hundreds of improvements would never have been made, because I would
> never have thought of them or perceived why they were important.
> But a system cannot be successful if it is too strongly influenced
> by a single person. Once the initial design is
> 
> 
>> 
>>> 
>>> and opted to load another font, other than cmr that is, a \frenchspacing
>>> approach wouldn't be further required
>> 
>> cmr? Not used in ConTeXt for a long time. (And what does the changing
>> of font have to do with this?)
> 
> latin modern.
>> 
>>> 
>>> Bear with me here, in the current state, for example, and as long as say
>>> 
>>> «…person.␣{\obeylines Once the initial is
>>> complete…» though feasible enough, leaves any prior \␣ at the mercy of
>>> whatever fontsize and/or set width happens to be. And this is just plain
>>> wrong.
>> 
>> What?
>> 
>>> 
>>> Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation
>>> of any of these four components would have hurt \TeX\ significantly. }
>> 
>> Likewise what?
>> 
>>> 
>>> The next sentence: «If I had not participated…» does not get any
>>> \nofrenchspacing which is equally and doubly problematic. It shows lack of
>>> consistency. And this ought not to be an ‹either› ‹or› scenario. But
>>> rather, an and conjunctional construct. It fails both ways.
>> 
>> Consistency of what? Spacing? Where? Can you make a complete example?
>> (You can show space amount with \showmakup[space])
> 
> yes. and showmakeup displays: .SP:10.945 If
> 
> rather than for example with: .SP:5.235
> OnceSP:3.926
> theSP:3.926
> initial SP:3.926
> designSP:3.926
> is 
> 
> and 
> 
> :3.586
> THK:-1.853
> H__E
> X
> HK:-1.390
> SP:3.586
> sig­RH:0.000
> IR:0.000
> RS:0.000
> LH:0.000
> H__nificantlyLS:0.000BS:6.565
> 
> 
> and here's your example:
> 
> \setuplayout[width=16cm]
> \showmakeup
> 
> \starttext
> 
> Thus, I came to the conclusion that the designer of a new
> system must not only be the implementer and first
> large||scale user; the designer should also write the first
> user manual.
> \setupbodyfont[12.895pt]
> 
> {\ss The separation of any of these four components would have
> hurt \TeX\ significantly. If I had not participated fully in
> all these activities, literally hundreds of improvements
> would never have been made, because I would never have
> thought of them or perceived why they were important.\par}
> 
> Do you see that width of 16cm? That's what throws it off
> 
> but then again, anything less than that 12.895 font size, throws off the
> kern of \TeX\ too. 
> 
> As a result, I can't use any lower font size, before everything,
> including kerning of \TeX\ and spaces after sentences, are completely
> off.
> 
> I mean. obeylines serve a better function than having extra spaces all
> over with no end in sight, really. 
>> 
>>> 
>>> Furthermore, with the same token, if width is specified with a
>>> 
>>> \setuplayout[width=15cm]
>> 
>> OK, here the game changes...
>> 
>>> 
>>> Anything less than 12.895pt, especifically for that use case, wwould
>>> throw anything, particularly control sequences such as \TeX\ out
>>> of whack, and conversely, once a value of that very pt or pica or
>>> wha

[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach

2023-08-18 Thread Carlos
On Fri, Aug 18, 2023 at 02:26:55PM -0400, Carlos wrote:
> On Fri, Aug 18, 2023 at 06:20:29PM +0200, Mikael Sundqvist wrote:
> > Hi,
> > 
> > It is extremely difficult to follow what you write.
> > 
> > On Fri, Aug 18, 2023 at 11:43 AM Carlos  wrote:
> > >
> > > If I have the following, with these linebreaks as in:
> > >
> > > {\par But a system cannot be successful if it is too strongly
> > > influenced by a single person. {\obeylines Once the initial design is
> > > complete and fairly robust, the real test begins as people
> > > with many different viewpoints undertake their own
> > > experiments.}}
> > 
> > Is that the complete document? What do you have in mind with obeying
> > lines in the middle of a paragraph?
> > 
> > >
> > > and opted to load another font, other than cmr that is, a \frenchspacing
> > > approach wouldn't be further required
> > 
> > cmr? Not used in ConTeXt for a long time. (And what does the changing
> > of font have to do with this?)
> > 
> > >
> > > Bear with me here, in the current state, for example, and as long as say
> > >
> > > «…person.␣{\obeylines Once the initial is
> > > complete…» though feasible enough, leaves any prior \␣ at the mercy of
> > > whatever fontsize and/or set width happens to be. And this is just plain
> > > wrong.
> > 
> > What?
> > 
> > >
> > > Likewise, if a word sequence such as \TeX\ occurs as in {\ss The 
> > > separation
> > > of any of these four components would have hurt \TeX\ significantly. }
> > 
> > Likewise what?
> > 
> > >
> > > The next sentence: «If I had not participated…» does not get any
> > > \nofrenchspacing which is equally and doubly problematic. It shows lack of
> > > consistency. And this ought not to be an ‹either› ‹or› scenario. But
> > > rather, an and conjunctional construct. It fails both ways.
> > 
> > Consistency of what? Spacing? Where? Can you make a complete example?
> > (You can show space amount with \showmakup[space])
> > 
> > >
> > > Furthermore, with the same token, if width is specified with a
> > >
> > > \setuplayout[width=15cm]
> > 
> > OK, here the game changes...
> > 
> > >
> > > Anything less than 12.895pt, especifically for that use case, wwould
> > > throw anything, particularly control sequences such as \TeX\ out
> > > of whack, and conversely, once a value of that very pt or pica or
> > > whatever is lowered, it brings that nonfrenchspacing right back on.
> > > And if width increments occur, then it follows that any control sequence 
> > > kerning
> > > also gets thrown off as a result.
> > 
> > Of course the width influences the spacing. That is how the paragraph
> > builder works (and really, why it often looks good).
> > 
> > >
> > > It seems so far, that with lmtx, any standalone file, document, minimal
> > > working example that does not load cmr at the outset does not produce
> > > an acceptable outcome either. By saying acceptable I meant to say it
> > > namely from a typographical point of view. Nothing else.
> > 
> > I have no clue of what you talk about here.
> > 
> > >
> > > from the TeXbook 380-381
> > >
> > > «\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired 
> > > changes to
> > > \par before invoking \obeylines. (2) The \uncatcodespecials operation 
> > > changes a
> > > space to category 12; but the \tt font has the character ‘␣’ in the 
> > > ⟨space⟩ position, so we
> > > don’t really want ␣12 . (3) The \obeyspaces macro in Appendix B merely 
> > > changes the
> > > ⟨space⟩ character to category 13; active character ␣13 has been defined 
> > > to be the same
> > > as \space, a macro that expands to ␣10 . This is usually what is desired; 
> > > for example,
> > > it means that spaces in constructions like ‘\hbox to 10 pt {...}’ won’t 
> > > cause any
> > > trouble. But in our application it has an undesirable effect, because it 
> > > produces spaces
> > > that are affected by the space factor. To defeat this feature, it’s 
> > > necessary either to
> > > say \frenchspacing or to redefine ␣13 to be the same as \␣. The latter 
> > > alternative is
> > > better, because the former will discard spaces at the beginning of each
> > > line.»
> > >

[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach

2023-08-18 Thread Carlos
On Fri, Aug 18, 2023 at 06:20:29PM +0200, Mikael Sundqvist wrote:
> Hi,
> 
> It is extremely difficult to follow what you write.
> 
> On Fri, Aug 18, 2023 at 11:43 AM Carlos  wrote:
> >
> > If I have the following, with these linebreaks as in:
> >
> > {\par But a system cannot be successful if it is too strongly
> > influenced by a single person. {\obeylines Once the initial design is
> > complete and fairly robust, the real test begins as people
> > with many different viewpoints undertake their own
> > experiments.}}
> 
> Is that the complete document? What do you have in mind with obeying
> lines in the middle of a paragraph?
> 
> >
> > and opted to load another font, other than cmr that is, a \frenchspacing
> > approach wouldn't be further required
> 
> cmr? Not used in ConTeXt for a long time. (And what does the changing
> of font have to do with this?)
> 
> >
> > Bear with me here, in the current state, for example, and as long as say
> >
> > «…person.␣{\obeylines Once the initial is
> > complete…» though feasible enough, leaves any prior \␣ at the mercy of
> > whatever fontsize and/or set width happens to be. And this is just plain
> > wrong.
> 
> What?
> 
> >
> > Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation
> > of any of these four components would have hurt \TeX\ significantly. }
> 
> Likewise what?
> 
> >
> > The next sentence: «If I had not participated…» does not get any
> > \nofrenchspacing which is equally and doubly problematic. It shows lack of
> > consistency. And this ought not to be an ‹either› ‹or› scenario. But
> > rather, an and conjunctional construct. It fails both ways.
> 
> Consistency of what? Spacing? Where? Can you make a complete example?
> (You can show space amount with \showmakup[space])
> 
> >
> > Furthermore, with the same token, if width is specified with a
> >
> > \setuplayout[width=15cm]
> 
> OK, here the game changes...
> 
> >
> > Anything less than 12.895pt, especifically for that use case, wwould
> > throw anything, particularly control sequences such as \TeX\ out
> > of whack, and conversely, once a value of that very pt or pica or
> > whatever is lowered, it brings that nonfrenchspacing right back on.
> > And if width increments occur, then it follows that any control sequence 
> > kerning
> > also gets thrown off as a result.
> 
> Of course the width influences the spacing. That is how the paragraph
> builder works (and really, why it often looks good).
> 
> >
> > It seems so far, that with lmtx, any standalone file, document, minimal
> > working example that does not load cmr at the outset does not produce
> > an acceptable outcome either. By saying acceptable I meant to say it
> > namely from a typographical point of view. Nothing else.
> 
> I have no clue of what you talk about here.
> 
> >
> > from the TeXbook 380-381
> >
> > «\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired 
> > changes to
> > \par before invoking \obeylines. (2) The \uncatcodespecials operation 
> > changes a
> > space to category 12; but the \tt font has the character ‘␣’ in the ⟨space⟩ 
> > position, so we
> > don’t really want ␣12 . (3) The \obeyspaces macro in Appendix B merely 
> > changes the
> > ⟨space⟩ character to category 13; active character ␣13 has been defined to 
> > be the same
> > as \space, a macro that expands to ␣10 . This is usually what is desired; 
> > for example,
> > it means that spaces in constructions like ‘\hbox to 10 pt {...}’ won’t 
> > cause any
> > trouble. But in our application it has an undesirable effect, because it 
> > produces spaces
> > that are affected by the space factor. To defeat this feature, it’s 
> > necessary either to
> > say \frenchspacing or to redefine ␣13 to be the same as \␣. The latter 
> > alternative is
> > better, because the former will discard spaces at the beginning of each
> > line.»
> >
> > «In theory, this seems like it ought to work; but in practice, it fails in 
> > two ways. One
> > rather obvious failure—at least, it becomes obvious when the macro is 
> > tested—is that
> > all the empty lines of the file are omitted. The reason is that the \par 
> > command at the
> > end of an empty line doesn’t start up a new paragraph, because it occurs in 
> > vertical
> > mode. The other failure is not as obvious, because it occurs much less 
> > often: The \tt
> > fonts contain ligatures for Spanish punctuation, s

[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach

2023-08-18 Thread Carlos
On Fri, Aug 18, 2023 at 06:20:29PM +0200, Mikael Sundqvist wrote:
> Hi,
> 
> It is extremely difficult to follow what you write.
> 
> On Fri, Aug 18, 2023 at 11:43 AM Carlos  wrote:
> >
> > If I have the following, with these linebreaks as in:
> >
> > {\par But a system cannot be successful if it is too strongly
> > influenced by a single person. {\obeylines Once the initial design is
> > complete and fairly robust, the real test begins as people
> > with many different viewpoints undertake their own
> > experiments.}}
> 
> Is that the complete document? What do you have in mind with obeying
> lines in the middle of a paragraph?

it's the only possible way off the top of my head to circumvent body
font size with a given width, while keeping both: the kern of \TeX\
and the double spacing that lmtx injects following a sentence,
within sanity check, hence the nonfrenchspacing

The separation of any of these four components would have hurt T
 E X sig­
nificantly.
 If I had not participated fully in all these activities, literally
hundreds of improvements would never have been made, because I would
never have thought of them or perceived why they were important.
But a system cannot be successful if it is too strongly influenced
by a single person. Once the initial design is


> 
> >
> > and opted to load another font, other than cmr that is, a \frenchspacing
> > approach wouldn't be further required
> 
> cmr? Not used in ConTeXt for a long time. (And what does the changing
> of font have to do with this?)

latin modern.
> 
> >
> > Bear with me here, in the current state, for example, and as long as say
> >
> > «…person.␣{\obeylines Once the initial is
> > complete…» though feasible enough, leaves any prior \␣ at the mercy of
> > whatever fontsize and/or set width happens to be. And this is just plain
> > wrong.
> 
> What?
> 
> >
> > Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation
> > of any of these four components would have hurt \TeX\ significantly. }
> 
> Likewise what?
> 
> >
> > The next sentence: «If I had not participated…» does not get any
> > \nofrenchspacing which is equally and doubly problematic. It shows lack of
> > consistency. And this ought not to be an ‹either› ‹or› scenario. But
> > rather, an and conjunctional construct. It fails both ways.
> 
> Consistency of what? Spacing? Where? Can you make a complete example?
> (You can show space amount with \showmakup[space])

yes. and showmakeup displays: .SP:10.945 If

rather than for example with: .SP:5.235
 OnceSP:3.926
 theSP:3.926
 initial SP:3.926
 designSP:3.926
 is 

and 

:3.586
 THK:-1.853
 H__E
 X
 HK:-1.390
 SP:3.586
 sig­RH:0.000
 IR:0.000
 RS:0.000
LH:0.000
 H__nificantlyLS:0.000BS:6.565


and here's your example:

\setuplayout[width=16cm]
\showmakeup

\starttext

Thus, I came to the conclusion that the designer of a new
system must not only be the implementer and first
large||scale user; the designer should also write the first
user manual.
\setupbodyfont[12.895pt]

{\ss The separation of any of these four components would have
hurt \TeX\ significantly. If I had not participated fully in
all these activities, literally hundreds of improvements
would never have been made, because I would never have
thought of them or perceived why they were important.\par}

Do you see that width of 16cm? That's what throws it off

but then again, anything less than that 12.895 font size, throws off the
 kern of \TeX\ too. 

As a result, I can't use any lower font size, before everything,
including kerning of \TeX\ and spaces after sentences, are completely
off.

I mean. obeylines serve a better function than having extra spaces all
over with no end in sight, really. 
> 
> >
> > Furthermore, with the same token, if width is specified with a
> >
> > \setuplayout[width=15cm]
> 
> OK, here the game changes...
> 
> >
> > Anything less than 12.895pt, especifically for that use case, wwould
> > throw anything, particularly control sequences such as \TeX\ out
> > of whack, and conversely, once a value of that very pt or pica or
> > whatever is lowered, it brings that nonfrenchspacing right back on.
> > And if width increments occur, then it follows that any control sequence 
> > kerning
> > also gets thrown off as a result.
> 
> Of course the width influences the spacing. That is how the paragraph
> builder works (and really, why it often looks good).
> 
> >
> > It seems so far, that with lmtx, any standalone file, document, minimal
> > working example that does not load cmr at the outset does not produce
> > an acceptable outcome either. By saying acceptable I meant to say it
> > 

[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach

2023-08-18 Thread Mikael Sundqvist
Hi,

It is extremely difficult to follow what you write.

On Fri, Aug 18, 2023 at 11:43 AM Carlos  wrote:
>
> If I have the following, with these linebreaks as in:
>
> {\par But a system cannot be successful if it is too strongly
> influenced by a single person. {\obeylines Once the initial design is
> complete and fairly robust, the real test begins as people
> with many different viewpoints undertake their own
> experiments.}}

Is that the complete document? What do you have in mind with obeying
lines in the middle of a paragraph?

>
> and opted to load another font, other than cmr that is, a \frenchspacing
> approach wouldn't be further required

cmr? Not used in ConTeXt for a long time. (And what does the changing
of font have to do with this?)

>
> Bear with me here, in the current state, for example, and as long as say
>
> «…person.␣{\obeylines Once the initial is
> complete…» though feasible enough, leaves any prior \␣ at the mercy of
> whatever fontsize and/or set width happens to be. And this is just plain
> wrong.

What?

>
> Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation
> of any of these four components would have hurt \TeX\ significantly. }

Likewise what?

>
> The next sentence: «If I had not participated…» does not get any
> \nofrenchspacing which is equally and doubly problematic. It shows lack of
> consistency. And this ought not to be an ‹either› ‹or› scenario. But
> rather, an and conjunctional construct. It fails both ways.

Consistency of what? Spacing? Where? Can you make a complete example?
(You can show space amount with \showmakup[space])

>
> Furthermore, with the same token, if width is specified with a
>
> \setuplayout[width=15cm]

OK, here the game changes...

>
> Anything less than 12.895pt, especifically for that use case, wwould
> throw anything, particularly control sequences such as \TeX\ out
> of whack, and conversely, once a value of that very pt or pica or
> whatever is lowered, it brings that nonfrenchspacing right back on.
> And if width increments occur, then it follows that any control sequence 
> kerning
> also gets thrown off as a result.

Of course the width influences the spacing. That is how the paragraph
builder works (and really, why it often looks good).

>
> It seems so far, that with lmtx, any standalone file, document, minimal
> working example that does not load cmr at the outset does not produce
> an acceptable outcome either. By saying acceptable I meant to say it
> namely from a typographical point of view. Nothing else.

I have no clue of what you talk about here.

>
> from the TeXbook 380-381
>
> «\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired changes 
> to
> \par before invoking \obeylines. (2) The \uncatcodespecials operation changes 
> a
> space to category 12; but the \tt font has the character ‘␣’ in the ⟨space⟩ 
> position, so we
> don’t really want ␣12 . (3) The \obeyspaces macro in Appendix B merely 
> changes the
> ⟨space⟩ character to category 13; active character ␣13 has been defined to be 
> the same
> as \space, a macro that expands to ␣10 . This is usually what is desired; for 
> example,
> it means that spaces in constructions like ‘\hbox to 10 pt {...}’ won’t cause 
> any
> trouble. But in our application it has an undesirable effect, because it 
> produces spaces
> that are affected by the space factor. To defeat this feature, it’s necessary 
> either to
> say \frenchspacing or to redefine ␣13 to be the same as \␣. The latter 
> alternative is
> better, because the former will discard spaces at the beginning of each
> line.»
>
> «In theory, this seems like it ought to work; but in practice, it fails in 
> two ways. One
> rather obvious failure—at least, it becomes obvious when the macro is 
> tested—is that
> all the empty lines of the file are omitted. The reason is that the \par 
> command at the
> end of an empty line doesn’t start up a new paragraph, because it occurs in 
> vertical
> mode. The other failure is not as obvious, because it occurs much less often: 
> The \tt
> fonts contain ligatures for Spanish punctuation, so the sequences ?‘ and !‘ 
> will be
> printed as ¿ and ¡ respectively. Both of these defects can be cured by 
> inserting
>
> and
>
>
> «When INITEX creates a brand new TEX, all characters have a space factor code
> of 1000, except that the uppercase letters ‘A’ through ‘Z’ have code 999. 
> (This
> slight difference is what makes punctuation act differently after an 
> uppercase letter; do
> you see why?) Plain TEX redefines a few of these codes using the \sfcode 
> primitive,
> which is similar to \catcode (see Appendix B); for example, the instructions
> \sfcode‘)=0
>  \

[NTG-context] redefine space to be the same as \␣ similar to knuthian approach

2023-08-18 Thread Carlos
If I have the following, with these linebreaks as in:

{\par But a system cannot be successful if it is too strongly
influenced by a single person. {\obeylines Once the initial design is
complete and fairly robust, the real test begins as people
with many different viewpoints undertake their own
experiments.}}

and opted to load another font, other than cmr that is, a \frenchspacing
approach wouldn't be further required

Bear with me here, in the current state, for example, and as long as say 

«…person.␣{\obeylines Once the initial is
complete…» though feasible enough, leaves any prior \␣ at the mercy of
whatever fontsize and/or set width happens to be. And this is just plain
wrong.

Likewise, if a word sequence such as \TeX\ occurs as in {\ss The separation
of any of these four components would have hurt \TeX\ significantly. }

The next sentence: «If I had not participated…» does not get any 
\nofrenchspacing which is equally and doubly problematic. It shows lack of
consistency. And this ought not to be an ‹either› ‹or› scenario. But
rather, an and conjunctional construct. It fails both ways. 

Furthermore, with the same token, if width is specified with a 

\setuplayout[width=15cm]

Anything less than 12.895pt, especifically for that use case, wwould
throw anything, particularly control sequences such as \TeX\ out
of whack, and conversely, once a value of that very pt or pica or
whatever is lowered, it brings that nonfrenchspacing right back on.
And if width increments occur, then it follows that any control sequence kerning
also gets thrown off as a result.

It seems so far, that with lmtx, any standalone file, document, minimal
working example that does not load cmr at the outset does not produce
an acceptable outcome either. By saying acceptable I meant to say it
namely from a typographical point of view. Nothing else.

from the TeXbook 380-381

«\obeylines doesn’t say ‘\def^^M{\par}’, so we must make any desired changes to
\par before invoking \obeylines. (2) The \uncatcodespecials operation changes a
space to category 12; but the \tt font has the character ‘␣’ in the ⟨space⟩ 
position, so we
don’t really want ␣12 . (3) The \obeyspaces macro in Appendix B merely changes 
the
⟨space⟩ character to category 13; active character ␣13 has been defined to be 
the same
as \space, a macro that expands to ␣10 . This is usually what is desired; for 
example,
it means that spaces in constructions like ‘\hbox to 10 pt {...}’ won’t cause 
any
trouble. But in our application it has an undesirable effect, because it 
produces spaces
that are affected by the space factor. To defeat this feature, it’s necessary 
either to
say \frenchspacing or to redefine ␣13 to be the same as \␣. The latter 
alternative is
better, because the former will discard spaces at the beginning of each
line.»

«In theory, this seems like it ought to work; but in practice, it fails in two 
ways. One
rather obvious failure—at least, it becomes obvious when the macro is tested—is 
that
all the empty lines of the file are omitted. The reason is that the \par 
command at the
end of an empty line doesn’t start up a new paragraph, because it occurs in 
vertical
mode. The other failure is not as obvious, because it occurs much less often: 
The \tt
fonts contain ligatures for Spanish punctuation, so the sequences ?‘ and !‘ 
will be
printed as ¿ and ¡ respectively. Both of these defects can be cured by inserting

and 


«When INITEX creates a brand new TEX, all characters have a space factor code
of 1000, except that the uppercase letters ‘A’ through ‘Z’ have code 999. (This
slight difference is what makes punctuation act differently after an uppercase 
letter; do
you see why?) Plain TEX redefines a few of these codes using the \sfcode 
primitive,
which is similar to \catcode (see Appendix B); for example, the instructions
\sfcode‘)=0
 \sfcode‘.=3000
make right parentheses “transparent” to the space factor, while tripling the 
stretcha-
bility after periods. The \frenchspacing operation resets \sfcode‘. to
1000.»


-- 
If at first you don't succeed, you must be a programmer.

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

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

[NTG-context] Re: Tracker for hyphens at the end of lines

2023-08-09 Thread Hans Hagen via ntg-context

On 8/9/2023 12:10 PM, denis.ma...@unibe.ch wrote:

Keith, you can also check hyphenations using a script:

-- check-hyphens.lua
--[[
 analyze hyphenations based on a ConTeXt log file
 enable hyphenation tracking in the ConTeXt file with
 \enabletrackers[hyphenation.applied]
 then run this script with
 lua check-hyphens.lua input_file whitelist.ending
 for the input_file we assume .log, so no need to add this
 for the whitelist a file ending has to be supplied
 the whitelist is optional
]]

-- local lines = string.splitlines(io.loaddata("oeps.tex")or "") or { }

-- local pprint = require('pprint')

function main (input_file, whitelist_file)
 local lines = lines_from(input_file .. ".log")
 local whitelist = {}
 if whitelist_file == nil then
 whitelist = {}
 else
 whitelist = lines_from(whitelist_file)
 end
 --pprint (lines)
 --pprint (whitelist)
 local filteredWordlist = filterHyphenationsWordlist
 (cleanLines
 (getHyphenationLines(lines)),
 whitelist)
 -- pprint(filteredWordlist)
 saveResultsToFile(filteredWordlist, 'check-hyphens.log')
end

-- see if the file exists

-- http://lua-users.org/wiki/FileInputOutput

-- see if the file exists
function file_exists(file)
 local f = io.open(file, "rb")
 if f then f:close() end
 return f ~= nil
end
   
-- get all lines from a file, returns an empty

-- list/table if the file does not exist
function lines_from(file)
 if not file_exists(file) then return {} end
 local lines = {}
 for line in io.lines(file) do
 lines[#lines + 1] = line
 end
 return lines
end

-- String testing
function starts_with(str, start)
 return str:sub(1, #start) == start
end

-- get relevant lines
function getHyphenationLines(lines)
 local lines_with_hyphenations = {}
 for k,v in pairs(lines) do
 if
 (starts_with(v, "hyphenated")
 and not string.find(v, "start hyphenated words")
 and not string.find(v, "stop hyphenated words"))
 then table.insert(lines_with_hyphenations, v) end
 end
 return lines_with_hyphenations
end

-- String cleaning
-- wrapper functions

function cleanLines (xs)
 local cleanedLines = {}
 for k,v in pairs(xs) do
 table.insert(cleanedLines, cleanLine(v))
 end
 return cleanedLines
end

function cleanLine (x)
 return removeTrailingPunctuation(getWord(x))
end

-- 1. Start reading at colon
function getWord(x)
 -- wir lesen aber Zeichen 26
 return string.sub(x,26)
end

-- 2. Remove trailing punctuation
function removeTrailingPunctuation (x)
 if string.find(x, ',') then
 return x:sub(1, -2)
 else
 return x
 end
end

-- test if word is in second list
function inList (x, list)
 for k,v in ipairs(list) do
 if v == x then
 return true
 end
 end
 return nil
end

-- Filter hyphenated words based on second list (whitelist)
function filterHyphenationsWordlist (xs, list)
 local result = {}
 for k,v in ipairs(xs) do
 if not inList(v, list) then table.insert (result, v) end
 end
 return result
end

function saveResultsToFile(results, output_file)
 -- Opens a file in write mode
 output_file = io.open("check_hyphens.log", "w")
 -- sets the default output file as output_file
 io.output(output_file)
 -- iterate oiver
 for k,v in ipairs(results) do
 io.write(v..'\n')
 end
 -- closes the open file
 io.close(output_file)
end

-- Run
main(arg[1], arg[2])

Ok, a little lua lesson, if you don't mind.

 xxx.tex 

\enabletrackers[hyphenation.applied]

\starttext
\input tufte
\stoptext

 xxx.tmp 

re-fine

 xxx.lua 

local function check(logname,whitename)
if not logname then
return
end
local data = io.loaddata(logname) or ""
if data == "" then
return
end
local blob  = string.match(data,"start hyphenated words(.-)stop 
hyphenated words")

if not blob then
return
end
local white = table.tohash(string.splitlines(whitename and 
io.loaddata(whitename) or ""))

for n, s in string.gmatch(blob,"(%d+) *: (%S+)") do
if white[s] then
-- were good
else
print(n,s)
end
end
end

check(environment.files[1],environment.files[2])

-- print("TEST 1")
-- check("xxx.log")
-- print("TEST 2")
-- check("xxx.log","xxx.tmp")

---

>mtxrun --script xxx xxx.log
1   dis-tinguish
1   harmo-nize
1   re-fine

>mtxrun --script xxx xxx.log xxx.tmp
1   dis-tinguish
1   harmo-nize

That said, i wonder if we should add the filename, just in case on

[NTG-context] Re: Tracker for hyphens at the end of lines

2023-08-09 Thread denis.maier
Keith, you can also check hyphenations using a script:

-- check-hyphens.lua
--[[ 
analyze hyphenations based on a ConTeXt log file
enable hyphenation tracking in the ConTeXt file with
\enabletrackers[hyphenation.applied]
then run this script with
lua check-hyphens.lua input_file whitelist.ending
for the input_file we assume .log, so no need to add this
for the whitelist a file ending has to be supplied
the whitelist is optional
]] 

-- local lines = string.splitlines(io.loaddata("oeps.tex")or "") or { }

-- local pprint = require('pprint')

function main (input_file, whitelist_file)
local lines = lines_from(input_file .. ".log")
local whitelist = {}
if whitelist_file == nil then
whitelist = {}
else 
whitelist = lines_from(whitelist_file)
end
--pprint (lines)
--pprint (whitelist)
local filteredWordlist = filterHyphenationsWordlist
(cleanLines
(getHyphenationLines(lines)), 
whitelist)
-- pprint(filteredWordlist)
saveResultsToFile(filteredWordlist, 'check-hyphens.log')
end

-- see if the file exists

-- http://lua-users.org/wiki/FileInputOutput

-- see if the file exists
function file_exists(file)
local f = io.open(file, "rb")
if f then f:close() end
return f ~= nil
end
  
-- get all lines from a file, returns an empty 
-- list/table if the file does not exist
function lines_from(file)
if not file_exists(file) then return {} end
local lines = {}
for line in io.lines(file) do 
lines[#lines + 1] = line
end
return lines
end

-- String testing
function starts_with(str, start)
return str:sub(1, #start) == start
end

-- get relevant lines
function getHyphenationLines(lines)
local lines_with_hyphenations = {}
for k,v in pairs(lines) do
if 
(starts_with(v, "hyphenated") 
and not string.find(v, "start hyphenated words") 
and not string.find(v, "stop hyphenated words"))
then table.insert(lines_with_hyphenations, v) end
end
return lines_with_hyphenations
end

-- String cleaning
-- wrapper functions

function cleanLines (xs)
local cleanedLines = {}
for k,v in pairs(xs) do
table.insert(cleanedLines, cleanLine(v))
end
return cleanedLines
end

function cleanLine (x)
return removeTrailingPunctuation(getWord(x))
end

-- 1. Start reading at colon 
function getWord(x)
-- wir lesen aber Zeichen 26
return string.sub(x,26)
end

-- 2. Remove trailing punctuation
function removeTrailingPunctuation (x)
if string.find(x, ',') then
return x:sub(1, -2)
else
return x
end
end

-- test if word is in second list
function inList (x, list)
for k,v in ipairs(list) do
if v == x then
return true
end
end
return nil
end

-- Filter hyphenated words based on second list (whitelist)
function filterHyphenationsWordlist (xs, list)
local result = {}
for k,v in ipairs(xs) do
if not inList(v, list) then table.insert (result, v) end
end
return result
end

function saveResultsToFile(results, output_file)
-- Opens a file in write mode
output_file = io.open("check_hyphens.log", "w")
-- sets the default output file as output_file
io.output(output_file)
-- iterate oiver 
for k,v in ipairs(results) do
io.write(v..'\n')
end
-- closes the open file
io.close(output_file)
end

-- Run
main(arg[1], arg[2])

> -Ursprüngliche Nachricht-
> Von: Keith McKay 
> Gesendet: Dienstag, 1. August 2023 20:22
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] Re: Tracker for hyphens at the end of lines
> 
> Thanks Hans!
> 
> I'm never disappointed, always amazed with ConTeXt!
> 
> This is just what I was looking for.
> 
> Best Wishes
> 
> Keith McKay
> 
> On 01/08/2023 18:10, Hans Hagen via ntg-context wrote:
> > On 8/1/2023 4:54 PM, Keith McKay wrote:
> >> Hi colleagues,
> >>
> >> Is there a tracker for highlighting hyphens at the end of lines
> >> similar the way underfull and overfull boxes can be displayed with a
> >> coloured bar at the end of the offending line?
> >>
> >> I have looked at the wiki page "Reviewing hyphenation" and it has a
> >> solution for mkii from 2009 which, I would think, won't be suitable
> >> for present day ConTeXt. I have tried searching for hyphens using
> >> Skim and Adobe Acrobate viewers but although they find hyphenation in
> >> line they don't recognise hyphens at the edge of lines.
> >>
> >> Any help would be appreciated.
> > I suppose you would be disappointed it there was no tracker ...
&g

[NTG-context] Reinserting a section title followed by (continued) after a page break

2023-07-30 Thread Calvin Ross
I'm trying to use ConTeXt for playwriting, and I think it would be best to use
sections for dialog. However, if a dialog's text is interrupted by a page
break, it is customary to restate the character name followed by (continued) on
the following page:

--- open ---

John
My name is John, and I seek help with my

--- page break ---

John (cont'd)
typesetting needs...

--- end ---

Maybe what I need is instead a mark? Here's a catch though, I will also need
this to work for simultaneous dialog as well. This kind of dialog is
represented by having dialog sections in columns:

--- open ---

Alice  Bob
John, you fool.John, you imbecile.

--- page break ---

Alice (cont'd)
Don't you know that
everyone uses Word
to typeset their plays?

--- end ---

How can I do this kind of thing in ConTeXt? At the moment, I've been looking
into adding a hook to shipout to prepend a section header with the last custom
mark I've set. Even still, I don't know if this would work, or how to go about
achieving this. If columns would be too difficult to implement, I'd be fine
with living without (continued) support in them since they are pretty rare.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] knuth

2023-06-02 Thread Carlos via ntg-context
On Fri, Jun 02, 2023 at 09:58:31AM +0200, Hans Hagen via ntg-context wrote:
> On 6/2/2023 9:27 AM, BPJ wrote:
> 
> > I wonder what Knuth would say about having ChatGPT write computer
> > programs, which I think can be outright dangerous. Either you get shitty
> > code which doesn't work, which is good, or you get shitty code which
> > works which is bad or Really Bad.
> 
> He's pretty clear that he leave that to others and continues with TAOCP.
> 
> wrt you remark: to a large extend these are 'plagiarism' machines so one can
> wonder about more. I suppose it also depends on how original these programs
> are (or become). 


Not original at all. One New Years' resolution ought to be «stop feeding
this whatever created by whoever» 

I've been trying to find a recent (just done a few months ago)
interactive session I had had with ChatGPT but I'm afraid I must have
dd'd the entire drive (just an honest mistake on the wrong drive at
the time while aiming primarily at fixing another drive and there
it went :(

But every interaction with it [chatgpt], was met/replied to with a
digression and paraphrasing on its part. i.e, sorry 'bout that. I
will not make that mistake again. I knew right away it was just
spitting out useless information. Grammatically correct but not
factual. Lacking substance.

I first brought up the invention of the printing press as a starting
point. And I asked it, to write me up an essay with the most interesting
parts

I remember that the point that chatgpt was trying to make, was in that the
printing press challenged the authority of the church. And I remember
I had to go back and forth with it and question that very verb/use of the
word challenging.

If anything seemed clear to me years ago. and also now, by reading
about the printing press and with the publication of the Bible and
later with the Book of Psalms and the first colophon in human hitory
and so forth, is that the invention of the printing press fostered
the establishment of the church. But I can't recall/just don't know
right now if by the time chatgpt had  decided to use ‹challenging›
was implying afterwards or after the establishment of the church, and
the excommunications that followed and so forth. All I know is that
it rewrote it with different paragraphs after I pointed it out. Very
well put nevertheless. But its main argumentative conclusion was the
challenging part rather than cementing/positioning/establishing/ one

Then I thought, heck, let's see if chatgtt is aware of the relatively
recent findings about the printing methods used by Gutenberg and so
forth. But it wasn't very clear on this either. As a matter of fact
it had no clue really about this for example, citing :

https://www.nytimes.com/2001/01/27/arts/has-history-been-too-generous-to-gutenberg.html

«Johann Gutenberg, the 15th-century German craftsman, has long been
believed to be the father of modern typography. But the secretive
inventor may have to share some of the paternity now. A physicist and
a scholar of rare books at Princeton University who jointly used new
technology to examine some of Gutenberg's texts say he may not have
created the seminal process after all, a finding could rewrite the
history of printing.

The two scholars contend that the metal mold method of printing
attributed to Gutenberg was probably invented by someone else about
20 years after Gutenberg printed his Bible. The method, which involves
punching a letter into a copper matrix that is filled with lead alloy
to create hundreds of identical letters, was the principal way of
printing until after World War II.»

«The discovery was announced on Monday by Paul Needham, the librarian
of the Scheide Library, a private library housed at Princeton, and
Blaise Agüera y Arcas, a 25-year-old graduate of Princeton with a
degree in physics, before a standing-room-only audience at New York's
Grolier Club, a club for book collectors founded in 1884.»

the above link was referenced at the following link  originally, which I had 
read before 

https://jikji.utah.edu/
 


> I don't see myself using such software, just like I don't
> use all these software coding tools (ide stuff). When I acn't remember what
> I'm doing, or need constant help popping up I should not code. I'm intrigued
> of course, and see valid applications, but wrt programming I'm just not that
> interested. I bet after a few years people get bored with the artificial
> stuff (painting, music, proze, movies, whatever; just hitting buttons
> doesn't make a creative person I guess), unless of course one wants to be
> zombified.
> 
> Hans
> 
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Has

Re: [NTG-context] ntg-context Digest, Vol 227, Issue 15

2023-05-09 Thread Sebastian Ørsted via ntg-context
This is
> > normally done by loading special math fonts into the math family slots.
> Your font
> > set is lacking at least the parameter mentioned earlier.
> >
> > What parameter is this referring to here?
> >
> > If I were to load sans it finishes off without errors on the math side,
> > but then again, doesn't load sans at all
> >
> > mkiv lua stats  > loaded fonts: 2 files: latinmodern-math.otf,
> minionpro-regular.otf
> >
> > And as you can guess,  the above is not I was looking forward to
>
> in other words, this is wanted
>
> mkiv lua stats  > loaded fonts: 4 files: minionpro-bold.otf,
> minionpro-it.otf, minionpro-regular.otf, myriadpro-regular.otf
>
> but then again,  it's not possible without the preloaded
> latinmodern-math if a math environment is included.
>
> >
> >
> > --
> > Real computer scientists don't comment their code.  The identifiers are
> > so long they can't afford the disk space.
>
>
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> >
> ___
>
>
> --
> `Lasu' Releases SAG 0.3 -- Freeware Book Takes Paves For New World Order
> by staff writers
>
> Helsinki, Finland, August 6, 1995 -- In a surprise movement, Lars
> ``Lasu'' Wirzenius today released the 0.3 edition of the ``Linux System
> Administrators' Guide''.  Already an industry non-classic, the new
> version sports such overwhelming features as an overview of a Linux
> system, a completely new climbing session in a tree, and a list of
> acknowledgements in the introduction.
> The SAG, as the book is affectionately called, is one of the
> corner stones of the Linux Documentation Project.  ``We at the LDP feel
> that we wouldn't be able to produce anything at all, that all our work
> would be futile, if it weren't for the SAG,'' says Matt Welsh, director
> of LDP, Inc.
> The new version is still distributed freely, now even with a
> copyright that allows modification.  ``More dough,'' explains the author.
> Despite insistent rumors about blatant commercialization, the SAG will
> probably remain free.  ``Even more dough,'' promises the author.
> The author refuses to comment on Windows NT and Windows 96
> versions, claiming not to understand what the question is about.
> Industry gossip, however, tells that Bill Gates, co-founder and CEO of
> Microsoft, producer of the Windows series of video games, has visited
> Helsinki several times this year.  Despite of this, Linus Torvalds,
> author of the word processor Linux with which the SAG was written, is
> not worried.  ``We'll have world domination real soon now, anyway,'' he
> explains, ``for 1.4 at the lastest.''
> ...
> -- Lars Wirzenius 
>[comp.os.linux.announce]
>
>
>
> --
>
> Message: 3
> Date: Tue, 9 May 2023 11:02:26 -0400
> From: Carlos 
> To: ntg-context@ntg.nl
> Subject: Re: [NTG-context] This is rmally done by loading special math
> fonts into the math family slots.
> Message-ID:
> 
> Content-Type: text/plain; charset="utf-8"
>
>
> On Tue, May 09, 2023 at 04:46:42PM +0200, Mikael Sundqvist via ntg-context
> wrote:
> > On Tue, May 9, 2023 at 4:20?PM Carlos via ntg-context
> >  wrote:
> > >
> > >
> > >
> > > Hello list
> > >
> > > the whole error message I get is
> > >
> > > tex error   > tex error on line 90 in file
> ./atestinminion-context.mkiv: Math error: parameter 'operatorsize' with id
> 8 in style 0 is not set
> > >
> > >  \m_operator_text
> > > \endgroup \Ustopmathmode
> > >  \m_operator_text
> > > \stopforceddisplaymath
> > > \egroup \ifcase \c_strc_formulas_frame_mode \else
> \strc_math_number_check_offsets \fi \ifcase \c_strc_formulas_frame_mode
> \strc_math_number_check \or \strc_math_number_check_outside \else
> \strc_math_number_check_inside \fi \str
> > >  \m_operator_text
> > > \endgroup \strc_formulas_endstrut \stopinnermath
> > > \afterdisplayspace \egroup
> > >  \m_operator_text
> > > \strc_formulas_pla

Re: [NTG-context] This is rmally done by loading special math fonts into the math family slots.

2023-05-09 Thread Carlos via ntg-context


> 
> tex error   > tex error on line 90 in file ./atestinminion-context.mkiv: 
> Math error: parameter 'operatorsize' with id 8 in style 0 is not set
> 
>  \m_operator_text 
> \endgroup \Ustopmathmode 
>  \m_operator_text 
> \stopforceddisplaymath 
> \egroup \ifcase \c_strc_formulas_frame_mode \else 
> \strc_math_number_check_offsets \fi \ifcase \c_strc_formulas_frame_mode 
> \strc_math_number_check \or \strc_math_number_check_outside \else 
> \strc_math_number_check_inside \fi \str
>  \m_operator_text 
> \endgroup \strc_formulas_endstrut \stopinnermath 
> \afterdisplayspace \egroup 
>  \m_operator_text 
> \strc_formulas_place_number \strc_formulas_flush_number \dostarttagged 
> \t!formulacontent \empty \dotagregisterformula \c_strc_formulas_n \csname 
> \e!stop \formulaparameter \c!alternative \v!formula \endcsname 
> \dostoptagged \dostoptagged \nonoindentati
>  
> \stopformula
> 
> \startformula 
> 
>   \int_{\infty}   
>   
> >>  \stopformula  
> >> 
> 
> Sorry, but I can't typeset math unless various parameters have been set. This 
> is
> normally done by loading special math fonts into the math family slots. Your 
> font
> set is lacking at least the parameter mentioned earlier.
> 
> What parameter is this referring to here? 
> 
> If I were to load sans it finishes off without errors on the math side,
> but then again, doesn't load sans at all
> 
> mkiv lua stats  > loaded fonts: 2 files: latinmodern-math.otf, 
> minionpro-regular.otf
> 
> And as you can guess,  the above is not I was looking forward to 

in other words, this is wanted

mkiv lua stats  > loaded fonts: 4 files: minionpro-bold.otf, minionpro-it.otf, 
minionpro-regular.otf, myriadpro-regular.otf

but then again,  it's not possible without the preloaded
latinmodern-math if a math environment is included. 

> 
> 
> -- 
> Real computer scientists don't comment their code.  The identifiers are
> so long they can't afford the disk space.


> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___


-- 
`Lasu' Releases SAG 0.3 -- Freeware Book Takes Paves For New World Order
by staff writers

Helsinki, Finland, August 6, 1995 -- In a surprise movement, Lars
``Lasu'' Wirzenius today released the 0.3 edition of the ``Linux System
Administrators' Guide''.  Already an industry non-classic, the new
version sports such overwhelming features as an overview of a Linux
system, a completely new climbing session in a tree, and a list of
acknowledgements in the introduction.
The SAG, as the book is affectionately called, is one of the
corner stones of the Linux Documentation Project.  ``We at the LDP feel
that we wouldn't be able to produce anything at all, that all our work
would be futile, if it weren't for the SAG,'' says Matt Welsh, director
of LDP, Inc.
The new version is still distributed freely, now even with a
copyright that allows modification.  ``More dough,'' explains the author.
Despite insistent rumors about blatant commercialization, the SAG will
probably remain free.  ``Even more dough,'' promises the author.
The author refuses to comment on Windows NT and Windows 96
versions, claiming not to understand what the question is about.
Industry gossip, however, tells that Bill Gates, co-founder and CEO of
Microsoft, producer of the Windows series of video games, has visited
Helsinki several times this year.  Despite of this, Linus Torvalds,
author of the word processor Linux with which the SAG was written, is
not worried.  ``We'll have world domination real soon now, anyway,'' he
explains, ``for 1.4 at the lastest.''
...
-- Lars Wirzenius 
   [comp.os.linux.announce]

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

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


Re: [NTG-context] new units

2023-05-07 Thread Alan Braslau via ntg-context
On Sun, 7 May 2023 13:00:18 +0100
Bruce Horrocks via ntg-context  wrote:

> Will there be new units to represent the amount of alcohol that has
> to be imbibed in order to (a) create the joke and (b) understand it?
> 
> I'm not sure which of these needs to be the larger. Perhaps that
> could be the subject of the next research?

The moral of the story is that we all missed something by not attending
BachoTeX - as is the case every year. One should note Hans' reference
to the gala dinner, which is better characterized by an excess of
dishes of food than by an excess of alcohol.

We have an opportunity to make up for this missed occasion this year by
attending the annual ConTeXt meeting. Of course, these two meetings are
complementary and ideally one should aim at attending *both*.

As to the Dutch left and right thumbs, the French word is also "pouce"
for the length of an inchworm. My question is, what is the appropriate
unit for inching forward or inching along? Would this be one inch per
fortnight?

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

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


[NTG-context] help wanted: English native speaker as co-editor

2023-04-16 Thread Henning Hraban Ramm via ntg-context
Hi, as most of you know, I’m the editor of context journal, the annual 
magazine for all members of context group, AKA “proceedings of the 
[previous] ConTeXt meeting”.


While I have some experience as an editor in German, my English is far 
from perfect, so I need to rely on a native speaker for proofreading.


In the least years, Clyde was filling that role very diligently, but he 
just moved and can’t make the time again.


Deadline for the current issue is only in August, but we’re already at 
~100 pages with the articles I got (by Willi, Willi, Willi, Taco, Taco, 
Götz, and me) and I’d like to spread the work a bit.


* Would you like to help with that? *

– You don’t need to understand the code.
– I want the text to be correct and understandable, we don’t need to 
reach literary quality.

– You can work in PDF or in the sources, as you like.
– More than one person is welcome.


BTW I never thought of offering “our” articles to TUG and NTG, while I 
sometimes got articles that were published in TUGboat or MAPS first. 
(And I’m writing/translating for DANTE’s DTK regularly.) I’ll start to 
do that, since “recycling” makes sense, and it also can’t hurt to spread 
the word.



This is also a reminder to hand in your talks from Dreifelden – or new 
articles!



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

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


Re: [NTG-context] /usr/bin/env texlua no such file or directory; ~/context/tex is not a valid TEXROOT path; no file plain.tex

2023-04-11 Thread Carlos via ntg-context
__
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___
> 

-- 
"We invented a new protocol and called it Kermit, after Kermit the Frog,
star of "The Muppet Show." [3]

[3]  Why?  Mostly because there was a Muppets calendar on the wall when we
were trying to think of a name, and Kermit is a pleasant, unassuming sort of
character.  But since we weren't sure whether it was OK to name our protocol
after this popular television and movie star, we pretended that KERMIT was an
acronym; unfortunately, we could never find a good set of words to go with the
letters, as readers of some of our early source code can attest.  Later, while
looking through a name book for his forthcoming baby, Bill Catchings noticed
that "Kermit" was a Celtic word for "free", which is what all Kermit programs
should be, and words to this effect replaced the strained acronyms in our
source code (Bill's baby turned out to be a girl, so he had to name her Becky
instead).  When BYTE Magazine was preparing our 1984 Kermit article for
publication, they suggested we contact Henson Associates Inc. for permission
to say that we did indeed name the protocol after Kermit the Frog.  Permission
was kindly granted, and now the real story can be told.  I resisted the
temptation, however, to call the present work "Kermit the Book."
-- Frank da Cruz, "Kermit - A File Transfer Protocol"

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

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


Re: [NTG-context] Printing problem

2023-03-16 Thread lynx--- via ntg-context
I was able to print Mikael's PDF without any problem. 

I used a HP Laser Jet Pro MFP M276WBUT I should note that I also
used the PostScript driver available from HP's Linux-specific web pages:


https://developers.hp.com/hp-linux-imaging-and-printing/ 

Michael 

On 2023-03-16 04:49, Mikael Sundqvist via ntg-context wrote:

> Hi all,
> 
> I have had some printing problems lately, and it is not perfectly
> clear to me (or to Hans, we have discussed this a bit) whether it is
> the printer that has a lack of memory or if the pdf files are somehow
> corrupted. It might have to do with type3 fonts.
> 
> I attach a pdf file that does not print on our printer at work. Or
> well, it prints almost all of the page, but stops at the word
> "negativa" (or was it "egenvärden", I do not have the printout here
> right now). Then the printer also prints an error report about some
> "offending command".
> 
> So, a request: If you have an easy access to a printer, can you print
> this page and report back if all of it comes out, or what is
> happening?
> 
> Thanks
> 
> /Mikael 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

dugga.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Printing problem

2023-03-16 Thread Henning Hraban Ramm via ntg-context

Kyocera FS-C5100DN,
* Apple Preview: ok
* Adobe Acrobat Pro 9: doesn’t print, no error
* Adobe Acrobat Reader DC: PostScript Error (after "poäng")
* Qoppa PDF Studio 2019: ok
* Skim: ok
* Firefox (pdf.js): ok (prints as lowres image, as usual)
* Foxit PDF Reader 11: ok

Looks like it might be a problem with Adobe’s PS/PDF library.

Hraban

Am 16.03.23 um 12:49 schrieb Mikael Sundqvist via ntg-context:

Hi all,

I have had some printing problems lately, and it is not perfectly
clear to me (or to Hans, we have discussed this a bit) whether it is
the printer that has a lack of memory or if the pdf files are somehow
corrupted. It might have to do with type3 fonts.

I attach a pdf file that does not print on our printer at work. Or
well, it prints almost all of the page, but stops at the word
"negativa" (or was it "egenvärden", I do not have the printout here
right now). Then the printer also prints an error report about some
"offending command".

So, a request: If you have an easy access to a printer, can you print
this page and report back if all of it comes out, or what is
happening?

Thanks

/Mikael


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

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


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

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


Re: [NTG-context] Printing problem

2023-03-16 Thread Keith McKay via ntg-context
Sent from my phone to a HP Color LaserJet MFP M283 printer. Perfect print.
Keith McKay

On Thu, 16 Mar 2023, 11:51 Mikael Sundqvist via ntg-context, <
ntg-context@ntg.nl> wrote:

> Hi all,
>
> I have had some printing problems lately, and it is not perfectly
> clear to me (or to Hans, we have discussed this a bit) whether it is
> the printer that has a lack of memory or if the pdf files are somehow
> corrupted. It might have to do with type3 fonts.
>
> I attach a pdf file that does not print on our printer at work. Or
> well, it prints almost all of the page, but stops at the word
> "negativa" (or was it "egenvärden", I do not have the printout here
> right now). Then the printer also prints an error report about some
> "offending command".
>
> So, a request: If you have an easy access to a printer, can you print
> this page and report back if all of it comes out, or what is
> happening?
>
> Thanks
>
> /Mikael
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Printing problem

2023-03-16 Thread Willi Egger via ntg-context
Hello Mikael,

As asked, I printed the page on a HP Officejet Pro 7740 as well in draft- as in 
high-quality mode.
The print-out looks ok in both cases, there is all text and no errors.

Kind regards

Willi

> On 16 Mar 2023, at 12:49, Mikael Sundqvist via ntg-context 
>  wrote:
> 
> Hi all,
> 
> I have had some printing problems lately, and it is not perfectly
> clear to me (or to Hans, we have discussed this a bit) whether it is
> the printer that has a lack of memory or if the pdf files are somehow
> corrupted. It might have to do with type3 fonts.
> 
> I attach a pdf file that does not print on our printer at work. Or
> well, it prints almost all of the page, but stops at the word
> "negativa" (or was it "egenvärden", I do not have the printout here
> right now). Then the printer also prints an error report about some
> "offending command".
> 
> So, a request: If you have an easy access to a printer, can you print
> this page and report back if all of it comes out, or what is
> happening?
> 
> Thanks
> 
> /Mikael
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

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

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


Re: [NTG-context] Printing problem

2023-03-16 Thread Martin C. Moncrieffe via ntg-context
Prints fine on a LaserJet Pro M501 from Preview.app.

__martin



On 16 Mar 2023, at 11:49, Mikael Sundqvist via ntg-context  
wrote:

Hi all,

I have had some printing problems lately, and it is not perfectly
clear to me (or to Hans, we have discussed this a bit) whether it is
the printer that has a lack of memory or if the pdf files are somehow
corrupted. It might have to do with type3 fonts.

I attach a pdf file that does not print on our printer at work. Or
well, it prints almost all of the page, but stops at the word
"negativa" (or was it "egenvärden", I do not have the printout here
right now). Then the printer also prints an error report about some
"offending command".

So, a request: If you have an easy access to a printer, can you print
this page and report back if all of it comes out, or what is
happening?

Thanks

/Mikael

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

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


[NTG-context] Printing problem

2023-03-16 Thread Mikael Sundqvist via ntg-context
Hi all,

I have had some printing problems lately, and it is not perfectly
clear to me (or to Hans, we have discussed this a bit) whether it is
the printer that has a lack of memory or if the pdf files are somehow
corrupted. It might have to do with type3 fonts.

I attach a pdf file that does not print on our printer at work. Or
well, it prints almost all of the page, but stops at the word
"negativa" (or was it "egenvärden", I do not have the printout here
right now). Then the printer also prints an error report about some
"offending command".

So, a request: If you have an easy access to a printer, can you print
this page and report back if all of it comes out, or what is
happening?

Thanks

/Mikael


dugga.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] issue with custom hyphenator

2023-02-10 Thread Pablo Rodriguez via ntg-context
Dear list,

I have just copied this from
https://www.pragma-ade.com/general/manuals/languages-mkiv.pdf#page=23:

  \startluacode
  local subset = {
  a = true,
  e = true,
  i = true,
  o = true,
  u = true,
  y = true,
  }

  languages.hyphenators.traditional.installmethod("test",
  function(dictionary,word,n)
  local t = { }
  for i=1,#word do
  local w = word[i]
  if subset[w] then
  t[i] = {
  before = "<" .. w,
  after  = w .. ">",
  left   = false,
  right  = false,
  }
  else
  t[i] = false
  end
  end
  return t
  end
  )
  \stopluacode

  \definehyphenationfeatures
[demo]
[alternative=test]
  \setuphyphenation[method=traditional]

  \starttext
  %\righthyphenmin=-1
  \sethyphenationfeatures[demo]
  \hsize\zeropoint
  coming anaback
  \stoptext

Using current latest (from 2023.02.07 19:06), I get:

  cing
  anack

I’m missing m and b in the hyphenated words.

I’m afraid that the hyphenator is all Greek to me.

Is there any reason why letters are lost in hyphenation?

I’m afraid (I think) I might have hit a bug.

Many thanks for your help,

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

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


Re: [NTG-context] Bug in verbatim wrapping examples on wiki

2023-02-05 Thread Pablo Rodriguez via ntg-context
On 2/5/23 13:13, Hans Hagen via ntg-context wrote:
> On 2/5/2023 12:32 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> Are we missing something or is this a bug?
> what do you expect as result? (maybe try \righthyphenmin=1)

Line breaks are removing characters.

In the sample below, output from

  \hsize\zeropoint
  \sha{a1b2c3d4}

reads:

  a
 _
 _
 _
 _
  3d4

I’m afraid \righthyphenmin=-1 prevents hyphenation (it seems to do it
everywhere).

Sorry, but I don’t get what is wrong here.

Many thanks for your help,

Pablo


  \startluacode
  function document.addfunnyhyphen(tfmdata)
  local underscore = utf.byte("_")
  local char   = tfmdata.characters[underscore]
  if not char then return end
  tfmdata.characters[0xFE000]   = {
  width= 0,
  height   = 0,
  depth= 0,
  commands = {
  { "right", -char.width },
  { "down", char.depth },
  { "slot", 1, underscore },
  }
  }
  end


  utilities.sequencers.appendaction("aftercopyingcharacters",
  "after","document.addfunnyhyphen")

  local shared = {
  start  = 1,
  length = 1,
  before = utf.char(0xFE000),
  after  = nil,
  left   = false,
  right  = false,
  }

  local all = table.setmetatableindex({ }, function(t,k)
  return shared
  end)

  languages.hyphenators.traditional.installmethod("sha",
  function(dictionary,word,n)
  return all
  end
  )
  \stopluacode

  \definehyphenationfeatures
   [sha]
   [characters=all,
alternative=sha,
righthyphenchar="FE000]

  \unexpanded\def\sha#1%
   {\begingroup\tt
\righthyphenmin=-1
\sethyphenationfeatures[sha]%
\setuphyphenation[method=traditional]%
#1%
\endgroup}

  \starttext
  \startTEXpage[width=6em, offset=.25em]
  \hsize\zeropoint
  \sha{a1b2c3d4}

  extraordinary linguistics

  \righthyphenmin=-1
  extraordinary linguistics
  \stopTEXpage
  \stoptext

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

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


Re: [NTG-context] Bug in verbatim wrapping examples on wiki

2023-02-05 Thread Hans Hagen via ntg-context

On 2/5/2023 12:32 PM, Pablo Rodriguez via ntg-context wrote:

On 2/4/23 10:37, Pablo Rodriguez via ntg-context wrote:

On 2/4/23 07:49, Hugo Landau via ntg-context wrote:

On this page of the wiki there is an example for wrapping long words,
like long hexadecimal strings:

https://wiki.contextgarden.net/Wrapping

This example is buggy because it deletes one character at the point that
it is wrapped.

Anyone have a solution?


Many thanks for your report, Hugo.

I use this code from time to time and I totally overlooked this.

Have you checked all options that the sample contains?


Hans,

I have just checked that these line breakings loose a character in all
options.

The next sample displays the issue clearly:


   \startluacode

 --local shared = {
 --start  = 1,
 --length = 1,
 --left   = false,
 --right  = false,
 --}

local shared = {
start  = 1,
length = 1,
before = utf.char(0xB7),
after  = nil,
left   = false,
right  = false,
}

-- languages.hyphenators.traditional.installmethod("sha",
-- function(dictionary,word,n)
-- local t = { }
-- for i=1,#word do
-- t[i] = shared
-- end
-- return t
-- end
-- )

-- or more efficient when used often:

-- local all = { }
-- for i=1,512 do
-- all[i] = shared
-- end
-- languages.hyphenators.traditional.installmethod("sha",
-- function(dictionary,word,n)
-- return all
-- end
-- )

-- or more obscure:

-- local all = table.setmetatableindex({ }, function(t,k)
-- t[k] = shared
-- return shared
-- end)
--
-- languages.hyphenators.traditional.installmethod("sha",
    -- function(dictionary,word,n)
-- return all
-- end
-- )

-- or just (lua is fast enough anyway)

local all = table.setmetatableindex({ }, function(t,k)
return shared
end)

languages.hyphenators.traditional.installmethod("sha",
function(dictionary,word,n)
return all
end
)
   \stopluacode

   \definehyphenationfeatures
  [sha]
  [characters=all,
   alternative=sha]

\unexpanded\def\sha#1%
  {\begingroup
   \sethyphenationfeatures[sha]%
   #1%
   \endgroup}

\setuphyphenation[method=traditional]
%
%  \unexpanded\def\sha#1%
% {\begingroup
%  \sethyphenationfeatures[sha]%
%  \setuphyphenation[method=traditional]%
%  #1%
%  \endgroup}

   \starttext
   \hyphenatedword{\sha{8b2f3c087046c3943ace0dc4f958ef2138e58a51b40e%
   ef6fab6fa1aeb845cc257a410ab1b914bc399b4293f%
   31c76fc2c73e5be5ea4d329f9e6820984688efec2}}
   \stoptext

Are we missing something or is this a bug?

what do you expect as result? (maybe try \righthyphenmin=1)


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

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

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


Re: [NTG-context] Bug in verbatim wrapping examples on wiki

2023-02-05 Thread Pablo Rodriguez via ntg-context
On 2/4/23 10:37, Pablo Rodriguez via ntg-context wrote:
> On 2/4/23 07:49, Hugo Landau via ntg-context wrote:
>> On this page of the wiki there is an example for wrapping long words,
>> like long hexadecimal strings:
>>
>> https://wiki.contextgarden.net/Wrapping
>>
>> This example is buggy because it deletes one character at the point that
>> it is wrapped.
>>
>> Anyone have a solution?
> 
> Many thanks for your report, Hugo.
> 
> I use this code from time to time and I totally overlooked this.
> 
> Have you checked all options that the sample contains?

Hans,

I have just checked that these line breakings loose a character in all
options.

The next sample displays the issue clearly:


  \startluacode

--local shared = {
--start  = 1,
--length = 1,
--left   = false,
--right  = false,
--}

   local shared = {
   start  = 1,
   length = 1,
   before = utf.char(0xB7),
   after  = nil,
   left   = false,
   right  = false,
   }

   -- languages.hyphenators.traditional.installmethod("sha",
   -- function(dictionary,word,n)
   -- local t = { }
   -- for i=1,#word do
   -- t[i] = shared
   -- end
   -- return t
   -- end
   -- )

   -- or more efficient when used often:

   -- local all = { }
   -- for i=1,512 do
   -- all[i] = shared
   -- end
   -- languages.hyphenators.traditional.installmethod("sha",
   -- function(dictionary,word,n)
   -- return all
   -- end
   -- )

   -- or more obscure:

   -- local all = table.setmetatableindex({ }, function(t,k)
   -- t[k] = shared
   -- return shared
   -- end)
   --
   -- languages.hyphenators.traditional.installmethod("sha",
   -- function(dictionary,word,n)
   -- return all
   -- end
   -- )

   -- or just (lua is fast enough anyway)

   local all = table.setmetatableindex({ }, function(t,k)
   return shared
   end)

   languages.hyphenators.traditional.installmethod("sha",
   function(dictionary,word,n)
   return all
   end
   )
  \stopluacode

  \definehyphenationfeatures
 [sha]
 [characters=all,
  alternative=sha]

   \unexpanded\def\sha#1%
 {\begingroup
  \sethyphenationfeatures[sha]%
  #1%
  \endgroup}

   \setuphyphenation[method=traditional]
%
%  \unexpanded\def\sha#1%
% {\begingroup
%  \sethyphenationfeatures[sha]%
%  \setuphyphenation[method=traditional]%
%  #1%
%  \endgroup}

  \starttext
  \hyphenatedword{\sha{8b2f3c087046c3943ace0dc4f958ef2138e58a51b40e%
  ef6fab6fa1aeb845cc257a410ab1b914bc399b4293f%
  31c76fc2c73e5be5ea4d329f9e6820984688efec2}}
  \stoptext

Are we missing something or is this a bug?

Many thanks for your help,

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

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


[NTG-context] Is the Society of Biblical Literature (SBL) style files for ConTeXt incompatible with \setupinteraction[state=start]?

2023-01-15 Thread Joel via ntg-context
When I am using the SBL ConTeXt files for citations, if I add a line 
`\setupinteraction[state=start` my code starts complaining:
Undefined control sequence \currentbtxloctext 

 \16>:btx:sbl:cite:inline 
    #1->\fastsetup {\s!btx :\s!cite :concat}\fastsetup 
{btx:sbl:cite:lefttext}\begingroup \letbtxparameter {punct}\empty \def 
\currentbtxcitealternative {inline}\def \currentbtxcategory {\btxfield 
{category}}\def \currentbtxloctext 
    {\btxparameter {loctex
 \normalexpanded 
    \Word {\fastsetup {btx:sbl:cite:inline}
    }\doif {\btxparameter {righttext}}{\empty } {\btxperiod }
 \strc_constructions_register_yes 

...
Is this package incompatible with interaction?
--Joel
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] TUG 2023

2023-01-04 Thread Joseph Wright via ntg-context

On 04/01/2023 16:50, Thomas A. Schmitz via ntg-context wrote:

Hi everybody,

an excellent year 2023 to all of you - I hesitate to say "it can only 
get better from 2022." That's what we thought last year, and boy were we 
wrong and did it get worse... Let's hope that this year will be more 
peaceful and less pandemic...


But to my topic: the official announcement for TUG 2023 is out. It will 
be in Bonn, Germany, in a building literally (literally!) just across 
the street from my university office. So I feel somewhat motivated to go 
and give a talk on ConTeXt and spread the word. Since I'm a simple user 
and no developer, I'm a bit hesitant though: is any of the developers 
going (Hans?)? Since the public will be 99 % LaTeX-centric


I think you need not be afraid there: there will be a decent amount of 
generic stuff and a good number of plain TeX experts, I suspect. Yes, 
LaTeX tends to be the most popular TeX flavour in the talks, but I think 
overall it's much more varied than you are imagining!


Joseph

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

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


[NTG-context] TUG 2023

2023-01-04 Thread Thomas A. Schmitz via ntg-context

Hi everybody,

an excellent year 2023 to all of you - I hesitate to say "it can only 
get better from 2022." That's what we thought last year, and boy were we 
wrong and did it get worse... Let's hope that this year will be more 
peaceful and less pandemic...


But to my topic: the official announcement for TUG 2023 is out. It will 
be in Bonn, Germany, in a building literally (literally!) just across 
the street from my university office. So I feel somewhat motivated to go 
and give a talk on ConTeXt and spread the word. Since I'm a simple user 
and no developer, I'm a bit hesitant though: is any of the developers 
going (Hans?)? Since the public will be 99 % LaTeX-centric: I had the 
idea of showing (off) how ConTeXt can typeset xml and produce different 
outputs from the same source (similar to what I've done in Bassenge in 
2019). Those of you who have been to TUG conferences before: would that 
be of interest even to people who know little to nothing about ConTeXt 
yet are familiar with other forms of TeX? I guess I just what to get a 
feeling what to expect at a TUG conference.


All best wishes

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

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


Re: [NTG-context] Ajami script

2023-01-01 Thread George N. White III via ntg-context
On Sun, Jan 1, 2023 at 2:14 PM BPJ via ntg-context 
wrote:

It's a bit confusing because the word ʿajamī simply means anything written
> in a non-Arabic language with Arabic script. Africa is certainly not the
> only place where that term has been used. It is also the case that Arabic
> script has been used to write West African languages for very many
> centuries. There is no way that guy can have grown up there and not know
> that so I don't understand what this article is up to. Possibly this is a
> separate adaptation using its own conventions for writing the local
> language. Probably just pop-sci sensationalism coupled with some rather
> severe mis-/non-understanding on the part of the article author.
>

I grew up in Northern New Mexico and now live in Canada, so know that
"educational" efforts
which suppressed non-European languages and writing systems were too often
imposed on
indigenous peoples in N. America.  It would not surprise me to learn that
some West African kids
were never exposed to "anything written in a non-Arabic language with
Arabic script".

-- 
George N. White III
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Ajami script

2023-01-01 Thread BPJ via ntg-context
It's a bit confusing because the word ʿajamī simply means anything written
in a non-Arabic language with Arabic script. Africa is certainly not the
only place where that term has been used. It is also the case that Arabic
script has been used to write West African languages for very many
centuries. There is no way that guy can have grown up there and not know
that so I don't understand what this article is up to. Possibly this is a
separate adaptation using its own conventions for writing the local
language. Probably just pop-sci sensationalism coupled with some rather
severe mis-/non-understanding on the part of the article author.

Den sön 1 jan. 2023 14:30Alain Delmotte via ntg-context 
skrev:

> Le 1/01/2023 à 11:03, Henning Hraban Ramm via ntg-context a
> écrit :
> > Am 01.01.23 um 10:21 schrieb Hans Hagen via ntg-context:
> >> On 12/31/2022 3:06 PM, Henning Hraban Ramm via
> >> ntg-context wrote:
> >>> I just read this:
> >>>
> https://www.bu.edu/articles/2022/fallou-ngom-discovers-ajami-african-writing-system/
> >>>
> >>>
> >>> And now I’d like to know if ConTeXt is capable of
> >>> typesetting this variant of Arabic. (Just out of
> >>> curiosity, I can’t read any Arabic and don’t know any
> >>> African language.)
> >> Afaiks that script has been known fro a while:
> >
> > I also thought I heard about it several years ago. The
> > article makes it sound like news, that might be the
> > perspective of the US scholars or a necessary means to get
> > funded. But the oldest sources quoted in Wikipedia are
> > from 1971 and 1982.
>
> The arabic alphabet was also used from the XIth century to
> write swahili and some bantu languages around Tanzania and
> Kenya (Mozambic, Malawi, Uganda, east of Kongo, Sudan).
>
> There are articles in Wikipedia.
>
> https://fr.wikipedia.org/wiki/Alphabet_arabe_swahili
> https://en.wikipedia.org/wiki/Swahili_language#Orthography
>
> also: https://www.mustgo.com/worldlanguages/swahili/  see
> "writing"
> https://omniglot.com/writing/swahili.htm
>
> >> https://en.wikipedia.org/wiki/Ajami_script
> >> so when there are proper fonts, as:
> >> https://software.sil.org/scheherazade/
> >> https://software.sil.org/harmattan/
> >
> > I don’t dare to ask about the Husayni fonts... ;)
> >
> >> it should be doable. The script is supported by unicode.
> >> I get the impression that the arabic scipt is mostly used
> >> getting the way the languages sounds on paper so vowels
> >> matter. There is mentioning of transliteration and so
> >> that might need some specific support. Nothing tex
> >> (context) can't do but only users and usage can prove that.
> >
> > Thank you for your insights!
> > Of course it’s a matter of use(r)s.
> >
> > All the best for a happy new year!
> > Hraban
> >
> >
> ___
>
> >
> > If your question is of interest to others as well, please
> > add an entry to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : https://www.pragma-ade.nl /
> > http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> >
> ___
>
> >
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] extra hyphen in underscore hyphenation

2022-12-08 Thread Pablo Rodriguez via ntg-context
On 12/8/22 13:14, Hans Hagen via ntg-context wrote:
> On 12/8/2022 12:33 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> What am I missing here?
> 
> \setuplanguage
>   [explicitrighthyphenchar=-1]

Many thanks for your fast reply, Hans.

I’m afraid it doesn’t work here:

  \startluacode
  function document.addfunnyhyphen(tfmdata)
  local underscore = utf.byte("_")
  local char   = tfmdata.characters[underscore]
  if not char then return end
  tfmdata.characters[0xFE000]   = {
  width= 0,
  height   = 0,
  depth= 0,
  commands = {
  { "right", -char.width },
  { "down", char.depth },
  { "slot", 1, underscore },
  }
  }
  end

  utilities.sequencers.appendaction("aftercopyingcharacters",
  "after","document.addfunnyhyphen")
  \stopluacode

  \definehyphenationfeatures
 [underscore]
 [righthyphenchar="FE000]

  \setuphyphenation[method=traditional]%
  \sethyphenationfeatures[underscore]%
  \setuplanguage
[explicitrighthyphenchar=-1]
  \mainlanguage[es]
  \starttext
  \startTEXpage[offset=1em, width=4em]
\hsize\zeropoint\tt
\hyphenatedword{legibility-legible}
  \stopTEXpage
  \stoptext

Results are the same with "\mainlanguage[es]" or "\mainlanguage[nl]".

If "\mainlanguage" is placed after "\setuplanguage", the extra unwanted
hyphen appears.

If "\mainlanguage" is placed before "\setuplanguage", hyphenation for
the second word doesn’t work at all (and the extra unwanted hyphen
appears in my actual document).

I don’t know what I’m missing here and it seems to be a picky issue to
provide a MWE.

Many thanks for your help,

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

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


Re: [NTG-context] Why are my captions overlapping next text in combinations?

2022-11-26 Thread Wolfgang Schuster via ntg-context

Joel via ntg-context schrieb am 25.11.2022 um 23:25:

I have some combinations used throughout my document like this:

\starttext
\startcombination[4*2]
            {%
 \framed[width=.25\textwidth, height=.25\textwidth]{}%
 }{%
                \strut word \\ \thinrule\hairline\hairline%
         }%
        \stopcombination
    \input knuth

\stoptext

This makes a box, then displays a word underneath, and then some blank 
lines.


The problem I'm having is many times the caption text is covering up 
whatever appears after. In this minimal example, I tried showing the 
problem, but somehow this is rendering find, not covering the \input 
knuth text.


Also, if I add more more items to the combination, the second row 
appears above the first row!


My document is rather complex, so I couldn't find a way to simplify it 
enough to get a minimal example to reveal the problem that is appearing.


Any ideas what might be causing the caption text to overlap and cover 
whatever appears after it?


Do you other combinations also pass wrong values for the number of rows 
and columns like in your example above?


Wolfgang

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

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


[NTG-context] Why are my captions overlapping next text in combinations?

2022-11-25 Thread Joel via ntg-context
I have some combinations used throughout my document like this:
\starttext
   \startcombination[4*2]            {%
                \framed[width=.25\textwidth, height=.25\textwidth]{}%
            }{%
                \strut word \\ \thinrule\hairline\hairline%
            }%
        \stopcombination    \input knuth

\stoptext
This makes a box, then displays a word underneath, and then some blank lines.
The problem I'm having is many times the caption text is covering up whatever 
appears after. In this minimal example, I tried showing the problem, but 
somehow this is rendering find, not covering the \input knuth text.
Also, if I add more more items to the combination, the second row appears above 
the first row!

My document is rather complex, so I couldn't find a way to simplify it enough 
to get a minimal example to reveal the problem that is appearing.

Any ideas what might be causing the caption text to overlap and cover whatever 
appears after it?
--Joel
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] About macro numberstriped ()

2022-10-01 Thread Fabrice Couvreur via ntg-context
Hi Hans,
When the rectangles are not identical, how to have the same type of
hatching in both ?
Thanks.
Fabrice


\starttext
 \startlinecorrection[blank]
  \startmidaligned
\switchtobodyfont[9pt]
\startMPcode
  path p, q, r, b ;
  p  := unitsquare xyscaled (4cm,4cm) ;
  z[0] = (2cm,0cm) ;
  z[1] = (2cm,4cm) ;
  z[2] = (0cm,2cm) ;
  q := llcorner p--z[0]--z[1]--z[2]--cycle ;
  r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
  b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;

  draw r
 withpattern image (
 draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
 % how to get the corner dots
   )
   withpatternscale 1/8
   withpen pencircle scaled 1pt
   withcolor cyan;
   ;
 draw b
   withpattern image (
 draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
 % how to get the corner dots
   )
   withpatternscale 1/16
   withpen pencircle scaled 1pt
   withcolor cyan;
   ;

   draw p;
   draw b;
   draw r;

 label.llft("D", p) ;
 label.lrt("C", p) ;
 label.ulft("A", p) ;
 label.urt("B", p) ;
 label.urt("P", lrcorner r) ;
 label.lft("Q", llcorner r) ;
label.top("M", urcorner r) ;

  \stopMPcode
  \stopmidaligned
\stoplinecorrection
\stoptext



Le mer. 28 sept. 2022 à 21:05, Henning Hraban Ramm via ntg-context <
ntg-context@ntg.nl> a écrit :

> Am 28.09.22 um 15:29 schrieb Hans Hagen via ntg-context:
> > On 9/28/2022 3:11 PM, Fabrice Couvreur via ntg-context wrote:
> >> PS : What is the exact meaning of the word "blobs" because my English
> >> is average ?
> > in order to get 'lines' you need to fill the two opposing corners with
> > "blobs of ink"
>
> Otherwise, a BLOB is a “binary large object”, e.g. if you save image
> data to a database.
>
> Hraban
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] About macro numberstriped ()

2022-09-28 Thread Henning Hraban Ramm via ntg-context

Am 28.09.22 um 15:29 schrieb Hans Hagen via ntg-context:

On 9/28/2022 3:11 PM, Fabrice Couvreur via ntg-context wrote:
PS : What is the exact meaning of the word "blobs" because my English 
is average ?
in order to get 'lines' you need to fill the two opposing corners with 
"blobs of ink"


Otherwise, a BLOB is a “binary large object”, e.g. if you save image 
data to a database.


Hraban

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

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


Re: [NTG-context] About macro numberstriped ()

2022-09-28 Thread Hans Hagen via ntg-context

On 9/28/2022 3:11 PM, Fabrice Couvreur via ntg-context wrote:

Hi Hans,
Thank you for this solution which is an approach that I did not know.
Fabrice

PS : What is the exact meaning of the word "blobs" because my English is 
average ?
in order to get 'lines' you need to fill the two opposing corners with 
"blobs of ink"


Hans (who's dutch is better than his english)

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] About macro numberstriped ()

2022-09-28 Thread Fabrice Couvreur via ntg-context
Hi Hans,
Thank you for this solution which is an approach that I did not know.
Fabrice

PS : What is the exact meaning of the word "blobs" because my English is
average ?

Le mar. 27 sept. 2022 à 22:04, Hans Hagen via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 9/27/2022 7:49 PM, Fabrice Couvreur via ntg-context wrote:
> > Hello,
> > I notice a strange behavior of the macro numberstriped ( ).
> > Thanks.
> > Fabrice
> >
> > \starttext
> >   \switchtobodyfont[9pt]
> >   \startMPcode
> >
> >path p, q, r, b ;
> >p  := unitsquare xyscaled (4cm,4cm) ;
> >z[0] = (2cm,0cm) ;
> >z[1] = (2cm,4cm) ;
> >z[2] = (0cm,2cm) ;
> >q := llcorner p--z[0]--z[1]--z[2]--cycle ;
> >r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
> >b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;
> >draw p ;
> >draw r withcolor red;
> >draw r numberstriped (.25,20,5) withcolor magenta ;
> >draw b numberstriped (.25,20,5) withcolor magenta ;
> >label.llft("D", p) ;
> >label.lrt("C", p) ;
> >label.ulft("A", p) ;
> >label.urt("B", p) ;
> >label.urt("P", lrcorner r) ;
> >label.lft("Q", llcorner r) ;
> >label.top("M", urcorner r) ;
> >
> >\stopMPcode
> > \stoptext
> you need to find a volunteer to make the pattern have the two corner  blobs
>
> \starttext
>
> \startMPcode
>  path p, q, r, b ;
>  path p ; p  := unitsquare xyscaled (4cm,4cm) ;
>  draw p ;
>  draw p
>  withpattern image (
>  draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
>  % how to get the corner dots
>  )
>  withpatternscale 1/16
>  withpen pencircle scaled 1mm
>  ;
> \stopMPcode
>
> \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 /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Hyphenation in multi-language projects

2022-09-14 Thread Steffen Wolfrum via ntg-context
Isn’t there a way to list exceptions that will work in *all* languages?

Steffen


> Am 14.09.2022 um 09:19 schrieb Denis Maier via ntg-context 
> :
> 
>> -Ursprüngliche Nachricht-
>> Von: ntg-context  Im Auftrag von Max
>> Chernoff via ntg-context
>> Gesendet: Mittwoch, 14. September 2022 08:51
>> An: ntg-context@ntg.nl
>> Cc: Max Chernoff ; cont...@st.estfiles.de
>> Betreff: Re: [NTG-context] Hyphenation in multi-language projects
>> 
>> Hi Steffen,
>> 
>>> … \replaceword should be the correct way for proper hyphenation??
>> 
>> Well I'm not sure if it's "correct", but it seems to work. Based on my 
>> testing,
>> having three subsequent sets of groups ({A}{B}{C}) is converted to a
>> discretionary. The discretionary hyphen "\-" is equivalent to the Plain TeX
>> command "\discretionary{-}{}{}", so
>> 
>>  \replaceword[hyphenations][steffen][steff{-}{}{}en]
>> 
>> acts just like "steff\-en". TeX won't otherwise hyphenate a word with
>> discretionaries, so this means that "steff-en" will be the only allowable
>> hyphenation.
> 
> Just one caveat though. IIRC, Hans has mentioned that this kind of stuff is 
> slower than using the hyphenation engine directly. (That's why he has 
> reimplemented the ligature suppression mechanism on the hyphenation level, 
> rather than acting on the node list.) 
> 
> Best,
> Denis
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

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

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


Re: [NTG-context] Hyphenation in multi-language projects

2022-09-14 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Max
> Chernoff via ntg-context
> Gesendet: Mittwoch, 14. September 2022 08:51
> An: ntg-context@ntg.nl
> Cc: Max Chernoff ; cont...@st.estfiles.de
> Betreff: Re: [NTG-context] Hyphenation in multi-language projects
> 
> Hi Steffen,
> 
> > … \replaceword should be the correct way for proper hyphenation??
> 
> Well I'm not sure if it's "correct", but it seems to work. Based on my 
> testing,
> having three subsequent sets of groups ({A}{B}{C}) is converted to a
> discretionary. The discretionary hyphen "\-" is equivalent to the Plain TeX
> command "\discretionary{-}{}{}", so
> 
>\replaceword[hyphenations][steffen][steff{-}{}{}en]
> 
> acts just like "steff\-en". TeX won't otherwise hyphenate a word with
> discretionaries, so this means that "steff-en" will be the only allowable
> hyphenation.

Just one caveat though. IIRC, Hans has mentioned that this kind of stuff is 
slower than using the hyphenation engine directly. (That's why he has 
reimplemented the ligature suppression mechanism on the hyphenation level, 
rather than acting on the node list.) 

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

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


Re: [NTG-context] Hyphenation in multi-language projects

2022-09-14 Thread Max Chernoff via ntg-context
Hi Steffen,

> … \replaceword should be the correct way for proper hyphenation??

Well I'm not sure if it's "correct", but it seems to work. Based on my
testing, having three subsequent sets of groups ({A}{B}{C}) is converted
to a discretionary. The discretionary hyphen "\-" is equivalent to the
Plain TeX command "\discretionary{-}{}{}", so 

   \replaceword[hyphenations][steffen][steff{-}{}{}en]
   
acts just like "steff\-en". TeX won't otherwise hyphenate a word with
discretionaries, so this means that "steff-en" will be the only allowable
hyphenation.

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

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


Re: [NTG-context] String substitution using regular expressions and backreferences

2022-08-26 Thread Hans Hagen via ntg-context

On 8/25/2022 9:44 PM, Thangalin via ntg-context wrote:

I've attempted to apply Wolfgang's subtle suggestion of using Lua to parse
the input document using a regular expression via lpeg.replacer. The
replacement itself works fine; however, in doing so the XML document
structure is converted to text, which means that it is no longer possible
to "flush" the XML for further processing as XML. The result is that any
unresolved XML tags are written verbatim to the PDF:

https://i.stack.imgur.com/9ZFND.png

There are two other issues with this approach. First is efficiency. Second
is that the processing function would have to be called for every XML
element to capture the replacement.

My original post asked about applying regex word substitution in a ConTeXt
way, such as:

\definereplacement[SubstMac][ match={Mc([A-Z].*)}, replace={\Mac \\1} ]
\definereplacement[SubstPostmeridian][ match={[Pp]\\.[Mm]\\.},
replace={\cap{pm}} ]

That seems like the cleanest approach because it would work on top of XML
or any other source document. Nevertheless, here is what I tried, which
partially works:

\startbuffer[main]

   “Mr. McAnulty, I presume?”
   Regular text. Irregular text.
\stopbuffer
\startxmlsetups xml:xhtml
   \xmlsetsetup{\xmldocument}{*}{-}
   \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}\stopxmlsetups
\startxmlsetups xml:html
   \startdocument
 \xmlflush{#1}
   \stopdocument\stopxmlsetups
% Paragraphs are followed by a paragraph break, but only if not
nested.\startxmlsetups xml:p
   \xmlfunction{#1}{p}
   \par\stopxmlsetups
\startxmlsetups xml:em
   \dontleavehmode{\em\xmlflush{#1}}\stopxmlsetups
\startluacode
function xml.functions.p( t )
   rep = { [1] = { "McAnulty", "\\Mac Anulty" } }
   x = lpeg.replacer( rep ):match( tostring( xml.text( t ) ) )

   buffers.assign( "p", context( x ) )
   context.getbuffer{ "p" }
end\stopluacode
\xmlregistersetup{xml:xhtml}
\def\Mac{%
   % Determine the sizes of 'M' and 'c'.
   \newbox\MacMBox%
   \setbox\MacMBox\hbox{M}%
   \newbox\MacCBox%
   \setbox\MacCBox\hbox{c}%
   %
   % Cheat to dynamically derive the kerning size by putting Mc in a box.
   %
   \newbox\MacKernBox%
   \setbox\MacKernBox\hbox{\inframed[offset=\zeropoint, width=fit]{Mc}}%
   \def\MacDelta{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
   \def\MacUWidth{\dimexpr\wd\MacCBox-.75\MacDelta\relax}%
   \def\MacRule{\vrule width \MacUWidth height .04em depth \zeropoint \relax}%
   \def\MacKern{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
   \def\MacHeight{\dimexpr\ht\MacMBox-\ht\MacCBox\relax}%
   %
   % Write Mc, where c has a macron, to the document.
   %
   M{%
 \dontleavehmode{\raisebox{\MacHeight}\hbox{c}}%
 \kern-1.04\MacUWidth
 \MacRule
 \kern.08\MacUWidth
   }%
}%
\xmlprocessbuffer{main}{main}{}

As shown in the screen shot, this doesn't correctly handle nested XML
elements.

Any ideas on what approach to take to perform a string replacement in
ConTeXt?

Best stay at the xml end ...

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}
\stopxmlsetups

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

\startxmlsetups xml:p
\xmlfunction{#1}{p}
\xmlcontext{#1}
\par
\stopxmlsetups

\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}
\stopxmlsetups

\startluacode
local rep = lpeg.replacer { [1] = { "McAnulty", "\\Mac Anulty" } }
function xml.functions.p(t)
local dt = t.dt
for i=1,#dt do
local di = dt[i]
if type(di) == "string" then
dt[i] = lpeg.match(rep,di)
end
end
end
\stopluacode

\xmlregistersetup{xml:xhtml}

\startdocument
\xmlprocessbuffer{main}{main}{}
\stopdocument

But this is more fun and probably also more reliable:

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}
\stopxmlsetups

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

\startxmlsetups xml:p
\xmlcontext{#1}
\par
\stopxmlsetups

\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

\usemodule[gimmicks] % in latest uploads

\chardef\MacAnulty = \getprivateglyphslot{MacAnulty}

\startsetups [box:mcanulty:\number\MacAnulty]
\Mac Anulty
\stopsetups

\registerboxglyph category {mcanulty} unicode \MacAnulty \relax

\startluacode
fonts.handlers.otf.addfeature {
name= "mcanulty",
type= "ligature",
nocheck = true,
data= {
[fonts.constructors.privateslots.MacAnulty] = {
"M", "c", "A", "n", &quo

Re: [NTG-context] String substitution using regular expressions and backreferences

2022-08-25 Thread Thangalin via ntg-context
I've attempted to apply Wolfgang's subtle suggestion of using Lua to parse
the input document using a regular expression via lpeg.replacer. The
replacement itself works fine; however, in doing so the XML document
structure is converted to text, which means that it is no longer possible
to "flush" the XML for further processing as XML. The result is that any
unresolved XML tags are written verbatim to the PDF:

https://i.stack.imgur.com/9ZFND.png

There are two other issues with this approach. First is efficiency. Second
is that the processing function would have to be called for every XML
element to capture the replacement.

My original post asked about applying regex word substitution in a ConTeXt
way, such as:

\definereplacement[SubstMac][ match={Mc([A-Z].*)}, replace={\Mac \\1} ]
\definereplacement[SubstPostmeridian][ match={[Pp]\\.[Mm]\\.},
replace={\cap{pm}} ]

That seems like the cleanest approach because it would work on top of XML
or any other source document. Nevertheless, here is what I tried, which
partially works:

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.
\stopbuffer
\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}\stopxmlsetups
\startxmlsetups xml:html
  \startdocument
\xmlflush{#1}
  \stopdocument\stopxmlsetups
% Paragraphs are followed by a paragraph break, but only if not
nested.\startxmlsetups xml:p
  \xmlfunction{#1}{p}
  \par\stopxmlsetups
\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}\stopxmlsetups
\startluacode
function xml.functions.p( t )
  rep = { [1] = { "McAnulty", "\\Mac Anulty" } }
  x = lpeg.replacer( rep ):match( tostring( xml.text( t ) ) )

  buffers.assign( "p", context( x ) )
  context.getbuffer{ "p" }
end\stopluacode
\xmlregistersetup{xml:xhtml}
\def\Mac{%
  % Determine the sizes of 'M' and 'c'.
  \newbox\MacMBox%
  \setbox\MacMBox\hbox{M}%
  \newbox\MacCBox%
  \setbox\MacCBox\hbox{c}%
  %
  % Cheat to dynamically derive the kerning size by putting Mc in a box.
  %
  \newbox\MacKernBox%
  \setbox\MacKernBox\hbox{\inframed[offset=\zeropoint, width=fit]{Mc}}%
  \def\MacDelta{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
  \def\MacUWidth{\dimexpr\wd\MacCBox-.75\MacDelta\relax}%
  \def\MacRule{\vrule width \MacUWidth height .04em depth \zeropoint \relax}%
  \def\MacKern{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
  \def\MacHeight{\dimexpr\ht\MacMBox-\ht\MacCBox\relax}%
  %
  % Write Mc, where c has a macron, to the document.
  %
  M{%
\dontleavehmode{\raisebox{\MacHeight}\hbox{c}}%
\kern-1.04\MacUWidth
\MacRule
\kern.08\MacUWidth
  }%
}%
\xmlprocessbuffer{main}{main}{}

As shown in the screen shot, this doesn't correctly handle nested XML
elements.

Any ideas on what approach to take to perform a string replacement in
ConTeXt?

Thanks again!


[Your] input is XML which means a lot more can be done than your simple TeX
> based example demonstrates.
>
> Wolfgang
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Suggestions for project structures, environment inheritance, local overrides

2022-08-17 Thread Denis Maier via ntg-context
Hi everyone

One of my current main projects where I use ConTeXt is typesetting journal 
articles from xml sources. As the journal appears only online, we've decided to 
publish each article individually. I have a working setup, but I occasionally 
ponder whether I could make things more smootly. Currently, my folder structure 
looks roughly like this :

2022
-- _assets
-- article1
 source
 md
 xml
 pdf
 html
-- article2
etc.

Usually, I receive Word files that get transformed via pandoc to markdown, 
polished, and from there to XML. HTML is produced via XSLT, PDF via ConTeXt. 
Transformations are performed with the help of a makefile.

The _assets folder contains a bunch of helper files, scripts, and two 
environment files used by ConTeXt :
jats.tex -> contains the setup for JATS XML
layout.tex -> contains layout settings

Now, this mostly works, but I sometimes struggle with things like 
overrides/additions for specific articles. Say, I have the global definitions, 
but I need to make small changes for one specific article? Or, I need to add 
something to one specific article, but I don't want to add this to the  
 files. I guess my question is something like this :

- How could a painless solution for such a scenario look like?
- Should you just load multiple environment files and override earlier 
settings? (How would that work with xml setups?)

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

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


[NTG-context] Keep the right margin in [nothyphenated, flushleft] columns

2022-08-12 Thread Marcin Ciura via ntg-context
Dear list,

I am typesetting [nothyphenated,flushleft] text in two columns. Some words
stick through the right margin of the left column, sometimes even
overlapping the right column. How can I make Context obey the right margin?

The MWE is below.

Here is the output PDF:
https://live.contextgarden.net/cgi-bin/result.cgi?id=UnSfnS


Best regards,

Marcin


\setupalign[nothyphenated,flushleft]

\starttext

\startitemize[n,nowhite,columns,two]

% The word '(boków' sticks through the right

% margin of the left column.

\item {\bf Wielokąt} to figura na płaszczyźnie,

której brzeg składa się z~odcinków

({\bf boków wielokąta}).

Końce boków nazywamy wierzchołkami wielokąta.

Czasem wyróżniamy jeden bok,

nazywając go podstawą wielokąta.

\stopitemize

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

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


Re: [NTG-context] Forbid footnotes from splitting across pages

2022-08-03 Thread Hamid,Idris via ntg-context
Dear Pablo,

Many thanks and apologies for top-posting: my normal email client is currently 
down.

I thought of something similar; after some testing, this is what I finally came 
up with:

\setupwhitespace[medium]
\setupnotation[footnote]
 [before={%
  
\startframedtext[none][frame=on,offset=none,width=\textwidth,style={\setupwhitespace[medium]}]},
  after={\stopframedtext\blank[medium]}]

\starttext
\input ward\
\startfootnote
\input knuth
\stopfootnote{}
\dorecurse{3}{\input ward\ }
\startfootnote
\input knuth
\stopfootnote{}
\dorecurse{2}{\input ward\ }
\startfootnote
\input knuth
\stopfootnote{}
\dorecurse{3}{\input ward\ }
\startfootnote
\input knuth
\stopfootnote{}
\stoptext

It works but there must be a cleaner way..

Observation: The first argument of  \startframedtext is important, otherwise 
too much extra space is generated -- not sure why but the 
\startframedtext[none] suppresses it.

Endnotes are evil 

But the reason for this is that I'm converting to WORD using Abobe and 
NitroPDF, and I'm trying to make things as easy for the editor of the book as 
easy as possible. The conversion will look right but the dozens of footnotes 
will, of course, be unlinked. If no footnote crosses the page it will be easier 
to edit in WORD -- which I'm not touching!

Thanks again.

Best wishes
Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80523


From: ntg-context  on behalf of Pablo Rodriguez via 
ntg-context 
Sent: Wednesday, August 3, 2022 7:47 AM
To: Idris Samawi Hamid ادريس سماوي حامد via ntg-context 
Cc: Pablo Rodriguez 
Subject: Re: [NTG-context] Forbid footnotes from splitting across pages

** Caution: EXTERNAL Sender **

On 8/3/22 03:05, Idris Samawi Hamid ادريس سماوي حامد via ntg-context wrote:
> Dear gang,
>
> Objectives:
>
> i)  Prevent footnotes from splitting across a page or pagebreak

Dear Idris,

I wonder whether a \framed[offset=none, frame=off, width=\textwidth]
would make sense here.

At least, it would prevent page breaks.

> ii) Make sure that the footnote reference number in the main text is
> always on the same page as the footnote.

\setupnote[footnote][split=verystrict, scope=text] might help here.

But it cannot achieve what is practically impossible:

  \setupnote[footnote][split=verystrict, scope=text]

  \starttext
  \dorecurse{25}
{ab cd ef\footnote{\input{knuth}}}
  \stoptext

I know that this depends from the publisher, but in these cases endnotes
are a way more viable option.

Just in case it might help,

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

maillist : ntg-context@ntg.nl / 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ntg.nl%2Fmailman%2Flistinfo%2Fntg-contextdata=05%7C01%7CIdris.Hamid%40ColoState.EDU%7Ca35bc09dc2a64a5a81ed08da7556aca9%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637951312414526695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=53R%2FGoQs03xamwTP1AaSV%2Flz0ANPdXq%2BScb8LWrCKDY%3Dreserved=0
webpage  : 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.pragma-ade.nl%2Fdata=05%7C01%7CIdris.Hamid%40ColoState.EDU%7Ca35bc09dc2a64a5a81ed08da7556aca9%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637951312414526695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=d0in%2BCdHvJmM4%2FLLb4TSe3HLoUTGm3SV9VWckCFge8c%3Dreserved=0
 / 
https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcontext.aanhet.net%2Fdata=05%7C01%7CIdris.Hamid%40ColoState.EDU%7Ca35bc09dc2a64a5a81ed08da7556aca9%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637951312414526695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=0ROMr0be%2Fcjjn7%2B84joQS6VN40i%2BkhEKytb%2FOYfT7Tk%3Dreserved=0
archive  : 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbitbucket.org%2Fphg%2Fcontext-mirror%2Fcommits%2Fdata=05%7C01%7CIdris.Hamid%40ColoState.EDU%7Ca35bc09dc2a64a5a81ed08da7556aca9%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637951312414526695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=KvquRtfyCxBeYRNGwgcjIfJJcc2VFzgMrVblnqx5IiU%3Dreserved=0
wiki : 
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcontextgarden.net%2Fdata=05%7C01%7CIdris.Hamid%40ColoState.EDU%7Ca35bc09dc2a64a5a81ed08da7556aca9%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637951312414526695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=2I9Ld7VLXQUlPOAo96PnWx3ITOX%2BS0arKW%2F

  1   2   3   4   5   6   7   8   9   10   >