Re: [NTG-context] Typing within doifmode leads to error

2021-03-19 Thread Christoph Reller
On Fri, Mar 19, 2021 at 9:49 AM Hans Hagen  wrote:

> On 3/19/2021 4:58 AM, Christoph Reller wrote:
> > Hi,
> >
> > Consider the following MWE:
> >
> > \definetyping[T]
> > \definemode[mode][yes]
> > \starttext
> > \doifmode{mode}{%
> >\startT
> >  Bla
> >\stopT}
> > \stoptext
> >
> > Compilation with the currently latest ConTeXt LMTX (ver: 2021.03.17
> > 17:46 LMTX  fmt: 2021.3.18) fails with:
> >
> > tex error   > runaway error: end of file encountered
> > mtx-context | fatal error: return code: 1
> >
> > Compilation is successful if I replace doifmode{mode}{...} by
> > \startmode[mode]...\stopmode.
> >
> > Is there anything I'm missing? (This could be a bug.)
> not a bug, just the way tex works .. modes cannot know that what goes
> into an argument is something verbose
>
> but you can use this (also more efficient here):
>
> \definetyping[T]
> \definemode[mode][yes]
> \starttext
> \startmode[mode]
> \startT
>  Bla
> \stopT
> \stopmode
> \stoptext
>
> % there's also \startnotmode
>
>
Thank you for hinting at the environment form. The problem with this is,
that it cannot be nested, and that there is no "else" form.
E.g:

\startmode[A]
... mode A
\startmode[B]
... mode A and mode B
\elsemode
... mode A and not mode B
\stopmode
\stopmode

I know that there is \start(not)mode and \start(not)allmodes, but there
seems to be no way to use a general boolean expression such as:

\startmodes[A and not B]
...
\stopmodes

Of course we can do this in lua:

if tex.modes["A"] and not tex.modes{"B"] then
...
end

Keep up your excellent work! Cheers,

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

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


Re: [NTG-context] lmt_followtext and cycle

2021-03-19 Thread Hans Hagen

On 3/19/2021 11:48 PM, Pablo Rodriguez wrote:

On 3/19/21 12:15 AM, Hans Hagen wrote:

On 3/18/2021 10:26 PM, Pablo Rodriguez wrote:

[...]

You can't expect two overlayed graphics to know of each others
independent applied scaling. So you need to do this:


Sorry, but version from 2021.03.17 17:46 requires two scalings, in path
and in lmt_followtext:

  \showframe
  \setuppapersize[A6, landscape]
  \starttext
  \startMPcode{doublefun}
   path p; p := (0,0)..(3,3.5)..(9,-3.5)..
   (12,0)..(9,3.5)..(3,-3.5)..cycle;
   draw lmt_followtext [
  text = "\dorecurse{9}{· Just random text }",
  path = p xsized TextWidth,
  autoscaleup = "max",
  reverse=true,
   ] xsized TextWidth;
  \stopMPcode
  \stoptext

To get what version from 2021.03.13 11:22 got only scaling lmt_followtext.

I mean, with previous version only scaling lmt_followtext worked fine.
in one case you scale the result in th eother the text and when the text 
runs outside the shape the resulting bbox is larger than the original


xsized TextWidth scales the result

how can the p you draw know that the lmt_followtext hs scaled to textwidth

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Zero size kerns with latest LMTX beta 2020-03-17

2021-03-19 Thread Hans Hagen

On 3/19/2021 10:47 PM, Pablo Rodriguez wrote:

On 3/19/21 10:11 PM, Joseph wrote:

Dear list,

Following MWE aims to reproduce the issue,


Hi Joseph,

I’m afraid that kerning current latest from 2021.03.17 17:46 isn’t able
to deal with the OpenType kern feature (which is enabled by default):
unrelated to opentype, just some post-handling of it (kind of a fix for 
something else) .. one word patch -)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] lmt_followtext and cycle

2021-03-19 Thread Pablo Rodriguez
On 3/19/21 12:15 AM, Hans Hagen wrote:
> On 3/18/2021 10:26 PM, Pablo Rodriguez wrote:
>> [...]
> You can't expect two overlayed graphics to know of each others
> independent applied scaling. So you need to do this:

Sorry, but version from 2021.03.17 17:46 requires two scalings, in path
and in lmt_followtext:

 \showframe
 \setuppapersize[A6, landscape]
 \starttext
 \startMPcode{doublefun}
  path p; p := (0,0)..(3,3.5)..(9,-3.5)..
  (12,0)..(9,3.5)..(3,-3.5)..cycle;
  draw lmt_followtext [
 text = "\dorecurse{9}{· Just random text }",
 path = p xsized TextWidth,
 autoscaleup = "max",
 reverse=true,
  ] xsized TextWidth;
 \stopMPcode
 \stoptext

To get what version from 2021.03.13 11:22 got only scaling lmt_followtext.

I mean, with previous version only scaling lmt_followtext worked fine.

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Zero size kerns with latest LMTX beta 2020-03-17

2021-03-19 Thread Hans Hagen

On 3/19/2021 10:11 PM, Joseph wrote:

Dear list,

Following MWE aims to reproduce the issue,

\definefontfeature[default][default][kern=yes]

\definefontfamily[mainfont][serif][EBGaramond]

\setupbodyfont[mainfont]

\showfontkerns

\starttext

Chapitre v.

\stoptext

ah, went unnoticed because i run all with

\enabledirectives[fonts.injections.method=advance]

I'll fix it

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Zero size kerns with latest LMTX beta 2020-03-17

2021-03-19 Thread Pablo Rodriguez
On 3/19/21 10:11 PM, Joseph wrote:
> Dear list,
>
> Following MWE aims to reproduce the issue,

Hi Joseph,

I’m afraid that kerning current latest from 2021.03.17 17:46 isn’t able
to deal with the OpenType kern feature (which is enabled by default):

  \showfontkerns
  \starttext
  \startTEXpage[offset=1em]
  AV
  \stopTEXpage
  \stoptext

Previous latest from 2021.03.13 11:22 has no problems with the kern feature.

Many thanks for spotting the issue,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Keeping track of hyphenations

2021-03-19 Thread Hans Hagen

On 3/19/2021 9:49 PM, denis.ma...@ub.unibe.ch wrote:

Wow, Hans, that looks awesome. Thanks a lot.

Regarding the first output: What are the numbers intended to mean?


The number of time that this word was used hyphenated (the same word can 
of course end up hyphenated differently in the paragraph).



In the second example we're talking in terms of lines in the input file, right?


No, the linenumber but because I use a loop it's all the same line; in 
practice these numbers point you to the paragraph start which is good 
enough.



If so, would it make sense to add some more context? Like so, or similar:

hyhenated   > around line 244 ( "our marvelous and everyday capacity to 
select") in file hup.tex: every-day


As said, normally you have that info (I can probably add the offset but 
i assume that one is not going to check every hyphenation.)



In any case, that's already super conventient. I'll put together a script to 
compare hyphenations with a whitelist and upload that to the wiki once it's 
ready.

What's the performance hit of all this? (I mean should you disable this and 
only run when needed, or can you safely leave the trackers enabled?)


measures on my 2013 laptop: a 1000 times \samplefile{tufte}\par takes:

pagella:

1000 steps, 4.140 seconds, 0.004140215 per step
1000 steps, 4.222 seconds, 0.004221645 per step

runtime: 4.937 seconds, 250 processed pages, 250 shipped pages, 50.635 
pages/second


latin modern:

1000 steps, 2.947 seconds, 0.002947476 per step
1000 steps, 3.043 seconds, 0.003042808 per step

runtime: 3.549 seconds, 223 processed pages, 223 shipped pages, 62.840 
pages/second


so not really a problem and i can probaby make it a bit faster (but we 
need to keep up with the urban myth that context is the slower system)


(it's not something i'd turn on by default)



Thanks again for your help!

Denis

-Ursprüngliche Nachricht-
Von: Hans Hagen 
Gesendet: Freitag, 19. März 2021 19:09
An: Maier, Denis Christian (UB) ; ntg-context@ntg.nl
Betreff: Re: AW: [NTG-context] Keeping track of hyphenations

On 3/19/2021 1:00 PM, denis.ma...@ub.unibe.ch wrote:

Ursprüngliche Nachricht-
Von: Hans Hagen 
Gesendet: Freitag, 19. März 2021 12:44
An: mailing list for ConTeXt users ; Maier, Denis
Christian (UB) 
Betreff: Re: [NTG-context] Keeping track of hyphenations

On 3/19/2021 11:47 AM, denis.ma...@ub.unibe.ch wrote:

Hi

Is there  a way to conveniently track hyphenations ? I've had a look
at https://wiki.contextgarden.net/Trackers
 but couldn't find anything.

depends on what you want to track

Something like this: Add every hyphenated word to the log file, like
hyphenations > 'What-ever' , realpage 1, userpage 1, subpage 1
hyphenations > 'Some-thing', realpage 2, userpage 2, subpage 2

You could then feed that into a script to produce a lists of all kinds, e.g., 
each hyphenation only once, sorted by page or by letter, with or without 
information about pages.

Forget about specific pagenumbers ... pages can get broken in the middle
of a paragraph and it's not worth the trouble of keeping track of / 
analyzing that detail (as usual all can be done but these are features that 
hardly anyone uses, get forgotten and probably no one can find where it's 
documents because no one expects it).

Anyway, a pre-weekend distaction:

\starttext

\enabletrackers[hyphenation.applied]
\enabletrackers[hyphenation.applied.console]

\dontcomplain \dostepwiserecurse{0}{15}{1}{
  {\advance\hsize -#1cm \input tufte \par} }

\stoptext

This will give you in the log file (first and second); the test run has narrow 
lines where one word crossed several lines, which actually is the main 
complication here:

hyhenated   > start hyphenated words

hyhenated   >2 : ab-stract,
hyhenated   >1 : ag-gre-gate,
hyhenated   >3 : ag-gregate,
hyhenated   >3 : aggre-gate,
hyhenated   >1 : ap-prox-i-mate,
hyhenated   >2 : ap-proximate,
hyhenated   >3 : approx-imate,
hyhenated   >1 : approxi-mate,
hyhenated   >1 : av-er-age,
hyhenated   >1 : av-erage,
hyhenated   >3 : be-cause
hyhenated   >1 : ca-pac-ity
hyhenated   >4 : ca-pacity
hyhenated   >1 : capac-ity
hyhenated   >1 : cat-a-log,
hyhenated   >2 : cat-alog,
hyhenated   >1 : cat-e-go-rize,
hyhenated   >3 : cat-egorize,
hyhenated   >1 : cata-log,
hyhenated   >1 : cate-gorize,
hyhenated   >2 : catego-rize,
hyhenated   >3 : clas-sify,
hyhenated   >3 : clus-ter,
hyhenated   >3 : con-dense,
hyhenated   >1 : dis-crim-i-nate,
hyhenated   >1 : dis-crimi-nate,
hyhenated   >1 : dis-criminate,
hyhenated   >1 : dis-tin-guish,
hyhenated   >3 : dis-tinguish,
hyhenated   >2 : discrim-inate,
hyhenated   >2 : distin-guish,
hyhenated   >1 : enu-mer-ate,
hyhenated 

[NTG-context] Zero size kerns with latest LMTX beta 2020-03-17

2021-03-19 Thread Joseph
Dear list, Following MWE aims to reproduce the issue,  \definefontfeature[default][default][kern=yes]\definefontfamily[mainfont][serif][EBGaramond]\setupbodyfont[mainfont]\showfontkerns \starttextChapitre v.\stoptext ThanksBest regards Joseph  
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Keeping track of hyphenations

2021-03-19 Thread denis.maier
Wow, Hans, that looks awesome. Thanks a lot.

Regarding the first output: What are the numbers intended to mean?

In the second example we're talking in terms of lines in the input file, right?
If so, would it make sense to add some more context? Like so, or similar:

hyhenated   > around line 244 ( "our marvelous and everyday capacity to 
select") in file hup.tex: every-day

In any case, that's already super conventient. I'll put together a script to 
compare hyphenations with a whitelist and upload that to the wiki once it's 
ready.

What's the performance hit of all this? (I mean should you disable this and 
only run when needed, or can you safely leave the trackers enabled?)

Thanks again for your help!

Denis

-Ursprüngliche Nachricht-
Von: Hans Hagen  
Gesendet: Freitag, 19. März 2021 19:09
An: Maier, Denis Christian (UB) ; ntg-context@ntg.nl
Betreff: Re: AW: [NTG-context] Keeping track of hyphenations

On 3/19/2021 1:00 PM, denis.ma...@ub.unibe.ch wrote:
> Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Freitag, 19. März 2021 12:44
> An: mailing list for ConTeXt users ; Maier, Denis 
> Christian (UB) 
> Betreff: Re: [NTG-context] Keeping track of hyphenations
> 
> On 3/19/2021 11:47 AM, denis.ma...@ub.unibe.ch wrote:
>> Hi
>>
>> Is there  a way to conveniently track hyphenations ? I've had a look 
>> at https://wiki.contextgarden.net/Trackers
>>  but couldn't find anything.
> depends on what you want to track
> 
> Something like this: Add every hyphenated word to the log file, like 
> hyphenations > 'What-ever' , realpage 1, userpage 1, subpage 1 
> hyphenations > 'Some-thing', realpage 2, userpage 2, subpage 2
> 
> You could then feed that into a script to produce a lists of all kinds, e.g., 
> each hyphenation only once, sorted by page or by letter, with or without 
> information about pages.
Forget about specific pagenumbers ... pages can get broken in the middle 
   of a paragraph and it's not worth the trouble of keeping track of / 
analyzing that detail (as usual all can be done but these are features that 
hardly anyone uses, get forgotten and probably no one can find where it's 
documents because no one expects it).

Anyway, a pre-weekend distaction:

\starttext

\enabletrackers[hyphenation.applied]
\enabletrackers[hyphenation.applied.console]

\dontcomplain \dostepwiserecurse{0}{15}{1}{
 {\advance\hsize -#1cm \input tufte \par} }

\stoptext

This will give you in the log file (first and second); the test run has narrow 
lines where one word crossed several lines, which actually is the main 
complication here:

hyhenated   > start hyphenated words

hyhenated   >2 : ab-stract,
hyhenated   >1 : ag-gre-gate,
hyhenated   >3 : ag-gregate,
hyhenated   >3 : aggre-gate,
hyhenated   >1 : ap-prox-i-mate,
hyhenated   >2 : ap-proximate,
hyhenated   >3 : approx-imate,
hyhenated   >1 : approxi-mate,
hyhenated   >1 : av-er-age,
hyhenated   >1 : av-erage,
hyhenated   >3 : be-cause
hyhenated   >1 : ca-pac-ity
hyhenated   >4 : ca-pacity
hyhenated   >1 : capac-ity
hyhenated   >1 : cat-a-log,
hyhenated   >2 : cat-alog,
hyhenated   >1 : cat-e-go-rize,
hyhenated   >3 : cat-egorize,
hyhenated   >1 : cata-log,
hyhenated   >1 : cate-gorize,
hyhenated   >2 : catego-rize,
hyhenated   >3 : clas-sify,
hyhenated   >3 : clus-ter,
hyhenated   >3 : con-dense,
hyhenated   >1 : dis-crim-i-nate,
hyhenated   >1 : dis-crimi-nate,
hyhenated   >1 : dis-criminate,
hyhenated   >1 : dis-tin-guish,
hyhenated   >3 : dis-tinguish,
hyhenated   >2 : discrim-inate,
hyhenated   >2 : distin-guish,
hyhenated   >1 : enu-mer-ate,
hyhenated   >2 : enu-merate,
hyhenated   >1 : enumer-ate,
hyhenated   >5 : every-day
hyhenated   >3 : fil-ter,
hyhenated   >2 : fo-cus,
hyhenated   >1 : har-mo-nize,
hyhenated   >1 : har-monize,
hyhenated   >2 : harmo-nize,
hyhenated   >6 : high-light,
hyhenated   >1 : ide-al-ize,
hyhenated   >2 : ide-alize,
hyhenated   >1 : ideal-ize,
hyhenated   >1 : in-for-ma-tion
hyhenated   >1 : in-forma-tionthick
hyhenated   >1 : in-formationthick
hyhenated   >3 : in-spect,
hyhenated   >1 : in-te-grate,
hyhenated   >2 : in-tegrate,
hyhenated   >1 : informa-tionthick
hyhenated   >3 : inte-grate,
hyhenated   >5 : iso-late,
hyhenated   >4 : item-ize,
hyhenated   >3 : mar-velous
hyhenated   >1 : or-ga-nize,
hyhenated   >1 : orga-nize,
hyhenated   >5 : out-line,
hyhenated   >1 : pi-geon-hole,
hyhenated   >6 : pigeon-hole,
hyhenated   >3 : re-duce,
hyhenated   >4 : 

Re: [NTG-context] Keeping track of hyphenations

2021-03-19 Thread Hans Hagen

On 3/19/2021 1:00 PM, denis.ma...@ub.unibe.ch wrote:

Ursprüngliche Nachricht-
Von: Hans Hagen 
Gesendet: Freitag, 19. März 2021 12:44
An: mailing list for ConTeXt users ; Maier, Denis Christian (UB) 

Betreff: Re: [NTG-context] Keeping track of hyphenations

On 3/19/2021 11:47 AM, denis.ma...@ub.unibe.ch wrote:

Hi

Is there  a way to conveniently track hyphenations ? I've had a look
at https://wiki.contextgarden.net/Trackers
 but couldn't find anything.

depends on what you want to track

Something like this: Add every hyphenated word to the log file, like hyphenations 
> 'What-ever' , realpage 1, userpage 1, subpage 1
hyphenations > 'Some-thing', realpage 2, userpage 2, subpage 2

You could then feed that into a script to produce a lists of all kinds, e.g., 
each hyphenation only once, sorted by page or by letter, with or without 
information about pages.
Forget about specific pagenumbers ... pages can get broken in the middle 
  of a paragraph and it's not worth the trouble of keeping track of / 
analyzing that detail (as usual all can be done but these are features 
that hardly anyone uses, get forgotten and probably no one can find 
where it's documents because no one expects it).


Anyway, a pre-weekend distaction:

\starttext

\enabletrackers[hyphenation.applied]
\enabletrackers[hyphenation.applied.console]

\dontcomplain \dostepwiserecurse{0}{15}{1}{
{\advance\hsize -#1cm \input tufte \par}
}

\stoptext

This will give you in the log file (first and second); the test run has 
narrow lines where one word crossed several lines, which actually is the 
main complication here:


hyhenated   > start hyphenated words

hyhenated   >2 : ab-stract,
hyhenated   >1 : ag-gre-gate,
hyhenated   >3 : ag-gregate,
hyhenated   >3 : aggre-gate,
hyhenated   >1 : ap-prox-i-mate,
hyhenated   >2 : ap-proximate,
hyhenated   >3 : approx-imate,
hyhenated   >1 : approxi-mate,
hyhenated   >1 : av-er-age,
hyhenated   >1 : av-erage,
hyhenated   >3 : be-cause
hyhenated   >1 : ca-pac-ity
hyhenated   >4 : ca-pacity
hyhenated   >1 : capac-ity
hyhenated   >1 : cat-a-log,
hyhenated   >2 : cat-alog,
hyhenated   >1 : cat-e-go-rize,
hyhenated   >3 : cat-egorize,
hyhenated   >1 : cata-log,
hyhenated   >1 : cate-gorize,
hyhenated   >2 : catego-rize,
hyhenated   >3 : clas-sify,
hyhenated   >3 : clus-ter,
hyhenated   >3 : con-dense,
hyhenated   >1 : dis-crim-i-nate,
hyhenated   >1 : dis-crimi-nate,
hyhenated   >1 : dis-criminate,
hyhenated   >1 : dis-tin-guish,
hyhenated   >3 : dis-tinguish,
hyhenated   >2 : discrim-inate,
hyhenated   >2 : distin-guish,
hyhenated   >1 : enu-mer-ate,
hyhenated   >2 : enu-merate,
hyhenated   >1 : enumer-ate,
hyhenated   >5 : every-day
hyhenated   >3 : fil-ter,
hyhenated   >2 : fo-cus,
hyhenated   >1 : har-mo-nize,
hyhenated   >1 : har-monize,
hyhenated   >2 : harmo-nize,
hyhenated   >6 : high-light,
hyhenated   >1 : ide-al-ize,
hyhenated   >2 : ide-alize,
hyhenated   >1 : ideal-ize,
hyhenated   >1 : in-for-ma-tion
hyhenated   >1 : in-forma-tionthick
hyhenated   >1 : in-formationthick
hyhenated   >3 : in-spect,
hyhenated   >1 : in-te-grate,
hyhenated   >2 : in-tegrate,
hyhenated   >1 : informa-tionthick
hyhenated   >3 : inte-grate,
hyhenated   >5 : iso-late,
hyhenated   >4 : item-ize,
hyhenated   >3 : mar-velous
hyhenated   >1 : or-ga-nize,
hyhenated   >1 : orga-nize,
hyhenated   >5 : out-line,
hyhenated   >1 : pi-geon-hole,
hyhenated   >6 : pigeon-hole,
hyhenated   >3 : re-duce,
hyhenated   >4 : re-fine,
hyhenated   >2 : re-view,
hyhenated   >4 : se-lect,
hyhenated   >1 : sep-a-rate
hyhenated   >1 : sepa-rate
hyhenated   >3 : sin-gle
hyhenated   >4 : struc-ture,
hyhenated   >1 : sum-ma-rize,
hyhenated   >4 : sum-marize,
hyhenated   >1 : summa-rize,
hyhenated   >1 : syn-op-size,
hyhenated   >2 : syn-opsize,
hyhenated   >1 : syn-the-size,
hyhenated   >3 : syn-thesize,
hyhenated   >1 : synop-size,
hyhenated   >2 : synthe-size,
hyhenated   >5 : win-now

hyhenated   > stop hyphenated words

and on the console and log (second tracker) lots of

pages   > flushing realpage 2, userpage 2, subpage 2, total 
0.482, page 0.011, average 0.482

open source > level 2, order 13, name 'tufte.tex'
close source> level 2, order 13, name 'tufte.tex'
hyhenated   > around line 244 in file hup.tex: every-day
hyhenated   > around line 

Re: [NTG-context] Keeping track of hyphenations

2021-03-19 Thread denis.maier
Ursprüngliche Nachricht-
Von: Hans Hagen  
Gesendet: Freitag, 19. März 2021 12:44
An: mailing list for ConTeXt users ; Maier, Denis Christian 
(UB) 
Betreff: Re: [NTG-context] Keeping track of hyphenations

On 3/19/2021 11:47 AM, denis.ma...@ub.unibe.ch wrote:
> Hi
> 
> Is there  a way to conveniently track hyphenations ? I've had a look 
> at https://wiki.contextgarden.net/Trackers
>  but couldn't find anything.
depends on what you want to track

Something like this: Add every hyphenated word to the log file, like 
hyphenations > 'What-ever' , realpage 1, userpage 1, subpage 1
hyphenations > 'Some-thing', realpage 2, userpage 2, subpage 2 

You could then feed that into a script to produce a lists of all kinds, e.g., 
each hyphenation only once, sorted by page or by letter, with or without 
information about pages.

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

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


Re: [NTG-context] Keeping track of hyphenations

2021-03-19 Thread Hans Hagen

On 3/19/2021 11:47 AM, denis.ma...@ub.unibe.ch wrote:

Hi

Is there  a way to conveniently track hyphenations ? I’ve had a look at 
https://wiki.contextgarden.net/Trackers 
 but couldn’t find anything.

depends on what you want to track

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] working on page refs with MP

2021-03-19 Thread Werner Hennrich

yes I had realized this already but I still don't know how to get those
page numbers down into MP - they keep being strings with macro code instead

is there a way the I can get \setupMPvariables[hdrPgs] in
\setupheadertexts[\setups{page:header}]
to be fully evaluated and stored as the page number in the MPvariables
first= and next= ??

   \startsetups page:header
    \setupMPvariables[hdrPgs]
        [curr=\pagenumber,
        first={\ref[page][\headerfirst]},
        next={\ref[page][\headernext]}]

    I've tried \expanded and \numeric without success

or alternatively in MP how would I call TeX (from MP) with a string like
"\ref[page][a]" and have the page number stored in a numeric var?

Thanks in advance,
Werner


Am 18.03.21 um 19:55 schrieb Hans Hagen:

On 3/18/2021 6:14 PM, Werner Hennrich wrote:


metafun > log >
metafun > log > error: Improper subscript has been replaced
by zero
metapost    > log > <*> ... numeric numFirst; numFirst := \ref
[page]

watch closely to the previous log line ... you're missing quotes so mp
sees \ref [page] and as it ignores a \ it sees ref[page] which unless
you defined 'ref' and 'page' triggers an error

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



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

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


[NTG-context] Keeping track of hyphenations

2021-03-19 Thread denis.maier
Hi
Is there  a way to conveniently track hyphenations ? I've had a look at 
https://wiki.contextgarden.net/Trackers but couldn't find anything.

I'm thinking of something like this: add information about all hyphenated words 
to the log so that this could be further processed with a script maybe.

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

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


Re: [NTG-context] Typing within doifmode leads to error

2021-03-19 Thread Hans Hagen

On 3/19/2021 4:58 AM, Christoph Reller wrote:

Hi,

Consider the following MWE:

\definetyping[T]
\definemode[mode][yes]
\starttext
\doifmode{mode}{%
   \startT
     Bla
   \stopT}
\stoptext

Compilation with the currently latest ConTeXt LMTX (ver: 2021.03.17 
17:46 LMTX  fmt: 2021.3.18) fails with:


tex error       > runaway error: end of file encountered
mtx-context     | fatal error: return code: 1

Compilation is successful if I replace doifmode{mode}{...} by 
\startmode[mode]...\stopmode.


Is there anything I'm missing? (This could be a bug.)
not a bug, just the way tex works .. modes cannot know that what goes 
into an argument is something verbose


but you can use this (also more efficient here):

\definetyping[T]
\definemode[mode][yes]
\starttext
\startmode[mode]
\startT
Bla
\stopT
\stopmode
\stoptext

% there's also \startnotmode



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Typing within doifmode leads to error

2021-03-19 Thread Christoph Reller
On Fri, Mar 19, 2021 at 5:38 AM Aditya Mahajan  wrote:

> On Fri, 19 Mar 2021, Christoph Reller wrote:
>
> > Consider the following MWE:
> >
> > \definetyping[T]
> > \definemode[mode][yes]
> > \starttext
> > \doifmode{mode}{%
> >   \startT
> > Bla
> >   \stopT}
> > \stoptext
> >
> > Compilation with the currently latest ConTeXt LMTX (ver: 2021.03.17 17:46
> > LMTX  fmt: 2021.3.18) fails with:
> >
> > tex error   > runaway error: end of file encountered
> > mtx-context | fatal error: return code: 1
> >
> > Compilation is successful if I replace doifmode{mode}{...} by
> > \startmode[mode]...\stopmode.
>
> Has to be with how tex works. The argument of any macro
> (\doifmode{mode}{...} in this case) is scanned under the current catcode
> regime. So, any environment (like typing) which changes catcodes does work
> inside the argument to another macro.
>

I see. Strangely, the MWE did work in older versions of ConTeXt ;-)


> So, either use the environment version of \doifmode (which doesn't
> _capture_ it content):
>
> \definetyping[T]
> \definemode[mode][yes]
> \starttext
> \startmode[mode]
>   \startT
> Bla
>   \stopT
> \stopmode
> \stoptext
>
> Or use buffers (to avoid catcode all together):
>
> \definetyping[T]
> \definemode[mode][yes]
> \starttext
> \startbuffer[code]
> \startT
> Bla
> \stopT
> \stopbuffer
>
> \doifmode{mode}{\getbuffer[code]}
> \stoptext
>
> or (note type**T**buffer so that the output is formatting according to the
> options of \definetyping[T])
>
> \definetyping[T]
> \definemode[mode][yes]
> \starttext
> \startbuffer[code]
> Bla
> \stopbuffer
>
> \doifmode{mode}{\typeTbuffer[code]}
> \stoptext
>
> Perhaps this should be added to the FAQ on the wiki.
>
> Aditya
>

 Thank you for your ultra-speedy and very helpful response!

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