Re: [NTG-context] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-23 Thread Jeong Dal
Dear Hans,

Your code works fine.

> \starttext
> 
> \startMPcode
>numeric maxCount;
>maxCount := 10;
>setglobalmacro("MyMacro",decial maxCount);
>setglobalcount("MyCount",maxCount);
> \stopMPcode
> 
> 
> \dorecurse{\MyMacro}{It is \recurselevel. }\par
> \dorecurse{\MyCount}{It is \recurselevel. }\par
> 
> \stoptext

I applied your method to my code as following. 

\newcount\udCount  %%% add count
\startMPinitializations%{UDBasic}
  pair A,B,C,D;
  pair E, F, G, H;
  path p,q;
  numeric ang,maxNum;

  numeric n; %AM Added

  u:=1in;
  A=(.95*TextWidth,u); B=(0,u); C=(0,0); D=(.95*TextWidth,0);
  p := A--B--C--D;
  q := (TextWidth,1.5u)--(0,1.5u)--(0,-.5u)--(TextWidth,-.5u)--cycle;
  z0=(.1u,0);
  
   vardef nextPt (expr M,N) = 
   if ypart(N) = 0: 
   H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[A,B];
   else:
   H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[C,D];
   fi;
   H
   enddef;

   def grayUD(expr i) =
  draw G -- if ypart(B)=ypart(G): B -- C else: C -- B fi --z[i];
  filldraw z[i]+2*(G-z[i])*u -- z[i] -- z[i+1] -- z[i+1]+(G-z[i])*u -- 
cycle withcolor .75white; 
  draw G -- z[i+1] dashed evenly;
  draw z[0] for k=0 upto i: --z[k] endfor dashed evenly;
  clip currentpicture to q;
   enddef;

   def linesUD(expr i) =
  draw p;
  draw z0 for k=0 upto i+1: --z[k] endfor dashed evenly;

  % AM: removed. Set in in the main code
  % setbounds currentpicture to boundingbox q;
   enddef;

   ang := 40;
   z[1] = whatever[z[0], z[0]+dir(ang)*u] = whatever[A,B];

   % AM: Changed next line from G to z[-1]
   z[-1] = whatever[z[0], z[0]+dir(2*ang)*u] = whatever[A,B];
   for k = 2 upto 20:
  z[k] = nextPt(z[k-2],z[k-1]);
  maxNum := k;
  exitif xpart(z[k]) > TextWidth;
   endfor;
   maxNum := maxNum-1;
   setglobalmacro("udMacro",decimal maxNum);  %%% define udMacro and udCount
   setglobalcount("udCount",maxNum);

\stopMPinitializations

\startuseMPgraphic{foldUD}{num}
   numeric n;
   n := \MPvar{num}-1;
   G := z[n-1];
   grayUD(n);
\stopuseMPgraphic
\startuseMPgraphic{dotLines}{num}
   numeric n;
   n := \MPvar{num}-1;
   linesUD(n);
\stopuseMPgraphic

\setupinteraction[state=start]
\usemodule[animation]
\starttext
%\startanimation[menu=yes]
%{
\dorecurse{\udCount}
 {\useMPgraphic{foldUD}{num=\recurselevel}}
 {\useMPgraphic{dotLines}{num=\recurselevel}}
%}
%\stopanimation
\stoptext

1. Using “udCount” doesn’t issue error message, but it draws the path p only.
2. Using “udMacro” issue the error message.

Is there anything that I miss?

Best regards,

Dalyoung

**
tex error   > tex error on line 75 in file /Users/graph/Library/Mobile 
Documents/com~apple~CloudDocs/texMain/funmath/foldBandMPnew.tex: Undefined 
control sequence

 \udMacro 

 \dorecurse #1->\ifcase #1
\relax \expandafter \gobbletwoarguments \or \expandafter 
\syst_helpers_recurse_y \else \expandafter \syst_helpers_recurse_x \fi {#1}
 \dorecurse{\udMacro}

65numeric n;
66n := \MPvar{num}-1;
67linesUD(n);
68 \stopuseMPgraphic
69 
70 \setupinteraction[state=start]
71 \usemodule[animation]
72 \starttext
73 %\startanimation[menu=yes]
74 %{
75 >>  \dorecurse{\udMacro}
76  {\useMPgraphic{foldUD}{num=\recurselevel}}
77  {\useMPgraphic{dotLines}{num=\recurselevel}}
78 %}
 ___
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] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-23 Thread Hans Hagen

On 6/24/2021 5:39 AM, Aditya Mahajan wrote:


You need to call the setglobalmacro(...) macro. The code inside 
\startMPinitializations is only executed when you call any MP environment. But 
you are using \udCount before \useMPgraphic. A simple solution is to run dummy 
MP code so that MP initializations are run:

 \starttext
 \setbox\scratchbox\hbox{\startMPcode draw unitcircle; \stopMPcode}
 \dorecurse{\udCount}
  {\useMPgraphic{foldUD}{num=\recurselevel}}
  {\useMPgraphic{dotLines}{num=\recurselevel}}
 \stoptext

A run with no sideeffects in the content stream is:

\startMPcalculation
 
\stopMPcalculation

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] simplifying repeated macro calls in metafun

2021-06-23 Thread Aditya Mahajan
On Wed, 23 Jun 2021, Aditya Mahajan wrote:

> On Thu, 24 Jun 2021, Jeong Dal wrote:
> 
> > Now, I am trying to do the same thing using \startuseMPgraphic, but I don’t 
> > the correct result yet.
> > Using \startuseMPgraphic, and \dorecurse, the code is simpler. But, it 
> > seems to me that \startanimation … \stopanimation is not working with 
> > \dorecurse{}{} …
> > It just list all the graphics.
> > Any hint is welcome.
> 
> A while back, I wrote some code to easily generate metapost animations. 
> 
> https://adityam.github.io/context-blog/post/metapost-animation/
> 
> I haven't used it much because I am mostly on linux, and its is a PITA to get 
> an older version of Adobe Reader to work under wine. 

Here's a version using these macros. It runs with MkIV but not with LMTX. 
Sorry, no time to debug what's going wrong in LMTX right now.

Aditya

mp-test.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 / 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] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-23 Thread Aditya Mahajan
On Thu, 24 Jun 2021, Jeong Dal wrote:

> Dear Hans,
> 
> Your code works fine.
> 
> > \starttext
> > 
> > \startMPcode
> >numeric maxCount;
> >maxCount := 10;
> >setglobalmacro("MyMacro",decial maxCount);
> >setglobalcount("MyCount",maxCount);
> > \stopMPcode
> > 
> > 
> > \dorecurse{\MyMacro}{It is \recurselevel. }\par
> > \dorecurse{\MyCount}{It is \recurselevel. }\par
> > 
> > \stoptext
> 
> I applied your method to my code as following. 
> 
> \newcount\udCount  %%% add count
> \startMPinitializations%{UDBasic}
>   pair A,B,C,D;
>   pair E, F, G, H;
>   path p,q;
>   numeric ang,maxNum;
> 
>   numeric n; %AM Added
> 
>   u:=1in;
>   A=(.95*TextWidth,u); B=(0,u); C=(0,0); D=(.95*TextWidth,0);
>   p := A--B--C--D;
>   q := (TextWidth,1.5u)--(0,1.5u)--(0,-.5u)--(TextWidth,-.5u)--cycle;
>   z0=(.1u,0);
>   
>vardef nextPt (expr M,N) = 
>if ypart(N) = 0: 
>H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[A,B];
>else:
>H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[C,D];
>fi;
>H
>enddef;
> 
>def grayUD(expr i) =
>   draw G -- if ypart(B)=ypart(G): B -- C else: C -- B fi --z[i];
>   filldraw z[i]+2*(G-z[i])*u -- z[i] -- z[i+1] -- z[i+1]+(G-z[i])*u -- 
> cycle withcolor .75white; 
>   draw G -- z[i+1] dashed evenly;
>   draw z[0] for k=0 upto i: --z[k] endfor dashed evenly;
>   clip currentpicture to q;
>enddef;
> 
>def linesUD(expr i) =
>   draw p;
>   draw z0 for k=0 upto i+1: --z[k] endfor dashed evenly;
> 
>   % AM: removed. Set in in the main code
>   % setbounds currentpicture to boundingbox q;
>enddef;
> 
>ang := 40;
>z[1] = whatever[z[0], z[0]+dir(ang)*u] = whatever[A,B];
> 
>% AM: Changed next line from G to z[-1]
>z[-1] = whatever[z[0], z[0]+dir(2*ang)*u] = whatever[A,B];
>for k = 2 upto 20:
>   z[k] = nextPt(z[k-2],z[k-1]);
>   maxNum := k;
>   exitif xpart(z[k]) > TextWidth;
>endfor;
>maxNum := maxNum-1;
>setglobalmacro("udMacro",decimal maxNum);  %%% define udMacro and udCount
>setglobalcount("udCount",maxNum);
> 
> \stopMPinitializations
> 
> \startuseMPgraphic{foldUD}{num}
>numeric n;
>n := \MPvar{num}-1;
>G := z[n-1];
>grayUD(n);
> \stopuseMPgraphic
> \startuseMPgraphic{dotLines}{num}
>numeric n;
>n := \MPvar{num}-1;
>linesUD(n);
> \stopuseMPgraphic
> 
> \setupinteraction[state=start]
> \usemodule[animation]
> \starttext
> %\startanimation[menu=yes]
> %{
> \dorecurse{\udCount}
>  {\useMPgraphic{foldUD}{num=\recurselevel}}
>  {\useMPgraphic{dotLines}{num=\recurselevel}}
> %}
> %\stopanimation
> \stoptext
> 
> 1. Using “udCount” doesn’t issue error message, but it draws the path p only.
> 2. Using “udMacro” issue the error message.
> 
> Is there anything that I miss?

You need to call the setglobalmacro(...) macro. The code inside 
\startMPinitializations is only executed when you call any MP environment. But 
you are using \udCount before \useMPgraphic. A simple solution is to run dummy 
MP code so that MP initializations are run:

\starttext
\setbox\scratchbox\hbox{\startMPcode draw unitcircle; \stopMPcode}
\dorecurse{\udCount}
 {\useMPgraphic{foldUD}{num=\recurselevel}}
 {\useMPgraphic{dotLines}{num=\recurselevel}}
\stoptext


Aditya
___
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] simplifying repeated macro calls in metafun

2021-06-23 Thread Aditya Mahajan
On Thu, 24 Jun 2021, Jeong Dal wrote:

> Now, I am trying to do the same thing using \startuseMPgraphic, but I don’t 
> the correct result yet.
> Using \startuseMPgraphic, and \dorecurse, the code is simpler. But, it seems 
> to me that \startanimation … \stopanimation is not working with 
> \dorecurse{}{} …
> It just list all the graphics.
> Any hint is welcome.

A while back, I wrote some code to easily generate metapost animations. 

https://adityam.github.io/context-blog/post/metapost-animation/

I haven't used it much because I am mostly on linux, and its is a PITA to get 
an older version of Adobe Reader to work under wine. 

Aditya___
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] simplifying repeated macro calls in metafun

2021-06-23 Thread Jeong Dal
Dear Otared,

> 
> Regarding the way Aditya uses \startuseMPgraphic, it is also very 
> instructive. 
> Dalyoung, can you also share the animation example for the foldings ? I am 
> sure we are a few on the list to learn something…
> 

1. Here is the working sample of animation using \processMPbuffer which I did 
before. You can see it using adobe reader.


\startbuffer[UDBasic]
  pair A,B,C,D;
  pair E, F, G, H;
  path p,q;
  numeric ang,maxNum;
  u:=1in;
  A=(.95*TextWidth,u); B=(0,u); C=(0,0); D=(.95*TextWidth,0);
  p := A--B--C--D;
  q := (TextWidth,1.5u)--(0,1.5u)--(0,-.5u)--(TextWidth,-.5u)--cycle;
  z0=(.1u,0);
  
   vardef nextPt (expr M,N) = 
   if ypart(N) = 0: 
   H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[A,B];
   else:
   H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[C,D];
   fi;
   H
   enddef;

   def grayUD(expr i) =
  draw G -- if ypart(B)=ypart(G): B -- C else: C -- B fi --z[i];
  filldraw z[i]+2*(G-z[i])*u -- z[i] -- z[i+1] -- z[i+1]+(G-z[i])*u -- 
cycle withcolor .75white; 
  draw G -- z[i+1] dashed evenly;
  draw z[0] for k=0 upto i: --z[k] endfor dashed evenly;
  clip currentpicture to q;
  setbounds currentpicture to boundingbox q;
   enddef;

   def linesUD(expr i) =
  draw p;
  draw z0 for k=0 upto i+1: --z[k] endfor dashed evenly;
  setbounds currentpicture to boundingbox q;
   enddef;
\stopbuffer

\startbuffer[UDpts]
   ang := 40;
   z[1] = whatever[z[0], z[0]+dir(ang)*u] = whatever[A,B];
   G := whatever[z[0], z[0]+dir(2*ang)*u] = whatever[A,B];
   for k = 2 upto 20:
  z[k] = nextPt(z[k-2],z[k-1]);
  maxNum := k;
  exitif xpart(z[k]) > TextWidth;
   endfor;
\stopbuffer
\startbuffer[UD0]
   draw p;
   setbounds currentpicture to boundingbox q;
\stopbuffer
\startbuffer[UD1]
   grayUD(0);
\stopbuffer
\startbuffer[UD11]
   linesUD(0);
\stopbuffer
\startbuffer[UD2]
   G := z0;
   grayUD(1)
\stopbuffer
\startbuffer[UD21]
   linesUD(1);
\stopbuffer
\startbuffer[UD3]
   G := z1;
   grayUD(2);
\stopbuffer
\startbuffer[UD31]
   linesUD(2);
\stopbuffer
\startbuffer[UD4]
   G := z2;
   grayUD(3);
\stopbuffer
\startbuffer[UD41]
   linesUD(3);
\stopbuffer
\startbuffer[UD5]
   G := z3;
   grayUD(4);
\stopbuffer
\startbuffer[UD51]
   linesUD(4);
\stopbuffer
\startbuffer[UDFinal]
draw p;
draw z0--z1--z2--z3--z4--z5--z6--z7--z8 dashed evenly;
setbounds currentpicture to boundingbox q;
\stopbuffer

\setupinteraction[state=start]
\usemodule[animation]
\starttext
\startanimation[menu=yes]
{\processMPbuffer[UDBasic,UDpts,UD0]}
{\processMPbuffer[UDBasic,UDpts,UD1]}
{\processMPbuffer[UDBasic,UDpts,UD11]}
{\processMPbuffer[UDBasic,UDpts,UD2]}
{\processMPbuffer[UDBasic,UDpts,UD21]}
{\processMPbuffer[UDBasic,UDpts,UD3]}
{\processMPbuffer[UDBasic,UDpts,UD31]}
{\processMPbuffer[UDBasic,UDpts,UD4]}
{\processMPbuffer[UDBasic,UDpts,UD41]}
{\processMPbuffer[UDBasic,UDpts,UD5]}
{\processMPbuffer[UDBasic,UDpts,UD51]}
{\processMPbuffer[UDBasic,UDpts,UDFinal]}
\stopanimation
\stoptext

Now, I am trying to do the same thing using \startuseMPgraphic, but I don’t the 
correct result yet.
Using \startuseMPgraphic, and \dorecurse, the code is simpler. But, it seems to 
me that \startanimation … \stopanimation is not working with \dorecurse{}{} …
It just list all the graphics.
Any hint is welcome.

\startMPinitializations%{UDBasic}
  pair A,B,C,D;
  pair E, F, G, H;
  path p,q;
  numeric ang,maxNum;

  numeric n; %AM Added

  u:=1in;
  A=(.95*TextWidth,u); B=(0,u); C=(0,0); D=(.95*TextWidth,0);
  p := A--B--C--D;
  q := (TextWidth,1.5u)--(0,1.5u)--(0,-.5u)--(TextWidth,-.5u)--cycle;
  z0=(.1u,0);
  
   vardef nextPt (expr M,N) = 
   if ypart(N) = 0: 
   H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[A,B];
   else:
   H := whatever[N, N + dir(.5*angle(M-N))*u] = whatever[C,D];
   fi;
   H
   enddef;

   def grayUD(expr i) =
  draw G -- if ypart(B)=ypart(G): B -- C else: C -- B fi --z[i];
  filldraw z[i]+2*(G-z[i])*u -- z[i] -- z[i+1] -- z[i+1]+(G-z[i])*u -- 
cycle withcolor .75white; 
  draw G -- z[i+1] dashed evenly;
  draw z[0] for k=0 upto i: --z[k] endfor dashed evenly;
  clip currentpicture to q;
   enddef;

   def linesUD(expr i) =
  draw p;
  draw z0 for k=0 upto i+1: --z[k] endfor dashed evenly;

  % AM: removed. Set in in the main code
  % setbounds currentpicture to boundingbox q;
   enddef;

   ang := 40;
   z[1] = whatever[z[0], z[0]+dir(ang)*u] = whatever[A,B];

   % AM: Changed next line from G to z[-1]
   z[-1] = whatever[z[0], z[0]+dir(2*ang)*u] = whatever[A,B];
   for k = 2 upto 20:
  z[k] = nextPt(z[k-2],z[k-1]);
  maxNum := k;
  exitif xpart(z[k]) > TextWidth;
   endfor;

\stopMPinitializations

\startuseMPgraphic{foldUD}{num}
   numeric n;
   n := \MPvar{num}-1;
   G := z[n-1];
   grayUD(n);
\stopuseMPgraphic
\startuseMPgraphic{dotLines}{num}
   numeric n;
   n := \MPvar{num}-1;
   linesUD(n);
\stopuseMPgraphic

\setupinteraction[state=start]
\usemodule[animation]
\st

[NTG-context] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-23 Thread Jeong Dal

Hi,

Is there a way to deliver the value of a variable in MetaFun to ConTeXt.
For example, I want to do the following:

\starttext
\startMPcode
numeric maxCount;
% … some code
maxCount := 10;
\stopMPcode

dorecurse{maxCount}
{It is \recurselevel.\par}

\stoptext

Thank you for reading.

Best regards,

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

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


Re: [NTG-context] LMTX, BIdi, full paragraph, and spurious empty line

2021-06-23 Thread Rik Kabel


On 6/23/2021 18:10, Hans Hagen wrote:

On 6/22/2021 4:52 AM, Rik Kabel wrote:

[...]ome an alternative way to do that.)
I'll send you a possible fix but it needs a bit of testing. It has to 
do with (probably spurious) spaces which means that the parbuilder 
then considers the dir node to be a reasoable breakpoint (well, kin 
dof okay as one gets what one asks for), but I'll be a bit more 
agressive in dealing with that.


Hans


Thank you, Hans, for looking into this so soon.

I did try what you sent, but see no difference. I have eliminated the 
changes to spaceskip as a cause and simplified the example, removing the 
spaceskip and delimitedtext.


New example, in which I get a spurious line after the third and fourth 
Walt Kelly entries:


   %% Demonstration of spurious line insertion on full paragraph with bidi

   \setupdirections [bidi=on,method=unicode]

   \enabletrackers  [typesetters.directions]
   %\showmakeup  [glue,dir]

   \definepapersize [Testing]
 [width=6.69in]
   \setuppapersize  [Testing]

   \setuplayout [width=fit,
  backspace=1.4in,
  cutspace=1in,
  leftmargin=0.65in,
  rightmargin=0.65in]

   \setupwhitespace [small]


   \setupbodyfont   [libertinus,11pt]

   \startbuffer[Test]
    Kelly, Cynthia C., ed. 2005. {\em Oppenheimer and the Manhattan
    Project: Insights into J.~Robert Oppenheimer, ‘Father of the
    Atomic Bomb’}. Singapore: World Scientific.

    Kelly, Walt. 1953. {\em The Pogo Papers}. New York, NY Simon
    & Schuster.

    Kelly, Walt. 1953. {\em The Pogo Papers}. New York NY Simon
    & Schuster.

    Kelly, Walt. 1953. {\em The Pogo Papers}. New York, NY: Simon
    & Schuster.

    Kelly, Walt. 1953. {\em The Pogo Papers}. New York,, NY: Simon
    & Schuster.

    Kelly, Walt. 1953. {\em The Pogo Papers}. New York; NY Simon
    & Schuster.

    Kuhn, Thomas S. 1962. {\em The Structure of Scientific
    Revolutions}. Chicago, IL: University of Chicago Press.

    Weinreich, Max. 1945. “Der YIVO un di problemen fun undzer
    tsayt (דער ייִוואָ און די פּראָבלעמען פֿון אונדזער צײַט).”
    {\em YIVO Bleter} 25 (1): 3--18. The title is translated as
    {\em The YIVO and the problems of our time}, and also as
    {\em The YIVO faces the post-war world}.

   \stopbuffer

   \starttext

  \getbuffer[Test]

   \stoptext

--
Rik

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

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


Re: [NTG-context] LMTX, BIdi, full paragraph, and spurious empty line

2021-06-23 Thread Hans Hagen

On 6/22/2021 4:52 AM, Rik Kabel wrote:

Hello all,

Last October Denis Maier complained about a spurious empty line 
generated with protrusion and bidi active and a full paragraph. (See 
https://www.mail-archive.com/ntg-context@ntg.nl/msg95916.html 
 or 
similar on your favorite mail archive.)


I have recreated the issue without involving protrusion. When a 
paragraph is very full and bidi is on, an extra line seems to be 
generated. Without bidi there is no extra line. This is quite sensitive, 
of course, to line width. I have probably 30 instances of it occurring 
in a tightly-set bibliography. I would assume that it may occur in any 
text, but have not noticed it in the body of my book.


I have created an example document that shows it. The problem disappears 
if bidi is turned off (comment out the first non-comment line) but of 
course then the RTL text is mis-set. In this example, the spurious line 
appears after the Walt Kelly entry.


This was tested under ConTeXt  ver: 2021.06.18 23:37 LMTX  fmt: 
2021.6.21, but is not a new problem with this version. /The problem does 
not occur with MKIV from the same installation./


%% Demonstration of spurious line insertion on full paragraph with
bidi active

\setupdirections  [bidi=on,method=unicode]

\definepapersize  [Testing]
   [width=6.69in]
\setuppapersize   [Testing]

\setuplayout  [width=fit,
    backspace=1.4in,
    cutspace=1in,
    leftmargin=0.65in,
    rightmargin=0.65in]

\setupwhitespace  [small]

\setupbodyfont    [libertinus,11pt]

\define\SetupBib{
   \spaceskip 0.7\interwordspace plus .5\interwordstretch minus
\interwordshrink
   \definedelimitedtext
     [Exdent]
     [leftmargin=1em,
  indenting={yes,-1em},
  indentnext=yes]}

\starttext
   \input jojomayer

   \input klein

   \blank[2*line]

   \SetupBib
   \startExdent

     Kelly, Cynthia C., ed. 2005. {\em Oppenheimer and the Manhattan
     Project: Insights into J.~Robert Oppenheimer, ‘Father of the
     Atomic Bomb’}. Singapore: World Scientific.

     Kelly, Walt. 1953. {\em The Pogo Papers}. New York, NY: Simon
     & Schuster.

     Kuhn, Thomas S. 1962. {\em The Structure of Scientific
     Revolutions}. Chicago, IL: University of Chicago Press.

     Weinreich, Max. 1945. “Der YIVO un di problemen fun undzer
     tsayt (דער ייִוואָ און די פּראָבלעמען פֿון אונדזער צײַט).”
     {\em YIVO Bleter} 25 (1): 3--18. The title is translated as
     {\em The YIVO and the problems of our time}, and also as
     {\em The YIVO faces the post-war world}.

   \stopExdent
\stoptext

Of course, there could be some other mechanism at work here than bidi, 
but changing that clears the problem in this instance. (It may be the 
adjustment to spaceskip that I use to tighten up the text in the 
bibliography, and if it is, I welcome an alternative way to do that.)
I'll send you a possible fix but it needs a bit of testing. It has to do 
with (probably spurious) spaces which means that the parbuilder then 
considers the dir node to be a reasoable breakpoint (well, kin dof okay 
as one gets what one asks for), but I'll be a bit more agressive in 
dealing with that.


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] typescripts and variants

2021-06-23 Thread Hans Hagen

On 6/23/2021 10:32 PM, Henning Hraban Ramm wrote:



Am 23.06.2021 um 21:42 schrieb Bruce Horrocks :



On 23 Jun 2021, at 07:43, Henning Hraban Ramm  wrote:

You can combine whatever you like in one typescript, but you’re restricted to 
six styles (regular, italic, slanted, bold, bold italic, bold slanted). You can 
just “abuse” the italic or slanted styles for your other weights.


If we're restricted to six styles why does this Wiki page show seven?


in principle one can define as many new ones as one wants ... it doesn't 
happen in practice





Not meant as a criticism - just a naive question from someone who is puzzled.


Yes, you could also abuse \sc for another style.

Small caps are a bit special though, nowadays they’re often contained in fonts 
and you address them via OpenType features.

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

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




--

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

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


Re: [NTG-context] typescripts and variants

2021-06-23 Thread Henning Hraban Ramm

> Am 23.06.2021 um 21:42 schrieb Bruce Horrocks :
> 
> 
>> On 23 Jun 2021, at 07:43, Henning Hraban Ramm  wrote:
>> 
>> You can combine whatever you like in one typescript, but you’re restricted 
>> to six styles (regular, italic, slanted, bold, bold italic, bold slanted). 
>> You can just “abuse” the italic or slanted styles for your other weights.
> 
> If we're restricted to six styles why does this Wiki page show seven?
> 
> 
> 
> Not meant as a criticism - just a naive question from someone who is puzzled.

Yes, you could also abuse \sc for another style.

Small caps are a bit special though, nowadays they’re often contained in fonts 
and you address them via OpenType features.

Hraban
___
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] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-23 Thread Hans Hagen

On 6/23/2021 10:00 PM, Jeong Dal wrote:


Hi,

Is there a way to deliver the value of a variable in MetaFun to ConTeXt.
For example, I want to do the following:

\starttext
\startMPcode
numeric maxCount;
% … some code
maxCount := 10;
\stopMPcode

dorecurse{maxCount}
{It is \recurselevel.\par}

\stoptext

Thank you for reading.

\newcount\MyCount

\starttext

\startMPcode
numeric maxCount;
maxCount := 10;
setglobalmacro("MyMacro",decimal maxCount);
setglobalcount("MyCount",maxCount);
\stopMPcode


\dorecurse{\MyMacro}{It is \recurselevel. }\par
\dorecurse{\MyCount}{It is \recurselevel. }\par

\stoptext


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

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


Re: [NTG-context] typescripts and variants

2021-06-23 Thread Bruce Horrocks

> On 23 Jun 2021, at 07:43, Henning Hraban Ramm  wrote:
> 
> You can combine whatever you like in one typescript, but you’re restricted to 
> six styles (regular, italic, slanted, bold, bold italic, bold slanted). You 
> can just “abuse” the italic or slanted styles for your other weights.

If we're restricted to six styles why does this Wiki page show seven?



Not meant as a criticism - just a naive question from someone who is puzzled.
—
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 / 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] Setup output name from within ConTeXt document

2021-06-23 Thread Hans Hagen

On 6/23/2021 4:57 PM, Pablo Rodriguez wrote:

On 6/23/21 9:26 AM, Hans Hagen wrote:

On 6/22/2021 1:55 PM, Pascal Pascali wrote:

Dear ConTeXt community,

Is it possible to set the file name of the output from within the document?

[...]
\startluacode
luatex.wrapup(
  function()
  os.remove("new.pdf")
  os.rename("old.pdf","new.pdf")
  end
)
\stopluacode


Many thanks for your reply, Hans.

Just a question, which is the gain of wrapping os.rename() in a function?
I'm not sure how you would do it differently. If you would not wrap it, 
it would be done immediately and that's not what you want (and the pdf 
file might already be open). Think of def vs edef ... When a function is 
called its actions are done immediately.


Hans


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

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


[NTG-context] splitting tables from csv with first row as header

2021-06-23 Thread Jan U. Hasecke

Hi all,

I have this sample:

\usemodule[database]

\setuppapersize [A6]

\setupTABLE
  [split=yes,
  header=repeat]

\defineseparatedlist
   [test]
   [separator={;}, % tab
before=\bTABLE,after=\eTABLE,
first=\bTR,last=\eTR,
left=\bTD,right=\eTD]

\starttext
\processdatabasefile[test][test.csv]

\stoptext


A test.csv is attached.

The table splits but no header is repeated.

I guess I have to define that the first row in the file is the header.

How to achieve this?

TIA
juh
A;B;C;D;E;F
1;2;3;4;5;6
2;3;4;5;6;7
3;4;5;6;7;8
4;5;6;7;8;9
5;6;7;8;9;10
6;7;8;9;10;11
7;8;9;10;11;12
8;9;10;11;12;13
9;10;11;12;13;14
10;11;12;13;14;15
11;12;13;14;15;16
12;13;14;15;16;17
13;14;15;16;17;18
14;15;16;17;18;19
15;16;17;18;19;20
16;17;18;19;20;21
17;18;19;20;21;22
18;19;20;21;22;23
19;20;21;22;23;24
20;21;22;23;24;25
21;22;23;24;25;26
4;5;6;7;8;9
5;6;7;8;9;10
6;7;8;9;10;11
7;8;9;10;11;12
8;9;10;11;12;13
9;10;11;12;13;14
10;11;12;13;14;15
11;12;13;14;15;16
12;13;14;15;16;17
13;14;15;16;17;18
14;15;16;17;18;19
15;16;17;18;19;20
16;17;18;19;20;21
17;18;19;20;21;22
18;19;20;21;22;23
19;20;21;22;23;24
20;21;22;23;24;25
21;22;23;24;25;26
___
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] rtl fontfallback family issue?

2021-06-23 Thread Alan Bowen
With the latest LMTX standalone (ConTeXt  ver: 2021.06.18) the Syriac text
is not printed.

\setupdirections[bidi=global, method=unicode]

\definefontfeature
   [syriac]
   [syriac]
   [language=dflt, script=syrc]

\definefallbackfamily[mainface][rm][Estrangelo Edessa]
[range={syriac},
features=syriac]

\definefontfamily[mainface][STIX Two Text]
\setupbodyfont[mainface, 18pt]

\starttext
Syriac

{
ܐܝܟ ܟܝܢܐ ܕܐܐܪܣ ܡܲܥܕܢܘܬܗܘܢ ܘܡܲܥܒܿܕܝܢ ܩܪ̈ܒܐ ܘܚܣܡܐ ܠܗܠܝܢ
}
\stoptext

The same is true if I use
\def\Syr{\definedfont[name:estrangeloedessa*syriac]}
and insert \Syr before the Syriac text.

I have the same issue with my Arabic font fallback but not with my Greek
font fallback.

Alan
___
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] typescripts and variants

2021-06-23 Thread Wolfgang Schuster

denis.ma...@unibe.ch schrieb am 23.06.2021 um 11:05:

Hi,


Am 23.06.2021 um 08:43 schrieb Henning Hraban Ramm :



Am 23.06.2021 um 00:17 schrieb denis.ma...@unibe.ch:

Hi
In my current project I need to use different variants if the Noto
Serif font (Regular, Medium, Semi Condensed Bold, Regular ExtraBold.) Is

my understanding of typescripts correct that I cannot have bold and extrabold
in the same typescript? And that I need a typescript for regular and one for the
semicondensed variants?

You can combine whatever you like in one typescript, but you’re restricted to

six styles (regular, italic, slanted, bold, bold italic, bold slanted). You can 
just
“abuse” the italic or slanted styles for your other weights.

... or use roman styles, if you don’t need roman.

Thanks for your help.
After playing a bit more with the different variants for loading fonts it looks 
like I don't even need to use typescripts. \definefontfamily works just as good:

\definefontfamily[mainface][rm][Noto Serif]
\definefontfamily[mainface-semicond][rm][Noto Serif]
   [tf=file:NotoSerif-SemiCondensed.ttf,
   it=file:NotoSerif-SemiCondensedItalic.ttf,
   bf=file:NotoSerif-SemiCondensedBold.ttf,
   bi=file:NotoSerif-SemiCondensedBoldItalic.ttf]

But, do typescripts have any advantages over that approach?


Even when you use \definefontfamily the internal font handling relies on 
the typescripts.


The advantage of hand written (or generated) typescripts is better 
reliability, most of the time you pass just a name to \definefontfamily 
and some font is chosen for each style but this can fail because all 
depends on the information in the font files. When you use a typescript 
each alternative is associated with a certain font file and almost no 
guess work is required.



Then, for fonts used only in specific contexts, you can also do something like
  
\definefont [TitleFont] [notoserifsemicondensedextrabold]

and use that with \TitleFont
But you will then also need \TitleMonoFont etc, whereas it seems easier to keep 
things consistent with \definefontfamily...

One thing I'm wondering about: Would it be possible to add a easy mechanism to 
switch to different variants of a font, say, to use the SemiCondensed variant 
or the ExtraCondensed or so? (Or does that already exist?)
And, what about adding more styles so that you could have Light, Medium, 
SemiBold, Bold, ExtraBold, Black etc. all defined in a single fontfamily? If 
that was available each font family would then define all the styles for one 
variant (SemiCondensed, ExtraCondensed, Condensed, each with 18 styles!)


You can add more alternatives (\it, \bf ...) to the font mechanism but 
this requires additional settings (\definebodyfont ...) to get it 
working. A limiting factor is that you have to stick to two-letter names 
for each alternative and the easier solution is to create additional 
typefaces.


Wolfgang

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

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


Re: [NTG-context] Setup output name from within ConTeXt document

2021-06-23 Thread Pablo Rodriguez
On 6/23/21 9:26 AM, Hans Hagen wrote:
> On 6/22/2021 1:55 PM, Pascal Pascali wrote:
>> Dear ConTeXt community,
>>
>> Is it possible to set the file name of the output from within the document?
> [...]
> \startluacode
> luatex.wrapup(
>  function()
>  os.remove("new.pdf")
>  os.rename("old.pdf","new.pdf")
>  end
> )
> \stopluacode

Many thanks for your reply, Hans.

Just a question, which is the gain of wrapping os.rename() in a function?

Many thanks for your help,

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] new upload lmtx

2021-06-23 Thread Pablo Rodriguez
On 6/18/21 11:46 PM, Hans Hagen wrote:
> Hi,
>
> End of the week so time to wrap up.
> [...]
> (2) (Pablo:) There is some progress with facing floats that Thomas will
> check out for real usage. So, still experimental.

Excellent news, Hans.

Many thanks for your work, Hans and Thomas.

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
___


[NTG-context] Proper ligatures in Malayalam

2021-06-23 Thread Ajith R

Hi,

I tried to make a document in Malayalam, an Indian language. However, 
the ligatures don't form as expected.


A minimal example is

\mainlanguage[ml]
\definefontfamily [malayalam] [ss] [Rachana] [features=malayalam-one]
\definefontfeature[default] [mode=node,kern=yes, liga=yes,tlig=yes, 
ccmp=yes,language=dflt, protrusion=quality, expansion=quality]

\setupbodyfont [malayalam]
\starttext
അദ്ധ്യായം
\stoptext

What setting am I missing?

The expected form is show in libre office with the same text and font, 
attached as an image



The sequence of Malayalam characters used is

U+0D05 U+0D26 U+0D4D U+0D27 U+0D4DU+0D2F U+0D3E U+0D2F U+0D02

Thanks,
ajith
___
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] Adjust Grid to last line textheight

2021-06-23 Thread denis.maier
I've tried adjusting interlinespacing, but it seems to make no difference :

==
\setupinterlinespace[
height=.72,
depth=.28,
top=2,
%top=0,
%top=5,
%top=1,
bottom=0,
%bottom=0.4,
%bottom=0,
%bottom=1,
%bottom=5,
line=2.8ex,
]

\setuplayout[grid=yes]
\showgrid
\starttext

\dorecurse{5}{\input knuth\par}

\stoptext
==

Even extreme values for top and bottom (e.g. 0 or 10) seem to make no 
difference at all.
What am I missing? Is that even the right place to make that adjustment ?

Denis

Von: ntg-context  Im Auftrag von 
denis.ma...@unibe.ch
Gesendet: Mittwoch, 23. Juni 2021 11:47
An: ntg-context@ntg.nl
Betreff: [NTG-context] WG: Adjust Grid to last line textheight

Hi,

I have to use grid typesetting and the grid has to be aligned to the last line 
of textheight. I have to replicate a layout made with Indesign where there 
seems to be a bit of additional spacing before the first line, whereas in 
ConTeXt that happens to be after the last line of the page (see attachment).

Is that possible?

I have already found the various grid snapping methods, but they seem to change 
how content is placed on the grid, not the placement of the grid itself.

===
\setuplayout[grid=yes]
\showgrid
\starttext

\input knuth

\stoptext
===

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
___


[NTG-context] WG: Adjust Grid to last line textheight

2021-06-23 Thread denis.maier
Hi,

I have to use grid typesetting and the grid has to be aligned to the last line 
of textheight. I have to replicate a layout made with Indesign where there 
seems to be a bit of additional spacing before the first line, whereas in 
ConTeXt that happens to be after the last line of the page (see attachment).

Is that possible?

I have already found the various grid snapping methods, but they seem to change 
how content is placed on the grid, not the placement of the grid itself.

===
\setuplayout[grid=yes]
\showgrid
\starttext

\input knuth

\stoptext
===

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] endash emdash

2021-06-23 Thread Jan U. Hasecke


Am 23.06.21 um 07:11 schrieb Jan U. Hasecke:

Dear all,

I am completely lost with a ridicously small problem.


This was a self motivation. ;-)


\starttext

--

---

–

\stoptext


ConTeXt creates two endash rules and a very long dash in the middle, as 
I expected.


But in my project I always get the plain source chars.


The culprit was

\setbreakpoints[compound]

Any idea why this command gives such an effect?

current version: 2021.06.10 23:13

juh
___
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] endash emdash

2021-06-23 Thread Jan U. Hasecke

Dear all,

I am completely lost with a ridicously small problem.


\starttext

--

---

–

\stoptext


ConTeXt creates two endash rules and a very long dash in the middle, as 
I expected.


But in my project I always get the plain source chars.

I have no idea where I accidentally misconfigured this. For which 
commands shall I grep in my sources?


TIA
juh
___
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] typescripts and variants

2021-06-23 Thread denis.maier
Hi,

> > Am 23.06.2021 um 08:43 schrieb Henning Hraban Ramm :
> >
> >
> >> Am 23.06.2021 um 00:17 schrieb denis.ma...@unibe.ch:
> >>
> >> Hi
> >> In my current project I need to use different variants if the Noto
> >> Serif font (Regular, Medium, Semi Condensed Bold, Regular ExtraBold.) Is
> my understanding of typescripts correct that I cannot have bold and extrabold
> in the same typescript? And that I need a typescript for regular and one for 
> the
> semicondensed variants?
> >
> > You can combine whatever you like in one typescript, but you’re restricted 
> > to
> six styles (regular, italic, slanted, bold, bold italic, bold slanted). You 
> can just
> “abuse” the italic or slanted styles for your other weights.
> 
> ... or use roman styles, if you don’t need roman.

Thanks for your help. 
After playing a bit more with the different variants for loading fonts it looks 
like I don't even need to use typescripts. \definefontfamily works just as good:

\definefontfamily[mainface][rm][Noto Serif]
\definefontfamily[mainface-semicond][rm][Noto Serif]
  [tf=file:NotoSerif-SemiCondensed.ttf,
  it=file:NotoSerif-SemiCondensedItalic.ttf,
  bf=file:NotoSerif-SemiCondensedBold.ttf,
  bi=file:NotoSerif-SemiCondensedBoldItalic.ttf]

But, do typescripts have any advantages over that approach?

Then, for fonts used only in specific contexts, you can also do something like
 
\definefont [TitleFont] [notoserifsemicondensedextrabold]
and use that with \TitleFont
But you will then also need \TitleMonoFont etc, whereas it seems easier to keep 
things consistent with \definefontfamily...

One thing I'm wondering about: Would it be possible to add a easy mechanism to 
switch to different variants of a font, say, to use the SemiCondensed variant 
or the ExtraCondensed or so? (Or does that already exist?)
And, what about adding more styles so that you could have Light, Medium, 
SemiBold, Bold, ExtraBold, Black etc. all defined in a single fontfamily? If 
that was available each font family would then define all the styles for one 
variant (SemiCondensed, ExtraCondensed, Condensed, each with 18 styles!)

My knowledge of fonts is quite limited so please excuse if that doesn't make 
sense or if I'm missing something obvious to others.

Best,
Denis

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

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


Re: [NTG-context] endash emdash

2021-06-23 Thread Hans Hagen

On 6/23/2021 7:21 AM, Jan U. Hasecke wrote:


Am 23.06.21 um 07:11 schrieb Jan U. Hasecke:

Dear all,

I am completely lost with a ridicously small problem.


This was a self motivation. ;-)


\starttext

--

---

–

\stoptext


ConTeXt creates two endash rules and a very long dash in the middle, 
as I expected.


But in my project I always get the plain source chars.


The culprit was

\setbreakpoints[compound]

Any idea why this command gives such an effect?

yes, so 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] Setup output name from within ConTeXt document

2021-06-23 Thread Hans Hagen

On 6/22/2021 1:55 PM, Pascal Pascali wrote:

Dear ConTeXt community,

Is it possible to set the file name of the output from within the document?
I can do it on the command line by adding --result="CustomName.pdf", but I'd 
need to do it according to certain variables in the content of the file itself...
Setupinteraction[title="CustomName.pdf"] will just set the internal pdf name, 
not the file system name.

Thank you for your help!


assuming that your run file is old.tex:

\startluacode
luatex.wrapup(
function()
os.remove("new.pdf")
os.rename("old.pdf","new.pdf")
end
)
\stopluacode

\starttext

test

\stoptest

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