[NTG-context] Hatch a cell : meta:hash:left

2021-01-16 Thread Fabrice Couvreur
Hi,
I seem to have seen a method for hatching the cell of a table, but maybe
it's my imagination. The following code does not work.
Thanks for your help.
Fabrice

## hatching.tex #

\setupcolors[state=start]
\usemodule[xwi]
\starttext
\startxtable
 [align={lohi,middle}, width=1.5cm,framecolor=purple]
\startxrow
\startxcell[background=color,backgroundcolor=paleturquoise]
  i
\stopxcell
\startxcell
 [background=meta:hash:left, meta:hash:linecolor=green]

\stopxcell
\startxcell
   0
\stopxcell
\startxcell
   1
\stopxcell
\startxcell
   2
\stopxcell
\stopxrow
\stopxtable
\stoptext


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

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


Re: [NTG-context] printing the current date

2021-01-10 Thread Fabrice L


> Le 10 janv. 2021 à 13:23, Peter Münster  a écrit :
> 
> Hi,
> 
> I would expect, that \currentdate prints the current date, but it does
> not:
> 
> --8<---cut here---start->8---
> \starttext
> \date[d=1]% first day of this month, ok
> 
> \date% again first day, last parameters are used, this is ok
> 
> \currentdate% same as \date, but I would expect the day of today...
> \stoptext
> --8<---cut here---end--->8---
> 
> How could I print the current date please?

For exemple:

 \date[][weekday,day,month,year] and \currenttime[h,{\,:\,},m] 

F.

> 
> TIA for any hints,
> -- 
>   Peter
> ___
> 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] MetaFun labels and xsized

2020-12-25 Thread Fabrice L
Hi,

> Le 25 déc. 2020 à 12:30, Pablo Rodriguez  a écrit :
> 
> Dear list,
> 
> I have this minimal MetaFun sample (the only one in my real document):
> 
>  \setupbodyfont[pagella]
>  \starttext
>  \startMPcode
>  pair a ; a := (1, 1) ;
>  pair b ; b := (1, 10) ;
>  pair c ; c := (10, 10) ;
>  pair d ; d := (10, 1) ;
>  draw (a--b--c--d--a) xsized .75TextWidth;
> 
>  draw thelabel.lft("α",a) ;
>  draw thelabel.lft("β",b) ;
>  draw thelabel.top("γ",c) ;
>  draw thelabel.rt("δ",d) ;
>  \stopMPcode
>  \stoptext
> 
> Is there a way to relate adapt the labels to the xsized positions used?

I’m sure somebody could find a more elegant solution, but here is a simple one:

 \setupbodyfont[pagella]
 \starttext
 \startMPcode
 pair a ; a := (1, 1) ;
 pair b ; b := (1, 10) ;
 pair c ; c := (10, 10) ;
 pair d ; d := (10, 1) ;
 path square ; 
 square := (a--b--c--d--cycle) xsized .75TextWidth ;
 
 draw square xsized .75TextWidth;

 draw thelabel.lft("α",point 0 of square) ;
 draw thelabel.lft("β",point 1 of square) ;
 draw thelabel.top("γ",point 2 of square) ;
 draw thelabel.rt("δ",point 3 of square) ;
 \stopMPcode
 \stoptext

Fabrice.

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

___
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] Check if two paths intersect in Metafun

2020-12-25 Thread Fabrice L
Hi,

> Le 25 déc. 2020 à 08:48, Jairo A. del Rio  a écrit :
> 
> Hi, list. I've got a question about paths and intersections. The following:
> 
> \starttext 
> \startMPpage
> path p[];
> 
> p[1] = fullcircle scaled 2cm;
> p[2] = unitsquare shifted (4cm,6cm);
> 
> if (known (p[1] intersectionpoint p[2])):
> 
> draw textext("yes");
> 
> else:
> 
> draw textext("no");
> fi;
> 
> \stopMPpage
> \stoptext
> 
> yields an error message: "The paths don't intersect". Is there a way to 
> intercept this error message and trigger an action instead? Thank you in 
> advance.

Instead of using « intersectionpoint » use « Intersectiontimes », this will 
give you the « time » of the intersection of the two paths. If the paths do not 
intersect, than the value is (-1,-1). So you could do something like:

pair checkintersec ;
checkintersec := p[1] intersectiontimes p[2] ;
If xpart(checkintersec) <> -1 : 
draw textext("yes »);
else: 
draw textext(« non »);
fi;

Fabrice.

> 
> Best regards,
> 
> Jairo
> ___
> 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
___


[NTG-context] Problem with \dfrac{}{} with lmtx updated

2020-12-24 Thread Fabrice Couvreur
Hi,
I just updated lmtx and I don't understand the error that occurs with the
\dfrac{}{}. Thank you.
Fabrice

#
\starttext
\m{f(x)=\dfrac{a + b\ln(x)}{x}}
\stoptext
#

tex error   > tex error on line 2 in file ./hans_21.tex: Math error:
parameter 'fractionnumup' in style 2 is not set


 \math_m_nop #1->\relax \ifmmode #1\else \normalstartimath
#1\normalstopimath
\fi
 \m{f(x)=\dfrac{a + b\ln(x)}{x}}



1 \starttext
2 >>  \m{f(x)=\dfrac{a + b\ln(x)}{x}}
3 \stoptext


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.


mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Thu Dec 24 16:30:13
___
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] Metafun: how to draw a straight line past the end points

2020-12-09 Thread Fabrice L
Hi,

> Le 9 déc. 2020 à 10:57, Otared Kavian  a écrit :
> 
> Hi,
> 
> I have a silly question: given two points in the plane
>   z1 = (1cm,3cm) ;
>   z2 = (5cm, 9cm) ;
> the command
>   draw z1 -- z2 withpen pencircle scaled .5pt ;
> draws the line segment joining z1 and z2. How could I draw the line segment 
> which goes a little further (say 1cm) than both the end points of this 
> segment (that is in this example, a point before z1 and a point after z2 on 
> the straight line) .
> Indeed it is possible to write the equation of the line and then compute by 
> hand the coordinates of the new end points, but I think there is a simpler 
> way in Metafun to do this.

The shortened operation is the solution ! See MetaFun manual section 1.18

\starttext
\startMPpage
z1 = (1cm,3cm) ;
z2 = (5cm, 9cm) ;
draw (z1--z2) shortened -1cm  withcolor blue ;
draw (z1--z2) withcolor red ;

\stopMPpage
\stoptext

Fabrice.

> 
> Thanks for any help: Otared
> 
> 
> ___
> 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] Several lines under a limit

2020-11-28 Thread Fabrice Couvreur
Hi Wolfgang,
I knew the \substack command exists with latex but not with context, thanks
a lot.
Fabrice

Le sam. 28 nov. 2020 à 16:29, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 28.11.2020 um 15:57:
> > Hi,
> > Is there a command that allows to write multiple lines under the command
> > \lim ?
> > I tried but ...
> > Cordially
> > Fabrice
> >
> > \starttext
> > \startformula
> >\lim_{
> >  \vbox{\startalign
> >\NC x \to 2 \NR
> >\NC x > 2   \NR
> >  \stopalign}}=+\infty
> > \stopformula
> > \stoptext
>
> \starttext
>
> \startformula
>\lim_{%
>  \startsubstack
>x \to 2 \NR
>x  >  2 \NR
>  \stopsubstack
>} = +\infty
> \stopformula
>
> \stoptext
>
> Wolfgang
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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] Several lines under a limit

2020-11-28 Thread Fabrice Couvreur
Hi,
Is there a command that allows to write multiple lines under the command
\lim ?
I tried but ...
Cordially
Fabrice

\starttext
\startformula
  \lim_{
\vbox{\startalign
  \NC x \to 2 \NR
  \NC x > 2   \NR
\stopalign}}=+\infty
\stopformula
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2020-11-26 Thread Fabrice L
Keith,

> Le 26 nov. 2020 à 12:12, Keith McKay  a écrit :
> Thanks Fabrice and Hans.
> 
> I now see I can simplify some lines of the code:
> 
> pp := ((xpart a[i])/cf*cm, (ypart a[i])/cf*cm); now becomes pp:= a[i];
> 
> and
> 
> pp := pp --- ((xpart a[i+1]/cf)*cm, (ypart a[i+1])/cf*cm); now becomes pp := 
> pp --- a[i +1] ;
> 
> However I still have the problem in the calculation of xcoord and ycoord 
> which are used in the creation of path pp:
>   
>   for squig = 1 step 1 until 15:
> 
>   xcoord := uniformdeviate(1) - 0.5 + (xpart a[i]/cf);
> 
>   ycoord := uniformdeviate(1) - 0.5+ (ypart a[i]/cf);
> 
>   pp := pp  .. {curl 100}(xcoord*cm, ycoord*cm);
> 
>   endfor;
> 
> I'm adding a small random amount to the x and ypart of the pair a[i] to 
> produce a path that is like a squiggle (gribouiller in French, according to 
> Google). I have to use cf to convert to the x and yparts to centimeters since 
> they seem to loose the centimeter units on separation. I can't see anyway 
> round this, or am I missing something?
> 
> Thanks
> Keith McKay

First « uniformdeviate(1) - 0.5 » could be modified to « uniformdeviate(0.5)».

To add noise, you can use the randomized function of Metafun. For exemple, you 
can write:

draw pp randomized 1cm ;

Fabrice.



> 
> On 26/11/2020 15:19, Fabrice L wrote:
>> Hi keith,
>> 
>>> Le 26 nov. 2020 à 10:09, Keith McKay >> <mailto:mckaymeis...@gmail.com>> a écrit :
>>> 
>>> Hi,
>>> 
>>> I have been using xpart and ypart to extract these values from pairs of 
>>> points in a path but I wasn't getting the correct result. I was expecting:
>>> 
>>> pair (2cm, 11cm) to give xpart 2 and ypart 11
>>> 
>>> However I was getting:
>>> 
>>> pair (2cm, 11cm) -> xpart 56.6929 and ypart 311.8096
>>> 
>>> After much head scratching and reading the MetaPost and MetaFun manuals, I 
>>> realised that the units of xpart or ypart are in Postcript points or Big 
>>> Points (bp), and 1 bp is 1/72 of an inch, and thus to get the values of 
>>> xpart or ypart in cm I would have to use a correction factor. I had made 
>>> the assumption that since the x and ypart in the pair was in cm that the 
>>> result would be in cm, but I see now that this is not the case. Will I have 
>>> to continue doing this or is there some magic within MetaFun which takes 
>>> account of the units in a pair and outputs the result of x and ypart in the 
>>> same units?
>>> 
>>> The MWE belows shows what I have been doing.
>>> 
>>> Thanks
>>> 
>>> Keith McKay
>>> 
>>> %%% MWE %%%
>>> \setuppapersize [A5, landscape][A4, portrait]
>>> \usecolors[crayola]
>>> \starttext
>>> \startMPpage
>>> StartPage;
>>> width := PaperWidth ; height := PaperHeight ; unit := cm ;
>>> numeric squig;
>>> pair a[]; a0 = (2cm,11cm);  a1 = (4cm,10cm);  a2 = (6cm,9cm);  a3 = 
>>> (8cm,8cm);
>>> show xpart a[0], ypart a[0]; %Example of result from x and ypart before 
>>> applying correction factor (cf) %
>>> cf := 72/2.54; %Converts points/in to points/cm%
>>> path pp;
>>> for i = 0 step 1 until 3:
>>> pp := ((xpart a[i])/cf*cm, (ypart a[i])/cf*cm);
>>> for squig = 1 step 1 until 15:
>>> xcoord := uniformdeviate(1) - 0.5 + (xpart a[i]/cf);
>>> ycoord := uniformdeviate(1) - 0.5+ (ypart a[i]/cf);
>>> pp := pp  .. {curl 100}(xcoord*cm, ycoord*cm);
>>> endfor;
>>> pp := pp --- cycle;
>>> if i < 3 :
>>> pp := pp --- ((xpart a[i+1]/cf)*cm, (ypart a[i+1])/cf*cm);
>>> fi; 
>>> f :=((1.4 - 0.6) * uniformdeviate(1)) + 0.8; % Factor to lighten/darken 
>>> colour %
>>> draw pp withpen pencircle xscaled 0.5mm yscaled .1mm rotated 45 
>>> withcolor (f[white,\MPcolor{BurntSienna}]);
>>> endfor;
>>> StopPage;
>>> \stopMPpage
>>> \stoptext
>>> %%
>>> 
>> 
>> MetaPost (MetaFun) is taking care of everything regarding units. As you ave 
>> discovered, everything is translated to a unique internal dimension. So you 
>> can write:
>> 
>>  a := (1cm,2in) ;
>> 
>> with no problem. The « cm » and « in » parts of the exp

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

2020-11-26 Thread Fabrice L
Hi keith,

> Le 26 nov. 2020 à 10:09, Keith McKay  a écrit :
> 
> Hi,
> 
> I have been using xpart and ypart to extract these values from pairs of 
> points in a path but I wasn't getting the correct result. I was expecting:
> 
> pair (2cm, 11cm) to give xpart 2 and ypart 11
> 
> However I was getting:
> 
> pair (2cm, 11cm) -> xpart 56.6929 and ypart 311.8096
> 
> After much head scratching and reading the MetaPost and MetaFun manuals, I 
> realised that the units of xpart or ypart are in Postcript points or Big 
> Points (bp), and 1 bp is 1/72 of an inch, and thus to get the values of xpart 
> or ypart in cm I would have to use a correction factor. I had made the 
> assumption that since the x and ypart in the pair was in cm that the result 
> would be in cm, but I see now that this is not the case. Will I have to 
> continue doing this or is there some magic within MetaFun which takes account 
> of the units in a pair and outputs the result of x and ypart in the same 
> units?
> 
> The MWE belows shows what I have been doing.
> 
> Thanks
> 
> Keith McKay
> 
> %%% MWE %%%
> \setuppapersize [A5, landscape][A4, portrait]
> \usecolors[crayola]
> \starttext
> \startMPpage
> StartPage;
> width := PaperWidth ; height := PaperHeight ; unit := cm ;
> numeric squig;
> pair a[]; a0 = (2cm,11cm);  a1 = (4cm,10cm);  a2 = (6cm,9cm);  a3 = (8cm,8cm);
> show xpart a[0], ypart a[0]; %Example of result from x and ypart before 
> applying correction factor (cf) %
> cf := 72/2.54; %Converts points/in to points/cm%
> path pp;
> for i = 0 step 1 until 3:
>   pp := ((xpart a[i])/cf*cm, (ypart a[i])/cf*cm);
>   for squig = 1 step 1 until 15:
>   xcoord := uniformdeviate(1) - 0.5 + (xpart a[i]/cf);
>   ycoord := uniformdeviate(1) - 0.5+ (ypart a[i]/cf);
>   pp := pp  .. {curl 100}(xcoord*cm, ycoord*cm);
>   endfor;
>   pp := pp --- cycle;
>   if i < 3 :
>   pp := pp --- ((xpart a[i+1]/cf)*cm, (ypart a[i+1])/cf*cm);
>   fi; 
>   f :=((1.4 - 0.6) * uniformdeviate(1)) + 0.8; % Factor to lighten/darken 
> colour %
>   draw pp withpen pencircle xscaled 0.5mm yscaled .1mm rotated 45 
> withcolor (f[white,\MPcolor{BurntSienna}]);
> endfor;
> StopPage;
> \stopMPpage
> \stoptext
> %%
> 

MetaPost (MetaFun) is taking care of everything regarding units. As you ave 
discovered, everything is translated to a unique internal dimension. So you can 
write:

 a := (1cm,2in) ;

with no problem. The « cm » and « in » parts of the expression will become 
numbers to translate this number on the right unit. 
Fabrice.
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <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] startCSV Wiki, Natural Table

2020-11-24 Thread Fabrice L


> Le 24 nov. 2020 à 13:36, Wolfgang Schuster 
>  a écrit :
> 
> Fabrice L schrieb am 24.11.2020 um 19:08:
>>> Le 24 nov. 2020 à 12:52, Wolfgang Schuster 
>>>  a écrit :
>>> 
>>> Fabrice L schrieb am 24.11.2020 um 18:44:
>>>> Hi,
>>>> I was using in the past (MKII) a snippet of code to produce (natural) 
>>>> tables from CSV. I was trying to compile my code with MKIV, but this does 
>>>> not work anymore. As a matter of fact, it doe snot work at all, nor MKII, 
>>>> nor MKIV (probably my error !).
>>>> So I came back to the wiki, where my code came from, and the code below is 
>>>> just a copy for the wiki. It is supposed to make a table with three 
>>>> columns, but there is only one column in the resulting table…  I admit I 
>>>> do not understand the code, but is there is missing \eTR somewhere ?
>>> Use the database module.
>>> 
>>> \usemodule[database]
>>> 
>>> \defineseparatedlist
>>>  [CSV]
>>>  [separator={,},
>>>  before=\bTABLE,
>>>   after=\eTABLE,
>>>   first=\bTR,
>>>last=\eTR,
>>>left=\bTD,
>>>   right=\eTD]
>>> 
>>> \starttext
>>> 
>>> \startCSV
>>> 1,2,3
>>> 3,5,6
>>> 7,8,9
>>> \stopCSV
>>> 
>>> \stoptext
>>> 
>>> Wolfgang
>> Wolfgang, thanks. I have seen the use if the database module on the wiki, 
>> but was trying to do without it, the reason is that my documents are often 
>> shared with colleagues, for which installation of modules is most often very 
>> difficult.
> 
> There is nothing to install because the database module is part of ConTeXt.

I see… wonderfull ! Thanks a lot for the help. 
> 
> Wolfgang

Fabrice.___
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] startCSV Wiki, Natural Table

2020-11-24 Thread Fabrice L


> Le 24 nov. 2020 à 12:52, Wolfgang Schuster 
>  a écrit :
> 
> Fabrice L schrieb am 24.11.2020 um 18:44:
>> Hi,
>> I was using in the past (MKII) a snippet of code to produce (natural) tables 
>> from CSV. I was trying to compile my code with MKIV, but this does not work 
>> anymore. As a matter of fact, it doe snot work at all, nor MKII, nor MKIV 
>> (probably my error !).
>> So I came back to the wiki, where my code came from, and the code below is 
>> just a copy for the wiki. It is supposed to make a table with three columns, 
>> but there is only one column in the resulting table…  I admit I do not 
>> understand the code, but is there is missing \eTR somewhere ?
> 
> Use the database module.
> 
> \usemodule[database]
> 
> \defineseparatedlist
>  [CSV]
>  [separator={,},
>  before=\bTABLE,
>   after=\eTABLE,
>   first=\bTR,
>last=\eTR,
>left=\bTD,
>   right=\eTD]
> 
> \starttext
> 
> \startCSV
> 1,2,3
> 3,5,6
> 7,8,9
> \stopCSV
> 
> \stoptext
> 
> Wolfgang

Wolfgang, thanks. I have seen the use if the database module on the wiki, but 
was trying to do without it, the reason is that my documents are often shared 
with colleagues, for which installation of modules is most often very 
difficult. 
Anyway, I will use the database module this time, so simple ! Thanks again.

Fabrice
___
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] startCSV Wiki, Natural Table

2020-11-24 Thread Fabrice L
Hi,

I was using in the past (MKII) a snippet of code to produce (natural) tables 
from CSV. I was trying to compile my code with MKIV, but this does not work 
anymore. As a matter of fact, it doe snot work at all, nor MKII, nor MKIV 
(probably my error !). 

So I came back to the wiki, where my code came from, and the code below is just 
a copy for the wiki. It is supposed to make a table with three columns, but 
there is only one column in the resulting table…  I admit I do not understand 
the code, but is there is missing \eTR somewhere ?

Thanks for any help.
Fabrice.

Ps: in case someone is interested, I use this to produce statistical tables for 
teaching. I can share.. ! 

% --
\starttext

% Iterate over all the lines of text captured with \obeylines active
% command to call is first argument, is not called for empty lines
\bgroup
\obeylines
\gdef\ProcessLines#1#2{\doProcessLines{#1}#2^^M\doProcessLines}%
\gdef\doProcessLines#1#2^^M#3\doProcessLines{%
 \doifnotempty{#2}{#1{#2}}%
 \doifnotempty{#3}{\doProcessLines{#1}#3\doProcessLines}%
}%
\egroup

\def\startCSV{\bgroup\obeylines\dostartCSV}

\def\TBLentry#1{\bTD#1\eTD}
\def\TBLline#1{\bTR\processcommalist[#1]\TBLentry}

\def\dostartCSV#1\stopCSV{%
  \bTABLE
  \ProcessLines\TBLline{#1}%
  \eTABLE
  \egroup
}

% some additional settings for the table may be made as well
\setupTABLE[c][2][style=\tt]
\setupTABLE[c][3][align=middle]
\setupTABLE[r][1][style=bold] 

\startCSV
Name,Email,Accepted
\CONTEXT,wo...@trying.to,Yes
Hans,m...@developer.of,Yes
Bug,g...@rid.of,No
\stopCSV

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

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


Re: [NTG-context] MacOS+TeXlive: installation problems

2020-11-17 Thread Fabrice L
Hi,

> Le 17 nov. 2020 à 15:23, Tomas Hala  a écrit :
> 
> Hi all,
> 
> one student of mine asked me for a help with installation TeXlive 
> (from http://www.tug.org/mactex/mactex-download.html) 
> on her MacBook Air 16 with macOS Catalina.
> 
> Despite the fact that the site states 
> "All install packages are developer-signed and notarized by Apple.",
> she got:
> "Cannot be opened because its from unidentified developer, MacOS cannot 
> verify that this app is free from malware."
> 
> What could it be? 
> I have got no experience with MacOS, so I would like to ask for some hints 
> how we can fix it.

The solution is rather simple, check here:
https://support.apple.com/en-us/HT202491 
<https://support.apple.com/en-us/HT202491>
or
https://support.apple.com/en-ca/guide/mac-help/mh40616/macAfter 
<https://support.apple.com/en-ca/guide/mac-help/mh40616/macAfter>

> 
> Thanks in advance.
> Best wishes,
> Tomáš

Fabrice.___
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] Import a metapost extension

2020-09-02 Thread Fabrice Couvreur
Hello,
That's okay, I'll compile the files with mpost and do an image insert. Thanks
for your help.
Fabrice

Le mar. 1 sept. 2020 à 19:32, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Taco Hoekwater schrieb am 01.09.2020 um 19:12:
>
> Hi,
>
>
> On 1 Sep 2020, at 16:46, Hans Hagen   
> wrote:
>
> On 9/1/2020 3:04 PM, Fabrice Couvreur wrote:
>
> Hi Taco,
> Thank you for your help. I specify that this extension works perfectly by 
> compiling the following file.
>
> A logfile of a failed run would have been more helpful in trying to track 
> down the problem. But I did notice that there is a LaTeX file loaded in your 
> succesful run. So perhaps the extension depends on LaTeX
>
>
> I looked for the file online [1] and it uses LaTeX commands (even
> begin/end blocks) for all text boxes.
>
> [1] https://melusine.eu.org/syracuse/poulecl/mp-scratch/
>
> 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
>
> ___
>
___
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] Import a metapost extension

2020-09-01 Thread Fabrice Couvreur
Hi Taco,
Thank you for your help. I specify that this extension works perfectly by
compiling the following file.

input mp-scratch;

Scratchversion:=3;

beginfig(1);
  draw Drapeau;
  draw Repeter("4");
  draw Avancer("100");
  draw Tournerd("90");
  draw FinBlocRepeter;
  endfig;
end


But what you are proposing unfortunately does not work.
Fabrice

Le mar. 1 sept. 2020 à 14:25, Taco Hoekwater  a écrit :

> Hi,
>
> I think you need this:
>
> \startMPinclusions
>   input mp-scratch;
> \stopMPinclusions
>
> \startMPcode
>   Scratchversion:=3;
>   ….
>
> If that also doesn’t work, perhaps attach the log file / terminal output
> to a new message.
>
> Best wishes,
> Taco
>
> > On 1 Sep 2020, at 13:07, Fabrice Couvreur 
> wrote:
> >
> > Hello
> > Is it possible to import a metapost extension into a file compiled with
> the lmtx engine ?
> > I tried unsuccessfully with this example :
> >
> >  begin test.tex
> >
> > \starttext
> > \startMPcode
> >   input mp-scratch;
> >
> > Scratchversion:=3;
> >
> > draw Drapeau;
> > draw Repeter("4");
> > draw Avancer("50");
> > draw Tournerd("90");
> > draw FinBlocRepeter;
> >
> > \stopMPcode
> > \stoptext
> >
> >  end test.tex
> >
> > Thanks
> > Fabrice
> >
> ___
> > 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
> >
> ___
>
> Taco Hoekwater
> Elvenkind BV
>
>
>
>
>
> ___
> 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
>
> ___
>
This is MetaPost, version 2.00 (TeX Live 2020) (kpathsea version 6.3.2)  1 SEP 2020 15:01
**scratch-1.mp
(/home/viserion/texlive/2020/texmf-dist/metapost/base/mpost.mp
(/home/viserion/texlive/2020/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) ) (./scratch-1.mp
(/home/viserion/texmf/metapost/mp-scratch.mp
(/home/viserion/texmf/metapost/LATEXScratch.mp)
(/home/viserion/texmf/metapost/Mouvement.mp)
(/home/viserion/texmf/metapost/Apparence.mp)
(/home/viserion/texmf/metapost/Sons.mp) (/home/viserion/texmf/metapost/Stylo.mp
) (/home/viserion/texmf/metapost/Controle.mp)
(/home/viserion/texmf/metapost/Evenements.mp)
(/home/viserion/texmf/metapost/Bloc.mp)
(/home/viserion/texmf/metapost/Divers.mp)
(/home/viserion/texmf/metapost/Capteurs.mp)
(/home/viserion/texmf/metapost/Variable.mp)) (./mptextmp.mp) (./mptextmp.mp)
>> 34.55159
>> 55.29037 (./mptextmp.mp) (./mptextmp.mp)
>> 105.50436 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp)
(./mptextmp.mp) (./mptextmp.mp)
>> 39.74248
>> 63.32898 (./mptextmp.mp) (./mptextmp.mp)
>> 84.05197 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp)
(./mptextmp.mp) (./mptextmp.mp)
>> 56.92798
>> 92.35968 (./mptextmp.mp) (./mptextmp.mp)
>> 112.43477 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp)
(./mptextmp.mp) (./mptextmp.mp)
>> 97.13678
>> 127.64769 (./mptextmp.mp) (./mptextmp.mp)
>> 171.08908 (./mptextmp.mp) [1{psfonts.map}{crlt_csjzgd.enc}] )
1 output file written: scratch-1.1

___
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] Import a metapost extension

2020-09-01 Thread Fabrice Couvreur
Hello
Is it possible to import a metapost extension into a file compiled with the
lmtx engine ?
I tried unsuccessfully with this example :

 begin test.tex

\starttext
\startMPcode
  input mp-scratch;

Scratchversion:=3;

draw Drapeau;
draw Repeter("4");
draw Avancer("50");
draw Tournerd("90");
draw FinBlocRepeter;

\stopMPcode
\stoptext

%%%% end test.tex

Thanks
Fabrice
___
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] Mathematical symbol of non-inclusion

2020-08-31 Thread Fabrice Couvreur
Hi Hans,
Thank you for the clarification
Fabrice

Le dim. 30 août 2020 à 17:56, Hans Åberg  a écrit :

>
> > On 30 Aug 2020, at 11:40, Fabrice Couvreur 
> wrote:
> >
> > @Hans My ignorance is total : how to write symbols from the keyboard ?
>
> I use text substitutions on MacOS: a sequence of characters can be
> automatically translated into another. So for example, ".subset" might
> translate into "⊂" as you type along. To find the ⊂ the first time, there
> is a Unicode symbol table. Other platforms and editors have similar
> features. There are other ways, but I have found this easiest and fastest
> both to create and use.
>
>
>
> ___
> 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] Mathematical symbol of non-inclusion

2020-08-30 Thread Fabrice Couvreur
Hello,
Thank you for your answers.
@Hans My ignorance is total : how to write symbols from the keyboard ?
Fabrice

Le sam. 29 août 2020 à 20:41, Hans Åberg  a écrit :

>
> > On 29 Aug 2020, at 19:58, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> wrote:
> >
> > Fabrice Couvreur schrieb am 29.08.2020 um 19:27:
> >> Hello,
> >> The result is not what you expected.
> >> How can I correct this problem?
> >
> > 1. Wait for a fix.
> >
> > 2. Use \nsubset.
> >
> > \starttext
> > \m{A \nsubset B}
> > \stoptext
>
> One can also use Unicode directly, choosing the style:
>
> \starttext
> \m{A ⊄ B ⊈ C ⊊ D}
> \stoptext
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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] Mathematical symbol of non-inclusion

2020-08-29 Thread Fabrice Couvreur
Hello,
The result is not what you expected.
How can I correct this problem?
Thank you
Fabrice

\starttext
\m{A \not\subset B}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Label to delete in the table of contents

2020-08-24 Thread Fabrice Couvreur
Thanks !!

Le lun. 24 août 2020 à 15:41, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 24.08.2020 um 15:32:
>
> Hi Wolfgang,
> Thank you for your reply. Probably my fault but now I get the number 0 on
> the word "Summary".
> Fabrice
> [image: contents.png]
>
>
> \setuphead
>   [title]
>   [command=,
>numbercommand=]
>
> 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
>
> ___
>
___
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] Label to delete in the table of contents

2020-08-24 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you for your reply. Probably my fault but now I get the number 0 on
the word "Summary".
Fabrice
[image: contents.png]

Le lun. 24 août 2020 à 15:12, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 23.08.2020 um 16:02:
>
> Hello,
> For the title of the chapters I use the following command.
>
> \unexpanded\def\HeadTitle#1#2%
>{\framed
>   [frame=off,
>width=fit,
>align=flushleft]
>{\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
> \blank#1\blank#2}
>
> When I compile my project, I have the label "Chapitre" above the word
> "Sommaire" in the table of contents : how to delete it ?
>
>
> 1. Don't apply the command to \title
>
> \setuphead[title][command=]
>
>
> 2. Make the command local to bodypart of your document, this works only
> when you use section blocks (e.g. \startbodymatter)
>
> \startsectionblockenvironment[bodypart]
> \setuphead[chapter][command=\HeadTitle]
> \stopsectionblockenvironment
>
>
> 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
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Color specific cells in a table

2020-08-23 Thread Fabrice Couvreur
Hello,
This table will be used to illustrate Pascal's triangle. I manage to color
the cell (2,0) but I would also like to color the cells (2,1) and (3,1). Is
it possible ?
Thank you
Fabrice

\usecolors[X11]

\starttext
\startluacode

  local background_one = {
   align = "middle",
   style = "type",
   background = "color",
   backgroundcolor = "thistle2",
   foregroundcolor = "white",
  }

   local background_two = {
   align = "middle",
   style = "type",
   background = "color",
   backgroundcolor = "peachpuff",
   foregroundcolor = "white",
  }

  context.startxtable({"align={middle,lohi},
width=1cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"})
  context.startxrow()
  context.startxcell({"background=color,backgroundcolor=thistle2"})
  context("")
  context.stopxcell()
  for j = 0, 7 do

context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"})
  context(j)
  context.stopxcell()
  end

context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"})
  context("\\dots")
  context.stopxcell()
  context.stopxrow()
  for i = 0, 7 do
  context.startxrow()

context.startxcell({"foregroundstyle=bold,background=color,backgroundcolor=thistle2"})
  context(i)
  context.stopxcell()
  for j = 0, 8 do
  context.startxcell(j>i and background_one or i == 2 and j == 0 and
background_two)
  context("")
  context.stopxcell()
  end
  context.stopxrow()
  end
  context.startxrow()
  context.startxcell({"background=color,backgroundcolor=thistle2"})
  context("\\dots")
  context.stopxcell()
  for i = 0, 8 do
  context.startxcell()
  context("")
  context.stopxcell()
  end
  context.stopxrow()
  context.stopxtable()
\stopluacode
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Label to delete in the table of contents

2020-08-23 Thread Fabrice Couvreur
Hello,
For the title of the chapters I use the following command.

\unexpanded\def\HeadTitle#1#2%
   {\framed
  [frame=off,
   width=fit,
   align=flushleft]
   {\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
\blank#1\blank#2}

When I compile my project, I have the label "Chapitre" above the word
"Sommaire" in the table of contents : how to delete it ?
Thanks for your help
Fabrice
___
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] Chapter number with Luametafun

2020-08-18 Thread Fabrice Couvreur
Hello,
How to get the number of the current chapter ?
How to get the label "Chapitre" ?
Thanks for your help.
Fabrice

%%% Begin example

\mainlanguage[fr]

\setcharacterspacing [frenchpunctuation]

\setuplabeltext[fr][chapter=Chapitre~]

\startuseMPgraphic{fun}
  definecolor[name="Mycolor", s = 0.85 ]
  draw lmt_outline
   [
text = "1",
kind = "fillup",
fillcolor = "Mycolor",
rulethickness = 1,
   ]
  xsized 1cm;
\stopuseMPgraphic

\unexpanded\def\MyNumber#1{\useMPgraphic{fun}#1}

\unexpanded\def\Title#1#2{\framed[frame=off,width=fit,align=flushleft]
  {#1\blank#2}}

\setuphead[chapter]
  [style=\bfd,
   align={flushleft,broad},
   command=\Title,
   textcommand=\MyNumber,
   numbercommand=\groupedcommand{}{\MyNumber},
   number=no]

\starttext
\startchapter
  [title={First chapter}]
  \input knuth.tex
\stopchapter
\startchapter
  [title={Second chapter}]
  \input knuth.tex
\stopchapter
\stoptext

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

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


Re: [NTG-context] About the numbering of theorems

2020-08-08 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you
Fabrice

Le ven. 7 août 2020 à 19:45, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 07.08.2020 um 16:30:
> > Hello,
> > I have a little problem with the numbering of theorems when there is no
> > subsection. I would like to know :
> >
> > Theorem 1.1
> > Theorem 1.2
> >
> > Theorem 2.3
> > Theorem 2.4
> >
> > Thank you
> > Fabrice
>
> Use a conversion set to set the number conversion for you sections and
> remove the conversion setting (\setuphead[...][conversion=...]) from the
> setups.
>
> \defineconversionset [fabrice] [n,n,R,n] [n]
>
> \setupheads
>[sectionconversionset=fabrice]
>
> 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
>
> ___
>
___
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] About the numbering of theorems

2020-08-07 Thread Fabrice Couvreur
Hello,
I have a little problem with the numbering of theorems when there is no
subsection. I would like to know :

Theorem 1.1
Theorem 1.2

Theorem 2.3
Theorem 2.4

Thank you
Fabrice

 begin example

\setuplabeltext[chapter=Chapitre~]

\unexpanded\def\Title#1#2{\framed[frame=off,width=fit,align=flushleft]{#1\blank#2}}

\startbuffer[mybuffer]
  \starttheorem
\input ward
  \stoptheorem
\stopbuffer

\setuphead
  [chapter]
  [style=\bfd,
   align={flushleft,broad},
   command=\Title]

\setuphead
  [section]
  [style=\bfc,
   distance=\zeropoint,
   sectionsegments=section,
   conversion={R},
   align={flushleft,broad},
   commandbefore={\space\endash\space}]

\setuphead
  [subsection]
   [sectionsegments=subsection,
conversion={n},
style=\bfb,
align={flushleft,broad}]

\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   title=yes,
   prefix=yes,
   prefixsegments=chapter,
   titlestyle=bold,
   width=broad]

\defineenumeration
   [theorem]
   [text=Théorème,
number=yes,
style=italic]

\starttext
\startchapter
  [title={First chapter}]
  \startsection
[title={First section}]
\startsubsection
  [title={First subsection}]
  \dorecurse{2}{\getbuffer[mybuffer]}
\stopsubsection
  \stopsection
\stopchapter
\startchapter
  [title={Second chapter}]
  \startsection
[title={Second section}]
 \dorecurse{2}{\getbuffer[mybuffer]}
  \stopsection
  \stoptheorem
\stopchapter

\stoptext

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

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


Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25

2020-08-05 Thread Fabrice Couvreur
Hello,
I also use a square to complete a demonstration. I tried this without
success
Thank you
Fabrice

\definesymbol[Fin][\mathematics{\square}]
\def\qed{\strut\wordright{\symbol[Fin]}}

\defineenumeration
  [proof]
  [text=Démonstration,
   alternative=serried,
   distance=\zeropoint,
   number=no,
   headstyle=boldslanted,
   width=broad,
   closesymbol={\symbol[\qed]}]

\starttext
\startproof
\startformula
a^2 + b^2 = c^2
\stopformula
\stopproof
\stoptext


Le mar. 4 août 2020 à 14:02, Otared Kavian  a écrit :

> Hi Hans,
>
> Thanks for the hint which consists in adding an \ifmmode to the definition
> of \qed.
> However, as you suggest, one needs some other mechanism in math mode,
> since with your new definition of \qed the alignment of the formula changes
> when one adds this close symbol:
>
>  begin-example-qed.tex
> \definesymbol[Fin][\mathematics{\square}]
> \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi}
> \starttext
> \startformula
> a^2 + b^2 = c^2.
> \stopformula
> \startformula
> a^2 + b^2 = c^2. \qed
> \stopformula
> One sees that\type{\qed} in the formula changes the alignment of the
> formula. \qed
> \stoptext
>  end-example-qed.tex
>
> Thanks a lot for everything: Otared
>
> > On 4 Aug 2020, at 13:24, Hans Hagen  wrote:
> >
> > On 8/4/2020 11:17 AM, Otared Kavian wrote:
> >> Thanks Hans for your explanations.
> >> The problem I encountered is that, the command \qed is used dozens of
> time in my text without any issue because it was preceded by something on
> th eline, but the only place where it was alone after a formula resulted in
> the error and it was not easy for me to isolate the issue…
> >> By the way, in mkii it was possible to add \qed on the last line of a
> math formula, but that does not work anymore:
> >> \definesymbol[Fin][\mathematics{\square}]
> >> \def\qed{\strut\wordright{\symbol[Fin]}}
> >> \starttext
> >> \startformula
> >> a^2 + b^2 = c^2. \qed
> >> \stopformula
> >> The above formula does not show the close symbol.\qed
> >> \stoptext
> >> Is there a way to have something like \qed work in math formulas?
> > because that's now hwpo wordright works ...
> >
> > \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi}
> >
> > but we probably need something different, something that hooks into
> display math
> >
> > 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
>
> ___
>
___
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] Notation of the first derivative in mathematical mode (lmtx)

2020-08-03 Thread Fabrice Couvreur
Hello,
I replaced the context engine with the lmtx engine but I find that the
derivative symbol is too high regardless of the font used.
I mainly use modern and pagella because I type many texts using
mathematics: can we correct this problem,
Thanks for your help.
Fabrice

\starttext
\startitemize[n]
  \startitem
\math{f'(x)=x²+4x+4}
  \stopitem
  \startitem
 \math{f''(x)=2x+4}
  \stopitem
\stopitemize
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Height of parentheses in a matrix with lmtx

2020-07-28 Thread Fabrice Couvreur
Hi Hans,
With the upgraded version of lmtx, the parentheses of the matrix are no
longer adjusted to the content.
Thank you.
Fabrice

\definemathmatrix [pmatrix][matrix:parentheses][simplecommand=MATRIX]

\starttext

\math{\MATRIX{\MPcode{draw (0,0) -- (1cm,0);}  ;\MPcode{draw (0,0) --
(1cm,0);} }}

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

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


Re: [NTG-context] upload

2020-07-28 Thread Fabrice Couvreur
Hi Hans,
I updated the version of lmtx and wanted to test the following code

\useMPlibrary[dum]
\starttext
\placefigure[right]{}{\externalfigure[dummy]}
\input ward\par
\placefigure[right]{}{\externalfigure[dummy]}
{\bf \input ward} \par
\stoptext

This returns the error message

runtime error : input file 'ward}.tex' is not found, quitting
mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Tue Jul 28 10:57:55

Thank you
Fabrice

Le lun. 27 juil. 2020 à 16:42, Hans Hagen  a écrit :

> Hi,
>
> Normally we don't report on successive loe level improvements in the
> engine or the core of context (we do so in articles and wrapups), and
> much goes unnoticed anyway (which is good). But ... the last couple of
> weeks we have been playing with some adapted functionality in lmtx and
> some of the experimental low level code has now made it in core.
> Normally users will not notice this but who knows.
>
> There are already features in lmtx that are not (and are unlikely to be)
> in mkiv (most significant in the metapost related part). When possible
> new macros and additions to mechanism will be in both mkiv and lmtx, but
> lmtx users will be better off in the end. We're mostly talking of the
> more tricky mechanisms here, those that currently have limitations due
> to all kind of possible interferences. To summarize:
>
> mkii : frozen (seldom patches)
> lmtx : cutting edge
> mkiv : when possible following lmtx, otherwise frozen
>
> Because we develop lmtx and luametatex alongside it is no problem if we
> have experimental (and even temporary imperfect) code in the engine:
> context knows about it and especially with experiments, we try to make
> sure it doesn't hit users (who we don't expect to use those, often
> undocumented, new tricks anyway). It's sometimes the only way to go
> forward (stepwise testing).
>
> So, here is an example of where lmtx can do better than mkiv:
>
> \placefigure[left]{}{}  \input ward  \par
> \placefigure[left]{}{} {\bf \input ward} \par
>
> Another area is in using footnotes. As a first step to more robust
> handling of deeply nested notes, lmtx now defaults to (the more than a
> decade optional in mkiv) \automigrateinserts, but with less overhead
> (for performance reasons, it was never enabled in mkiv, apart from
> occasional side effects). It is features like these that will stepwise
> be improved, at least that is what we hope for.
>
> So, the current upload has some new stuff, hopefully without too many
> side effects, but if so, we'll deal with it as usual. As a result, the
> latest lmtx could be a little slower, but I wonder if someone will
> notice it in practice.
>
> 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
>
> ___
>
___
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] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Fabrice Couvreur
Hello Taco
Thank you so much ; I did not know the reverse operator.
Fabrice

Le jeu. 23 juil. 2020 à 11:56, Taco Hoekwater  a écrit :

>
>
> > On 23 Jul 2020, at 11:48, Fabrice Couvreur 
> wrote:
> >
> > Hello,
> > I have a little problem with coloring an area (path b).
> > Thanks for your help.
> > Fabrice
> >
> > \starttext
> > \startMPcode
> >
> >   path circle, p, q, b;
> >
> > circle = fullcircle xscaled 6cm yscaled 3.5cm;
> > p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm)..
> point 6 of circle);
> > q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle);
> > b = (p -- subpath(2,6) of circle -- cycle);
>
> That should be:
>
>   b = (reverse p -- subpath(2,6) of circle -- cycle);
>
> Best wishes,
> Taco
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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] Fill an area defined by a subpath (Metafun)

2020-07-23 Thread Fabrice Couvreur
Hello,
I have a little problem with coloring an area (path b).
Thanks for your help.
Fabrice

\starttext
\startMPcode

  path circle, p, q, b;

circle = fullcircle xscaled 6cm yscaled 3.5cm;
p = (point 2 of circle .. (-0.15cm,1.5cm) ..(0,0)..(0.15cm,-1.5cm).. point
6 of circle);
q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle --cycle);
b = (p -- subpath(2,6) of circle -- cycle);

definecolor [ name = "mp:red", r = 1 ];
definecolor [ name = "mp:blue", r = 0.54, g = 0.17, b = 0.89 ];

fill q withcolor "mp:red" withtransparency(1,0.5) ;
fill b withcolor "mp:blue" withtransparency(1,0.5) ;
draw circle;
draw p;

label("$\overline{\text{A}}$",( 1.5cm,0)) withcolor "mp:red";
label("$\text{A}$",(-1.5cm,0)) withcolor "mp:blue";
label.top("E",(0,1.85cm));

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

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


[NTG-context] Bug with lmtx and color in table

2020-07-22 Thread Fabrice Couvreur
Hello,
With the latest version of lmtx, the background color of cells does not
work.
Thank you.
Fabrice

\starttext
\startxtable
  [align={middle,lohi}, offset=0.8ex,background=color,
   backgroundcolor=red,frame=off]
  \startxrow
\startxcell
  \m{\displaystyle\binom{n-1}{k-1}}
\stopxcell
\startxcell[width=fit]
  \m{+}
\stopxcell
\startxcell
  \m{\displaystyle\binom{n-1}{k}}
\stopxcell
  \stopxrow
  \startxrow
\startxcell

\stopxcell
\startxcell[width=fit]
  \m{=}
\stopxcell
\startxcell
  \m{\displaystyle\binom{n}{k}}
\stopxcell
  \stopxrow
\stopxtable
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Code lua in a table

2020-07-21 Thread Fabrice Couvreur
Hello,
I am making progress and I almost get what I want to achieve but I still
have two problems :
how to color cells not containing numbers with the same color as the others
?
how to color in salmon, for example, cells 1 2  ?
 3
Thank you
Fabrice

\usecolors[X11]

\startuseMPgraphic{DiagonalRule}
  rulethickness := \frameddimension{rulethickness};

  drawoptions(
withpen pencircle scaled rulethickness
withcolor \MPcolor{\framedparameter{framecolor}});

  pair leftcorner, rightcorner;
  leftcorner  := (rulethickness, \overlayheight-rulethickness);
  rightcorner := (\overlaywidth-rulethickness, rulethickness);

  draw leftcorner -- rightcorner;
\stopuseMPgraphic

\defineoverlay
  [DiagonalRule]
  [\useMPgraphic{DiagonalRule}]

\define[2]\DiagonalLabel{%
  \setuptabulate [after={\blank[\frameddimension{offset}]}]
  \starttabulate [|p|r|]
\NC\NC #2 \NC\NR
\NC #1 \NC\NC\NR
  \stoptabulate
}


\starttext
\startluacode
   function Binom(n,k)
if k > n then
 return ""
elseif (n == 0 or k == 0) then
 return 1
else
 return math.round((n*Binom(n-1,k-1))/k)
end
  end
  context.startxtable({"align={middle,lohi},
width=1cm,offset=0.8ex,bodyfont=9pt,framecolor=cyan"})
  context.startxrow()

context.startxcell({"background=DiagonalRule,background=color,backgroundcolor=thistle2"})
  context("\\DiagonalLabel{\\m{n}}{\\m{k}}")
  context.stopxcell()
  for j = 0, 7 do
  context.startxcell({"background=color,backgroundcolor=thistle2"})
  context(j)
  context.stopxcell()
  end
  context.startxcell({"background=color,backgroundcolor=thistle2"})
  context("\\dots")
  context.stopxcell()
  context.stopxrow()
  for i = 0, 7 do
  context.startxrow()
  context.startxcell({"background=color,backgroundcolor=thistle2"})
  context(i)
  context.stopxcell()
  for j = 0, 8 do
  context.startxcell()
  context(Binom(i,j))
  context.stopxcell()
  end
  context.stopxrow()
  end
  context.startxrow()
  context.startxcell({"background=color,backgroundcolor=thistle2"})
  context("\\dots")
  context.stopxcell()
  for i = 0, 8 do
  context.startxcell({"background=color,backgroundcolor=thistle2"})
  context("")
  context.stopxcell()
  end
  context.stopxrow()
  context.stopxtable()
\stopluacode
\stoptext

Le lun. 20 juil. 2020 à 14:55, Hans Hagen  a écrit :

> On 7/20/2020 2:40 PM, Jeong Dal wrote:
>
> > I also wonder where is the boundary of ConTeXt.
> The boundaries are set and shift by users (the mailing list) and
> curiosity (personal).
>
> 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
>
> ___
>
___
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] Code lua in a table

2020-07-20 Thread Fabrice Couvreur
Hi all,
Thank you for your contributions, it allows me to progress.
@Hans and Deal
The code is impressive but does not correspond to the shape of the triangle


that I have to make (by convention).
Fabrice

Le lun. 20 juil. 2020 à 10:36, Hans Hagen  a écrit :

> On 7/20/2020 7:56 AM, Jeong Dal wrote:
> > Dear Fabrice,
> >
> > You may split Binom(n,k) function into two functions as following:
> >
>  > see original mail
>  >
> > Dalyoung
> Best stay in a protected namespace ...
>
> \startluacode
>
>  local function fact (n)
>  if n <= 0 then
>  return 1
>  else
>  return n * fact(n-1)
>  end
>  end
>
>  local function ncr(n,r)
>  return fact(n)/(fact(r)*fact(n-r))
>  end
>
>  userdata.P = {
>  fact = fact,
>  ncr  = ncr,
>  }
>
>  function MP.pascal_ncr(n, r)
>  mp.print(ncr(n,r))
>  end
>
> \stopluacode
>
> Watch the last definition. This permits
>
>% tt := lua("mp.print(userdata.P.ncr(" & decimal n & "," &
> decimal r & " ))");
>
> replaced by
>
>  tt := lua.MP.pascal_ncr(n,r);
>
> which looks nicer.
>
> \startbuffer[pt1]
>  numeric n, r, s, u, dx, dy, tt;
>  path p, q;
>  pair A, B, start, now;
>  u := 1.8cm;
>  A := dir(210)*u;
>  B := dir(-30)*u;
>  dy := sind(30)*u;
>  dx := 2*cosd(30)*u;
>  for n=0 upto 4:
>  start := n*dir(210)*u;
>  for r=0 upto n:
>  s := n-r;
>% tt := lua("mp.print(userdata.P.ncr(" & decimal n & "," &
> decimal r & " ))");
>tt := lua.MP.pascal_ncr(n,r);
>  now := start+r*right*dx;
>  dotlabel.top(textext("$\displaystyle {" & decimal n &
> "\choose" & decimal r & "} = "& decimal tt & "$"),now);
>  draw (now+A) -- now -- (now+B);
>  endfor;
>  endfor;
> \stopbuffer
>
> Now, in context lmtx we can have a different kind of abstraction. We can
> do this:
>
>  function MP.pascal_ncr_x()
>  mp.print(ncr(mp.scan.pair()))
>  end
>
> and then use:
>
>  tt := runscript("MP.pascal_ncr_x()") (n,r) ;
>
> Of course one can decide to pick to two numerics instead, like
>
>  tt := runscript("MP.pascal_ncr_x()") n r ;
>
> but i leave that as exercise.
>
>% tt := runscript mp_pascal_ncr (n,r) ;
>  tt := pascal_ncr (n,r) ;
>
> However, we still have the rather verbose runscript here, so we go
> further, we register pascal as script:
>
> \startluacode
>  metapost.registerscript("pascal_ncr",MP.pascal_ncr_x)
> \stopluacode
>
> And then define an alias at the metafun end:
>
> \startMPextensions
>  newinternal mp_pascal_ncr ; mp_pascal_ncr := scriptindex "pascal_ncr"
> ;
>
>  def pascal_ncr =
>  runscript mp_pascal_ncr
>  enddef ;
> \stopMPextensions
>
> The internal permits this:
>
> tt := runscript mp_pascal_ncr (n,r) ;
>
> while the additional def permits
>
>  tt := pascal_ncr (n,r) ;
>
> Now watch out, because we define pascal_ncr here, something
> lua.MP.pascal_ncr(n,r) won't work because the last part gets expanded
> because that is what mp does (i'll probably cook something for that some
> day).
>
> Now, to come back to
>
> "I couldn’t wikify it at that time because I don’t know
>  how to.  I’ll do it soon."
>
> looks like you suddenly have an additional challenge,
>
> 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
>
> ___
>
___
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] Code lua in a table

2020-07-18 Thread Fabrice Couvreur
Small correction :

\starttext

\startluacode
 function Binom(n,k)
   if k > n then
 return 0
   elseif (n == 0 or k == 0) then
 return 1
   else
 return (n*Binom(n-1,k-1))/k
   end

end

context.startxtable({"align={middle,lohi},
width=1cm,offset=0.8ex,bodyfont=9pt"})
for i = 0, 9 do
  context.startxrow({"background=color,backgroundcolor=cyan"})
for j = 0, i do
  context.startxcell()
 context(Binom(i,j))
  context.stopxcell()
 end
  context.stopxrow()
end
   context.stopxtable()

\stopluacode

\stoptext

Le sam. 18 juil. 2020 à 22:25, Fabrice Couvreur 
a écrit :

> Hi Wolfgang,
>
> It works but why did you ask this question since I finally use context ?
>
>> Are you sure you want to use context(...) here?
>>
> How not to display the .0 ?
> Fabrice
>
> Le sam. 18 juil. 2020 à 22:22, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> a écrit :
>
>> Fabrice Couvreur schrieb am 18.07.2020 um 22:09:
>> > Hi,
>> > I improved the code to be able to display the grid but I cannot display
>> > the coefficients.
>> > Thank you
>> > Fabrice
>> >
>> > \starttext
>> >
>> > \startluacode
>> >   function Binom(n,k)
>> > if k > n then
>> >   return 0
>> > elseif (n == 0 or k == 0) then
>> >   return 1
>> > else
>> >   return (n*Binom(n-1,k-1))/k
>> > end
>> >
>> >  end
>> >
>> >  context.startxtable({"align={middle,lohi},
>> > width=1.2cm,offset=0.8ex,bodyfont=9pt"})
>> >  for i = 1, 10 do
>> >context.startxrow({"background=color,backgroundcolor=cyan"})
>> >  for j = 1, i do
>> >context.startxcell()
>> >   \ctxlua{context(Binom(i,j))}
>>
>> Remove \ctxlua:
>>
>> context(Binom(i,j))
>>
>> 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
>>
>> ___
>>
>
___
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] Code lua in a table

2020-07-18 Thread Fabrice Couvreur
Hi Wolfgang,

It works but why did you ask this question since I finally use context ?

> Are you sure you want to use context(...) here?
>
How not to display the .0 ?
Fabrice

Le sam. 18 juil. 2020 à 22:22, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 18.07.2020 um 22:09:
> > Hi,
> > I improved the code to be able to display the grid but I cannot display
> > the coefficients.
> > Thank you
> > Fabrice
> >
> > \starttext
> >
> > \startluacode
> >   function Binom(n,k)
> > if k > n then
> >   return 0
> > elseif (n == 0 or k == 0) then
> >   return 1
> > else
> >   return (n*Binom(n-1,k-1))/k
> > end
> >
> >  end
> >
> >  context.startxtable({"align={middle,lohi},
> > width=1.2cm,offset=0.8ex,bodyfont=9pt"})
> >  for i = 1, 10 do
> >context.startxrow({"background=color,backgroundcolor=cyan"})
> >  for j = 1, i do
> >context.startxcell()
> >   \ctxlua{context(Binom(i,j))}
>
> Remove \ctxlua:
>
> context(Binom(i,j))
>
> 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
>
> ___
>
___
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] Code lua in a table

2020-07-18 Thread Fabrice Couvreur
Hi,
I improved the code to be able to display the grid but I cannot display the
coefficients.
Thank you
Fabrice

\starttext

\startluacode
 function Binom(n,k)
   if k > n then
 return 0
   elseif (n == 0 or k == 0) then
 return 1
   else
 return (n*Binom(n-1,k-1))/k
   end

end

context.startxtable({"align={middle,lohi},
width=1.2cm,offset=0.8ex,bodyfont=9pt"})
for i = 1, 10 do
  context.startxrow({"background=color,backgroundcolor=cyan"})
for j = 1, i do
  context.startxcell()
 \ctxlua{context(Binom(i,j))}
  context.stopxcell()
 end
  context.stopxrow()
end
   context.stopxtable()

\stopluacode

\stoptext


Le sam. 18 juil. 2020 à 20:32, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 18.07.2020 um 20:05:
>
> Hello,
> I want to display the values of Pascal's triangle in a table.
> Unfortunately my knowledge of Lua is not sufficient to run this code.
> Thank you.
> Fabrice
>
> \starttext
>
> \startluacode
>  function Binom(n,k)
>if k > n then
>  return 0
>elseif (n == 0 or k == 0) then
>  return 1
>else
>  return (n*Binom(n-1,k-1))/k
>  end
>  context(Binom(n,k))
>
> Are you sure you want to use context(...) here?
>
> end
>
> context.startxtable({"align={middle,lohi},
> width=1.2cm,offset=0.8ex,bodyfont=9pt"})
> context.startxrow({"background=color,backgroundcolor=green"})
> for i = 0, 10 do
>   for j = 0, i do
>   context.startxcell()
> context(Binom(i,j))
>   context.stopxcell()
>   end
> end
> context.stopxrow()
>
> context.stopxtable()
>
> 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
>
> ___
>
___
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] Code lua in a table

2020-07-18 Thread Fabrice Couvreur
Hello,
I want to display the values of Pascal's triangle in a table.
Unfortunately my knowledge of Lua is not sufficient to run this code.
Thank you.
Fabrice

\starttext

\startluacode
 function Binom(n,k)
   if k > n then
 return 0
   elseif (n == 0 or k == 0) then
 return 1
   else
 return (n*Binom(n-1,k-1))/k
 end
 context(Binom(n,k))
end

context.startxtable({"align={middle,lohi},
width=1.2cm,offset=0.8ex,bodyfont=9pt"})
context.startxrow({"background=color,backgroundcolor=green"})
for i = 0, 10 do
  for j = 0, i do
  context.startxcell()
context(Binom(i,j))
  context.stopxcell()
  end
end
context.stopxrow()

\stopluacode

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

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


Re: [NTG-context] Text around a figure

2020-07-16 Thread Fabrice Couvreur
Hi Otared and Wolfgang,
It's great, the following code does the job!
Thank you so much.
Fabrice

\useMPlibrary[dum]
\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]

\setupfloats[freeregion=no]

\definetextbackground[fondpaille]
[background=color,
backgroundcolor=fondpaille,
frame=off,
location=always,
   ]
\showframe
\starttext

\starttextbackground[fondpaille]
\startplacefigure[number=no,location=right]
\externalfigure[dummy]
\stopplacefigure
\startitemize[n]
\dorecurse{3}{\startitem \input ward \stopitem}
\stopitemize
\stoptextbackground

\stoptext

Le jeu. 16 juil. 2020 à 14:59, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Otared Kavian schrieb am 16.07.2020 um 11:58:
> > Hi Fabrice,
> >
> > Maybe you can play with different settings of your textbackground, as in
> >
> > \definetextbackground[fondpaille]
> >   [background=color,
> >   backgroundcolor=fondpaille,
> >   frame=off,
> >   location=paragraph, % or: text, always, paragraph
> >   backgroundoffset=4pt] % change the value here
>
> It's a float feature which can be disabled.
>
> \setupfloats[freeregion=no]
>
> 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
>
> ___
>
___
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] Text around a figure

2020-07-16 Thread Fabrice Couvreur
Hi Otared and Wolfgang,
Thanks for your help ; the result is almost what I want (the space between
the text and the figure is not colored) but it is likely that we could not
do better.
Fabrice

Le mer. 15 juil. 2020 à 22:25, Otared Kavian  a écrit :

> Hi Fabrice,
>
> I think what Wolfgang suggests is something like the following:
>
> \useMPlibrary[dum]
> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
> \definetextbackground[fondpaille]
> [background=color,
> backgroundcolor=fondpaille,
> frame=off,
> location=always]
>
> \starttext
>
> \starttextbackground[fondpaille]
> \startplacefigure[number=no,location=right]
> \externalfigure[dummy]
> \stopplacefigure
> \startitemize[n]
> \dorecurse{3}{\startitem \input ward \stopitem}
> \stopitemize
> \stoptextbackground
>
> \stoptext
>
> Best regards: Otared K.
>
> > On 15 Jul 2020, at 22:13, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> wrote:
> >
> > Fabrice Couvreur schrieb am 15.07.2020 um 19:54:
> >> Hello,
> >> I always encounter difficulties with the placement of figures in such a
> way that the text envelops the figure.
> >> Thank you.
> >> Fabrice
> >> \useMPlibrary[dum]
> >> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
> >> \starttext
> >> \startframedtext[width=max,background=color,backgroundcolor=fondpaille]
> >>  \placefloat[][right,none]{}
> >>{\externalfigure[dummy]}
> >>  \startitemize[n]
> >>\dorecurse{3}{\startitem \input ward \stopitem}
> >>  \stopitemize
> >>\stopframedtext
> >>\stoptext
> >
> >
> > Side floats don't work in frames, use the textbackground environment to
> add a colored box behind the text.
> >
> > 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
> >
> ___
>
>
> ___
> 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
___


[NTG-context] Text around a figure

2020-07-15 Thread Fabrice Couvreur
Hello,
I always encounter difficulties with the placement of figures in such a way
that the text envelops the figure.
Thank you.
Fabrice

\useMPlibrary[dum]
\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]

\starttext

\startframedtext[width=max,background=color,backgroundcolor=fondpaille]
 \placefloat[][right,none]{}
   {\externalfigure[dummy]}
 \startitemize[n]
   \dorecurse{3}{\startitem \input ward \stopitem}
 \stopitemize
   \stopframedtext

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

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


Re: [NTG-context] Incorrect placement of a table with LMTX

2020-07-14 Thread Fabrice Couvreur
Hi Otared,
Thanks, it works perfectly.
Best regards.
fabrice

Le mar. 14 juil. 2020 à 12:23, Otared Kavian  a écrit :

> Hi Fabrice,
>
> You should enclose the table into \startplacetable... \stopplacetable as
> in:
>
> \startplacetable[number=no]
> % here put your xtable
> \stopplacetable
>
> Best regards: Otared
>
>
> On 14 Jul 2020, at 11:28, Fabrice Couvreur 
> wrote:
>
> Hello,
> In my lessons, I often have to include tables, figures, ... in
> definitions, theorems ...
> With the context engine it works fine but not with lmtx.
> Thanks for your help.
> Fabrice
>
> \setupenumerations
>   [before={\blank},
>after={\blank},
>alternative=serried,
>title=yes,
>titleleft=,
>titleright=,
>prefix=yes,
>prefixsegments=chapter,
>way=bychapter,
>titlestyle=bold,
>width=broad]
>
> \defineenumeration
>[definition]
>[text=Définition,
> number=yes,
> headcommand=\groupedcommand{}{.},
> style=italic]
>
> \starttext
>
> \startdefinition
>   \blank
>   \startxtable[align={lohi,middle},width=2cm,offset=0.8ex]
> \startxrow
>   \startxcell
> 1
>   \stopxcell
>   \startxcell
> 2
>   \stopxcell
> \stopxrow
> \startxrow
>   \startxcell
> 3
>   \stopxcell
>   \startxcell
> 4
>   \stopxcell
> \stopxrow
>   \stopxtable
> \stopdefinition
>
> \stoptext
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
>
>
> ___
> 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
___


[NTG-context] Incorrect placement of a table with LMTX

2020-07-14 Thread Fabrice Couvreur
Hello,
In my lessons, I often have to include tables, figures, ... in definitions,
theorems ...
With the context engine it works fine but not with lmtx.
Thanks for your help.
Fabrice

\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   title=yes,
   titleleft=,
   titleright=,
   prefix=yes,
   prefixsegments=chapter,
   way=bychapter,
   titlestyle=bold,
   width=broad]

\defineenumeration
   [definition]
   [text=Définition,
number=yes,
headcommand=\groupedcommand{}{.},
style=italic]

\starttext

\startdefinition
  \blank
  \startxtable[align={lohi,middle},width=2cm,offset=0.8ex]
\startxrow
  \startxcell
1
  \stopxcell
  \startxcell
2
  \stopxcell
\stopxrow
\startxrow
  \startxcell
3
  \stopxcell
  \startxcell
4
  \stopxcell
\stopxrow
  \stopxtable
\stopdefinition

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

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


Re: [NTG-context] Symbol ' of the derived function + pagella + lmtx

2020-07-12 Thread Fabrice Couvreur
Hello,
I found an intermediate solution but I find that the ' is too high.

\m{f^{\prime}(x)=2x}

Fabrice

Le sam. 11 juil. 2020 à 12:46, Fabrice Couvreur 
a écrit :

> Hello,
> I am now using the lmtx engine and I have found that using the Pagella
> font the writing of derived functions is not very nice with the symbol '.
> Thank you.
> Fabrice
>
> \setupbodyfont [pagella,11pt]
> \starttext
> \startitemize[n]
>   \startitem
> \math{f'(x)=x²+4x+4}
>   \stopitem
>   \startitem
>  \math{f''(x)=2x+4}
>   \stopitem
> \stopitemize
> \stoptext
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] About the table of contents

2020-07-11 Thread Fabrice Couvreur
Hello,
I would like to reduce the space between the numbering and the title of the
chapters, sections and subsections.
I would also like to have this:

1 My first chapter
1.1 My first section
1.1.1 My first subsection


\setuplist
  [chapter]
  [style=bold,width=10mm]
\starttext
\placelist
  [chapter,section,subsection]
  [criterium=all,
   interaction=all,
   alternative=c]
\startchapter
  [title=My first chapter]
  \dorecurse{2}{\input knuth}
  \startsection
[title=My first section]
\dorecurse{2}{\input knuth}
\startsubsection
  [title=My first subsection]
  \dorecurse{2}{\input knuth}
\stopsubsection
  \stopsection
\stopchapter
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Symbol ' of the derived function + pagella + lmtx

2020-07-11 Thread Fabrice Couvreur
Hello,
I am now using the lmtx engine and I have found that using the Pagella font
the writing of derived functions is not very nice with the symbol '.
Thank you.
Fabrice

\setupbodyfont [pagella,11pt]
\starttext
\startitemize[n]
  \startitem
\math{f'(x)=x²+4x+4}
  \stopitem
  \startitem
 \math{f''(x)=2x+4}
  \stopitem
\stopitemize
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Vertical space between label and title

2020-07-09 Thread Fabrice Couvreur
Hello,
I know it works but ConteXt has so many commands with many keys that I
thought there was a "cleaner" way.
Fabrice

Le mar. 7 juil. 2020 à 20:36, Henning Hraban Ramm  a écrit :

>
>
> > Am 07.07.2020 um 19:27 schrieb Fabrice Couvreur <
> fabrice1.couvr...@gmail.com>:
> >
> > Hello,
> > I want a vertical space between the label and the chapter title: is this
> the right way to proceed ?
>
> Why not? It seems to work. What’s your problem?
>
> BTW I’d set \mainlanguage[fr]
>
> 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
___


[NTG-context] Vertical space between label and title

2020-07-07 Thread Fabrice Couvreur
Hello,
I want a vertical space between the label and the chapter title: is this
the right way to proceed ?
Thank you.
Fabrice

\setuplabeltext[chapter=Chapitre~]

\unexpanded\def\Title#1#2{\framed[frame=off,width=fit,align=flushleft]{#1\blank#2}}

 \setuphead
  [chapter]
  [style=\bfc,
   command=\Title]

\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   title=yes,
   prefix=yes,
   prefixsegments=chapter,
   way=bychapter,
   titlestyle=bold,
   width=broad]

\defineenumeration
   [definition]
   [text=Définition,
number=yes,
headcommand=\groupedcommand{}{.},
style=italic]

\starttext


  \startchapter
[title=Nombres complexes : point de vue algébrique]

\startdefinition
  \input zapf
\stopdefinition
\startdefinition
  \input zapf
\stopdefinition

  \stopchapter

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

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


Re: [NTG-context] Store images and text in the right margin

2020-07-06 Thread Fabrice Couvreur
Hi Taco,
Thank you for your help. What I want to do is write a course for my
students, and the definitions, theorems ... will be illustrated by graphs,
examples, remarks ... placed in the right margin. The idea is to consider
that a text or a graphic is an element to place in the right margin without
worrying about the nature and that a single command does the job. What you
are proposing goes in the right direction. However, I noticed a little
problem with the hyphenation.
Fabrice

Le lun. 6 juil. 2020 à 16:35, Taco Hoekwater  a écrit :

> Hi Fabrice,
>
> Like this maybe? It depends on what you want to achieve exactly, I think
>
> \useMPlibrary[dum]
>
> \setuppapersize[A4]
>
> \setuplayout
>   [width=12cm,
>rightmargin=5cm]
>
> \defineuserdata [margintext] [alternative=margintext]
>
> \defineuserdataalternative [margintext]
> [renderingsetup=userdata:margintext]
>
> \startsetups [userdata:margintext]
>   \margindata
> [inright]
> [style={\switchtobodyfont[9pt]},
>  width=\rightmarginwidth,
>  align={flushleft,broad},
>  stack=yes]
> {\startframedtext[before=,after=,offset=0pt,width=max,frame=off]
>  \getinlineuserdata
>  \stopframedtext}
> \stopsetups
>
> \showframe
> \starttext
> \startuserdata[margintext]
>  {\bf Remarque — }\input ward
> \stopuserdata
> \startuserdata[margintext]
>  \externalfigure[dummy][width=\rightmarginwidth]
> \stopuserdata
> \startchapter[title=First chapter]
> \dorecurse{2}{\input knuth}
> \stopchapter
> \stoptext
>
>
> > On 6 Jul 2020, at 16:18, Fabrice Couvreur 
> wrote:
> >
> >
> >
> > -- Forwarded message -
> > De : Fabrice Couvreur 
> > Date: lun. 6 juil. 2020 à 12:10
> > Subject: Re: [NTG-context] Store images and text in the right margin
> > To: Marco 
> >
> >
> > Hello,
> > What has been proposed by Wolfgang and Marco works correctly but is it
> possible to define a single environment margintext which would allow to
> include both text and figures ?
> > Thank you
> > Fabrice
>
> ___
> 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
___


[NTG-context] Fwd: Store images and text in the right margin

2020-07-06 Thread Fabrice Couvreur
-- Forwarded message -
De : Fabrice Couvreur 
Date: lun. 6 juil. 2020 à 12:10
Subject: Re: [NTG-context] Store images and text in the right margin
To: Marco 


Hello,
What has been proposed by Wolfgang and Marco works correctly but is it
possible to define a single environment margintext which would allow to
include both text and figures ?
Thank you
Fabrice

Le sam. 4 juil. 2020 à 11:36, Fabrice Couvreur 
a écrit :

> Hi Marco,
> Without being a specialist, I knew the \blank command, but I too thought
> that there must be another solution.
> Thank you for your help.
> Fabrice
>
> Le ven. 3 juil. 2020 à 11:04, Marco  a écrit :
>
>> On Fri, 3 Jul 2020 10:39:41 +0200
>> Fabrice Couvreur  wrote:
>>
>> > I think there should be a space between comments and figures.
>>
>> Maybe you can add manual \blank[…] in the margindata setups, e.g.
>>
>>   ...
>>   {\blank{\bf Remarque — }\getinlineuserdata\blank}
>>
>> Otherwise I'm sure there's a more elegant solution using dedicated
>> keys, but as I haven't used that mechanism for a while I can't tell
>> which works. Maybe manual blanks already do the job.
>>
>> Marco
>>
>
___
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] Store images and text in the right margin

2020-07-03 Thread Fabrice Couvreur
Hi Marco,
Thanks, it works but only for a comment and a picture. Indeed, if I add a
comment and an image, the first image is placed on the second comment.
Fabrice

\starttext
\startuserdata[margintext]
 \input ward
\stopuserdata
\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}
\startuserdata[margintext]
 \input ward
\stopuserdata
\marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}
\startchapter[title=First chapter]
\dorecurse{2}{\input knuth}
\stopchapter
\stoptext

Le jeu. 2 juil. 2020 à 19:04, Marco Patzer  a écrit :

> On Thu, 2 Jul 2020 17:20:07 +0200
> Fabrice Couvreur  wrote:
>
> Try:
>
> > \useMPlibrary[dum]
> >
> > \setuppapersize[A4]
> >
> > \setuplayout
> >   [width=12cm,
> >rightmargin=5cm]
> >
> > \definemargindata[marginfigure][inright]
> > \setupmargindata [marginfigure][command=\vbox,align=middle]
>
> \setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]
>
> > \startsetups [userdata:margintext]
> >   \margindata
> > [inright]
> > [%style=\smallbodyfont,
> >  style={\switchtobodyfont[9pt]},
> >  width=\rightmarginwidth,
>
>   stack=yes,
>
> >  align={flushleft,broad}]
> > {{\bf Remarque — }\getinlineuserdata}
> > \stopsetups
>
> > \marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}
>
>
> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}
>
> Marco
>
> ___
> 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
___


[NTG-context] Store images and text in the right margin

2020-07-02 Thread Fabrice Couvreur
Hello everyone and in particular to Wolfgang who has already provided me
with the solution below. I will have to write a Mathematics book for my
students and the remarks and graphics should be in the right margin. I got
the code written by Wolfgang and tried to include the graphics in it. The
result is not as expected because the graphic overflows on the text.
The course will be written in A4 format with an 11 pts font.
Thanks for your help.
Fabrice

\useMPlibrary[dum]

\setuppapersize[A4]

\setuplayout
  [width=12cm,
   rightmargin=5cm]

\definemargindata[marginfigure][inright]
\setupmargindata [marginfigure][command=\vbox,align=middle]

\defineuserdata [margintext] [alternative=margintext]

\defineuserdataalternative [margintext] [renderingsetup=userdata:margintext]

\startsetups [userdata:margintext]
  \margindata
[inright]
[%style=\smallbodyfont,
 style={\switchtobodyfont[9pt]},
 width=\rightmarginwidth,
 align={flushleft,broad}]
{{\bf Remarque — }\getinlineuserdata}
\stopsetups

\showframe
\starttext
\startuserdata[margintext]
 \input ward
\stopuserdata
\marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}
\startchapter[title=First chapter]
\dorecurse{2}{\input knuth}
\stopchapter
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Filter module for R

2020-06-15 Thread Fabrice L
Dear Aditya,

> Le 15 juin 2020 à 01:45, Aditya Mahajan  a écrit :
> 
> This is an adapted version of the code that I use for my course where I use 
> the vim module to do the typesetting:
> 
> \usemodule[filter]
> \usemodule[vim]
> 
> \definecolor  [darkblue]   [r=0.1,  g=0.11, b=0.84]
> \definecolor  [darkgreen]  [g=0.7]
> \definecolor  [lightblue]   [h=87cefa]
> \definecolor  [lightgreen]  [g=0.95,b=0.8,r=0.8]
> 
> \defineframedtext
>  [leftbartext]
>  [
>width=local,
>frame=off,
>framecolor=darkblue,
>leftframe=on,
>rulethickness=1ex,
>offset=0.25ex,
>loffset=3ex,
>background=color,
>backgroundcolor=lightblue,
>  ]
> 
> \definevimtyping
>  [RCODE]
>  [
>syntax=r,
>directory=output,
>strip=yes,
>escape=yes,
>before={\blank[quarterline]\startleftbartext},
>after={\stopleftbartext},
>  ]
> 
> \define[1]\ShowOutput
>{\typeRCODEfile{\externalfilterinputfile}
> \startleftbartext[framecolor=darkgreen, backgroundcolor=lightgreen]
>   \setupalign[flushleft, verytolerant]
>   % range={1,-1} not currently supported
>   % See below for details
>   \typefile[range={1,-1}]{#1}
> \stopleftbartext}
> 
> 
> \defineexternalfilter
>  [R]
>  [ filtercommand={R CMD BATCH -q --no-timing --save --restore
> \externalfilterinputfile\space \externalfilteroutputfile},
> output=\externalfilterbasefile.out,
> directory=output,
> readcommand=\ShowOutput,
> read=no,
> cache=yes,
> purge=yes, % THE COMMA WAS MISSING
>   ]
> 
> \starttext
> 
> Some text...
> 
> \startR[read=yes]
>   pdf("RPlots/MyHistogram.pdf",5,5)
>   X <- rnorm(200,mean=10,sd=2)
>   hist(X, col =  "red3" ,  xlab="Score QI" , main="", ylab="fréquence")
> \stopR
> 
> \externalfigure[RPlots/MyHistogram.pdf][width=.5\textwidth]
> 
> \stoptext
> 
> 


Thanks so much for your answer. I had (of course) to install nvim in order the 
code to work, but this works ! Thanks also for your additional work regarding 
the locale setting.. this is really deep magic for me. 

I think the facility to run R code directly from context can open ConTeXt to 
new users. The alliance between R and LaTeX is a winning combination to a lot 
of my colleagues. Do you think this would be appropriate to do a simple page on 
the wiki explaining how R code can be done in ConTeXt, with eventual 
formatting, with some simple examples, or this is too much noise ?

Thanks. Fabrice.






___
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] Filter module for R

2020-06-14 Thread Fabrice L
Hi,Following a question about the broken R module (R the statistical software), Aditya suggested me the filter module (thanks to him). I’m about to distribute a set of course notes to colleagues, and I need to deal with details now. I have one problem and two questions.1) the filter collect R code between \startR / \stopR and submit this code to R. As it can be seen in the following minimal example, when a label contains an accented character (« Fréquence » in my example), the pdf graphic does not contains the « é ». Strangely, the snippet of code (which is saved locally as « test2-temp-R-0.tmp » (for test2.tex)) when submitted with the same command as the filtercommand, works correctly; that means the same file works when submitted to R outside of ConTeXt. I have no idea how to solve this. 2) In a teaching context, we may want sometimes to show the code. The filter module actually permits to show the output of the code submitted to R (which can include or not the input commands); would it be possible to typeset the submitted code ?3) Finally, using "R CMD BATCH… » as the filtercommand add an extra line at the end of the output file which can be typeset to visualize results. Would it be possible by a magic trick to deleter the last line of the file ?Here is a minimal code:% —\usemodule[filter]\defineexternalfilter  [R]  [ filtercommand={R CMD BATCH -q --no-timing --save --restore \externalfilterinputfile\space \externalfilteroutputfile},     output=\externalfilterbasefile.out,     directory=output,     readcommand=\typefile,     read=no,     cache=yes,     purge=yes   ]\starttextSome text...\startR[read=yes]   pdf("RPlots/MyHistogram.pdf",5,5)   X <- rnorm(200,mean=10,sd=2)   hist(X, col =  "red3" ,  xlab="Score QI" , main="", ylab="fréquence")\stopR\externalfigure[MyHistogram.pdf][width=.5\textwidth] \stoptext% —Sorry for the three questions… and thanks for any help.Fabrice.

MyHistogram.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 / 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] start/stop executed conditionally on mode ?

2020-06-09 Thread Fabrice L


> Le 9 juin 2020 à 03:37, Hans Hagen  a écrit :
> 
> On 6/8/2020 9:53 PM, Fabrice L wrote:
>>> Le 7 juin 2020 à 23:19, Aditya Mahajan >> <mailto:adit...@umich.edu>> a écrit :
>>> 
>>> On Sun, 7 Jun 2020, Fabrice L wrote:
>>> 
>>>> Dear List,
>>>> 
>>>> I would like to insert a page using (ideally) start/stop instructions. The 
>>>> problem is that this page should be inserted only in a certain mode. 
>>>> Consulting the mailing list, I thought the following code was working, but 
>>>> it’s not ! The code is executed in the mode as expected, but the following 
>>>> instructions ("Some other text... » in the exemple) is not typeset.
>>>> 
>>>> Here is a minimal (not working!) example:
>>>> 
>>>> % 
>>>> \unexpanded\def\StartQuestionsList{
>>>> \startmode[ClassRoom]  \page[yes] Here are some questions: \blank
>>>> }
>>>> \unexpanded\def\StopQuestionsList{
>>>> \page[yes] \stopmode
>>>> }
>>>> \definestartstop[Questions][
>>>> before=\StartQuestionsList,
>>>> after=\StopQuestionsList
>>>> ]
>>>> 
>>>> 
>>>> \startQuestions
>>>> Question A….
>>>> Question B….
>>>> \stopQuestions
>>>> 
>>>> Some other text...
>>>> % 
> One of the oldest mechanism available ... blocks:
> 
> \enablemode[classroom] % comment this
> 
> \defineblock[Question]
> 
> \doifmode {classroom} {
>\keepblocks[Question]
> }
> 
> \starttext
> 
>Text A
> 
>\beginQuestion
>Question A….
>\endQuestion
> 
>Text B
> 
>\beginQuestion
>Question B….
>\endQuestion
> 
>\page
> 
>\doifnotmode {classroom} {
>\useblocks[Question]
>}
> 
> \stoptext

You are right of course... In fact I already use blocks, for another purpose, 
but I did not think about this solution because I needed a lot of formatting 
(these blocks should occupy whole page, different background color…), but 
blocks can adapt to my current need (I have try this morning) using the 
\setupblock[][before=..,after=…] command. And there is a bonus; I can « collect 
» these blocks and put them all together at the end of my courses notes, this 
is perfect.


___
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] start/stop executed conditionally on mode ?

2020-06-08 Thread Fabrice L


> Le 7 juin 2020 à 23:19, Aditya Mahajan  a écrit :
> 
> On Sun, 7 Jun 2020, Fabrice L wrote:
> 
>> Dear List,
>> 
>> I would like to insert a page using (ideally) start/stop instructions. The 
>> problem is that this page should be inserted only in a certain mode. 
>> Consulting the mailing list, I thought the following code was working, but 
>> it’s not ! The code is executed in the mode as expected, but the following 
>> instructions ("Some other text... » in the exemple) is not typeset.
>> 
>> Here is a minimal (not working!) example:
>> 
>> % 
>> \unexpanded\def\StartQuestionsList{
>>  \startmode[ClassRoom]  \page[yes] Here are some questions: \blank
>> }
>> \unexpanded\def\StopQuestionsList{
>>  \page[yes] \stopmode
>> }
>> \definestartstop[Questions][
>>  before=\StartQuestionsList,
>>  after=\StopQuestionsList
>>  ]
>> 
>> 
>> \startQuestions
>>  Question A….
>>  Question B….
>> \stopQuestions
>> 
>> Some other text...
>> % 
>> 
>> 
>> So to be clear, I would like the result in the « ClassRoom » mode to be:
>> % 
>> Here are some questions:
>> 
>>  Question A….
>>  Question B….
>> 
>> Some other text...
>> % 
>> 
>> Otherwise to be:
>> % 
>> Some other text...
>> % 
> 
> If you only set `ClassRoom` mode at compile time (rather than setting and 
> unsetting it the middle of the document), then you can do:
> 
> \definebuffer[Questions]
> 
> \startmode[ClassRoom]
> \define\StopQuestionsList {...}
> 
> \definestartstop[Questions][...]
> \stopmode
> 

Thanks to Aditya, I have succeeded, but it was not trivial for me. So, in case 
somebody someday would need a detailed solution, here is a minimal example, and 
an explanation. 

A buffer « Questions » is defined. If in « ClassRoom » mode, a start/stop « 
Questions » is also defined. So when ConTeXt encounters the \startQuestions / 
\stopQuestions, if the « ClassRoom » mode is enabled, the buffer is processed 
(with some format if needed - framed here for the example), and if the mode « 
ClassRoom » is disabled, then nothing is process. You can add as many 
\startQuestions / \stopQuestions you wish. 


% --
\definebuffer[Questions]

\enablemode[ClassRoom] % Try "On / Off » to process "\startQuestions / 
\stopQuestions » or not.

\startmode[ClassRoom]
 
\definestartstop[Questions][before={\startframedtext\red},after={\stopframedtext\blue}]
\stopmode

\starttext

Before...

\startQuestions
The content of the buffer ! 
\stopQuestions

After...

\stoptext
% --

Thanks Aditya !
Fabrice.



> Aditya___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <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] start/stop executed conditionally on mode ?

2020-06-08 Thread Fabrice L
Dear Aditya,

> Le 7 juin 2020 à 23:19, Aditya Mahajan  a écrit :
> 
> On Sun, 7 Jun 2020, Fabrice L wrote:
> 
>> Dear List,
>> 
>> I would like to insert a page using (ideally) start/stop instructions. The 
>> problem is that this page should be inserted only in a certain mode. 
>> Consulting the mailing list, I thought the following code was working, but 
>> it’s not ! The code is executed in the mode as expected, but the following 
>> instructions ("Some other text... » in the exemple) is not typeset.
>> 
>> Here is a minimal (not working!) example:
>> 
>> % 
>> \unexpanded\def\StartQuestionsList{
>>  \startmode[ClassRoom]  \page[yes] Here are some questions: \blank
>> }
>> \unexpanded\def\StopQuestionsList{
>>  \page[yes] \stopmode
>> }
>> \definestartstop[Questions][
>>  before=\StartQuestionsList,
>>  after=\StopQuestionsList
>>  ]
>> 
>> 
>> \startQuestions
>>  Question A….
>>  Question B….
>> \stopQuestions
>> 
>> Some other text...
>> % 
>> 
>> 
>> So to be clear, I would like the result in the « ClassRoom » mode to be:
>> % 
>> Here are some questions:
>> 
>>  Question A….
>>  Question B….
>> 
>> Some other text...
>> % 
>> 
>> Otherwise to be:
>> % 
>> Some other text...
>> % 
> 
> If you only set `ClassRoom` mode at compile time (rather than setting and 
> unsetting it the middle of the document), then you can do:
> 
> \definebuffer[Questions]
> 
> \startmode[ClassRoom]
> \define\StopQuestionsList {...}
> 
> \definestartstop[Questions][...]
> \stopmode
> 


Thanks for your answer, I will try that.
Fabrice,


___
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] start/stop executed conditionally on mode ?

2020-06-07 Thread Fabrice L
Dear List,

I would like to insert a page using (ideally) start/stop instructions. The 
problem is that this page should be inserted only in a certain mode. Consulting 
the mailing list, I thought the following code was working, but it’s not ! The 
code is executed in the mode as expected, but the following instructions ("Some 
other text... » in the exemple) is not typeset. 

Here is a minimal (not working!) example: 

% 
\unexpanded\def\StartQuestionsList{ 
\startmode[ClassRoom]  \page[yes] Here are some questions: \blank 
}
\unexpanded\def\StopQuestionsList{ 
\page[yes] \stopmode
}
\definestartstop[Questions][
before=\StartQuestionsList,
after=\StopQuestionsList
]


\startQuestions
Question A….
Question B…. 
\stopQuestions

Some other text...
% 


So to be clear, I would like the result in the « ClassRoom » mode to be:
% 
Here are some questions: 

Question A….
Question B…. 

Some other text...
% 

Otherwise to be:
% 
Some other text...
% 

Thanks for any help !
Fabrice.___
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] Compile only one new component in a project

2020-05-07 Thread Fabrice Couvreur
Hi Aditya,
It does not work ; the compilation encounters errors with each command that
I created. I guess it comes from the components.
Fabrice

##chapter-4-seconde.tex##

\startcomponent chapter-4-seconde

\startchapter[title=]
...
\stopchapter

\stopcomponent


Le jeu. 7 mai 2020 à 16:01, Aditya Mahajan  a écrit :

> On Thu, 7 May 2020, Fabrice Couvreur wrote:
>
> > Hi,
> > Here is part of a project that is starting to be heavy ; when i add a
> > chapter i do context seconde.tex
> > How do I compile only the chapter I just added ?
> > Thank you.
> > Fabrice
> >
> > \startproduct Seconde
> >
> > \environment modules
> > \environment specialite-style
> > \environment specialite-macros
> >
> >  \startfrontmatter
> >  \component specialite-titlepage
> >  \component specialite-contents
> >  \stopfrontmatter
> >
> >  \startbodymatter
> >\component chapter-1-seconde
> >\component chapter-2-seconde
> >\component chapter-3-seconde
> >\component chapter-4-seconde
> >  \stopbodymatter
> > \stopproduct
>
> context chapter-4-seconde
>
> There is a MyWay which shows how you can share cross-refs etc.
>
> 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
>
> ___
>
___
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] Compile only one new component in a project

2020-05-07 Thread Fabrice Couvreur
Hi,
Here is part of a project that is starting to be heavy ; when i add a
chapter i do context seconde.tex
How do I compile only the chapter I just added ?
Thank you.
Fabrice

\startproduct Seconde

\environment modules
\environment specialite-style
\environment specialite-macros

  \startfrontmatter
  \component specialite-titlepage
  \component specialite-contents
  \stopfrontmatter

  \startbodymatter
\component chapter-1-seconde
\component chapter-2-seconde
\component chapter-3-seconde
\component chapter-4-seconde
  \stopbodymatter


\stopproduct
___
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] Changing the font size in an environment changes the behavior of a macro

2020-05-04 Thread Fabrice Couvreur
Hi Aditya,
Thank you for your help ; this also works with pgfplots but the body of the
text must be with the same font. I always use the pagella font but it
doesn't allow you to use \mathscript{} that's why I use this macro. Are
there other free fonts that allow you to do this ?
Fabrice

\usemodule[pgfplots]
\pgfplotsset{compat=newest}
\usebodyfont[xitsbidi]
\define[1]\cscript{\start\m{{\mathscript{#1}}}\stop}

\startmidaligned
 \define[1]\cscript{\start\m{{\mathscript{#1}}}\stop}
 \starttikzpicture
 \startaxis
   \addplot {x};
   \node[above left] at (2,2) {\cscript{C}};
   \stopaxis
 \stoptikzpicture
 \stopmidaligned
 \blank
 \startmidaligned
  \switchtobodyfont[9pt]
  \starttikzpicture
  \startaxis
   \addplot {x};
   \node[above left] at (2,2) {\cscript{C}};
   \stopaxis
 \stoptikzpicture
 \stopmidaligned

\stoptext

Le lun. 4 mai 2020 à 19:18, Aditya Mahajan  a écrit :

> On Mon, 4 May 2020, Fabrice Couvreur wrote:
>
> > Hi,
> > Sorry to insist but I cannot fix this problem.
> > Thanks for any help.
>
> I don't know the answer, but here is a simpler example without pgfplot
> which fails (different calligraphic C's):
>
>
>
> \define[1]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}}\stop}
>
> \starttext
> \startTEXpage[offset=2mm]
> \cscript{C}
> \start
>\switchtobodyfont[9pt]
>\cscript{C}
> \stop
> \stopTEXpage
> \stoptext
>
> And here is a version with a minor change that works (same calligraphic
> C's)!
>
> \usebodyfont[xitsbidi]
>
> \define[1]\cscript{\start\m{{\mathscript{#1}}}\stop}
>
> \starttext
> \startTEXpage[offset=2mm]
> \cscript{C}
> \start
>\switchtobodyfont[9pt]
>\cscript{C}
> \stop
> \stopTEXpage
> \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
>
> ___
>
___
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] Changing the font size in an environment changes the behavior of a macro

2020-05-04 Thread Fabrice Couvreur
Hi,
Sorry to insist but I cannot fix this problem.
Thanks for any help.
Fabrice

Le sam. 25 avr. 2020 à 00:13, Fabrice Couvreur 
a écrit :

> Hi,
> This macro was written by Otared and it works well unless I change the
> size of the font (see the second graph).
> How to correct this problem ?
> Thanks for your help.
> Fabrice
>
>  begin example
>
> \usemodule[pgfplots]
> \pgfplotsset{compat=newest}
>
> \define[2]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}_{#2}}\stop}
>
> \starttext
>
>  \startmidaligned
>  \starttikzpicture
>  \startaxis
>\addplot {x};
>\node[above left] at (2,2) {\cscript{C}{f}};
>\stopaxis
>  \stoptikzpicture
>  \stopmidaligned
>  \blank
>  \startmidaligned
>   \switchtobodyfont[9pt]
>   \starttikzpicture
>   \startaxis
>\addplot {x};
>\node[above left] at (2,2) {\cscript{C}{f}};
>\stopaxis
>  \stoptikzpicture
>  \stopmidaligned
>
> \stoptext
>
> end example
>
___
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] \setupinteraction [ ...] do not work

2020-04-28 Thread Fabrice Couvreur
Hi,
It seemed to me that it was necessary to proceed in this way to create a
link in a pdf file; it does not work.
Thank you.
Fabrice

\setupinteraction[state=start,color=darkred]
\starttext
\goto{vecteur directeur}[https://www.youtube.com/watch?v=6VdSz-0QT4Y]
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Changing the font size in an environment changes the behavior of a macro

2020-04-24 Thread Fabrice Couvreur
Hi,
This macro was written by Otared and it works well unless I change the size
of the font (see the second graph).
How to correct this problem ?
Thanks for your help.
Fabrice

 begin example

\usemodule[pgfplots]
\pgfplotsset{compat=newest}
\define[2]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}_{#2}}\stop}

\starttext

 \startmidaligned
 \starttikzpicture
 \startaxis
   \addplot {x};
   \node[above left] at (2,2) {\cscript{C}{f}};
   \stopaxis
 \stoptikzpicture
 \stopmidaligned
 \blank
 \startmidaligned
  \switchtobodyfont[9pt]
  \starttikzpicture
  \startaxis
   \addplot {x};
   \node[above left] at (2,2) {\cscript{C}{f}};
   \stopaxis
 \stoptikzpicture
 \stopmidaligned

\stoptext

end example
___
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] Text size with lmt_text [ ]

2020-04-22 Thread Fabrice Couvreur
Hi,
As an extension of this discussion
https://mail.google.com/mail/u/0/#inbox/QgrcJHsNlRfcqCPHBTrnSFbJKjGPwjbJnLL?compose=CllgCJZWxJlpNNfzrPpFwWRqsFfdXqmnxkCwWVjvXKQJBwQmBfZGvchjMbsJDKXLtKldJtpWVqq
(thanks to Wolfgang), I used the MetaFun interface with lmt_text [] ; I
managed to pass the text and color parameters while I did not succeed using
textext (). My problem is the size of the letters which is too small.
Thank you.
Fabrice

\usecolors[xwi]

\definecolor [prune] [r=1.29,g=.20,b=.83]

\starttext

\startMPcode

  vardef card(expr s, c) = image(
   draw fullsquare xyscaled (2cm,4cm);
   draw fullsquare xyscaled (1.8cm,3.8cm) withcolor \MPcolor{violet};
   draw lmt_text[
   text  = s,
   color = c,
   style = "bold",
   ]
   )
  enddef;

  draw card("A",red) rotatedaround((1cm,2cm),5);
  draw card("L",green) rotatedaround((1cm,2cm),-5) shifted(3.5cm,0);
  draw card("E",blue) rotatedaround((1cm,2cm),5) shifted(6cm,0);
  draw card("A","prune") rotatedaround((1cm,2cm),-5) shifted(9cm,0);

\stopMPcode

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

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


Re: [NTG-context] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode

2020-04-20 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you very much ; as usual your explanations are always clear and your
approach to the problem intelligent and original. I would however like to
know the way in which we can use the command \frameletter except for the
rounded corners with outlinetext. For example, this doesn't work.

\startMPcode

 draw outlinetext.f
 ("\frameletter{A}")
 (withcolor darkred withpen pencircle scaled 1/10)
  rotated 5 xsized 2cm ;

\stopMPcode

Fabrice

Le lun. 20 avr. 2020 à 10:36, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Rudolf Bahr schrieb am 20.04.2020 um 10:23:
> > On Mon, Apr 20, 2020 at 09:21:41AM +0200, Wolfgang Schuster wrote:
> >> Fabrice Couvreur schrieb am 19.04.2020 um 22:55:
> >>> Hi,
> >>> I try to reproduce the figure as faithfully as possible. I tried for
> the
> >>> rounded corners to put the key corner = round, but it does not work.
> >>
> >> 1. To create a new framed-instance you need \defineframe, \setupframed
> isn't
> >> enough to set the values.
> >>
> >> I guess you assumed this works similar to xtables but this
> mechanism sets
> >> a few values to assure \setupxtable is enough in certain cases but even
> here
> >> you need \definextable in certain cases.
> >>
> >> When you create a new instance you have to use the name of the new
> >> instance as command name, e.g. \frameletter or use the \placeframed
> command
> >> which takes the name as argument, e.g. \placeframed[frameletter].
> >>
> >> 2. You can't pass the name of a framed-instance to \framed (backwards
> >> compatibility, performance ...), this is only possible with
> \startframed.
> >>
> >> 3. ConTeXt uses different mechanism to draw rectangular (unless you
> draw a
> >> closed frame) and rounded frame and the mechanism for rounded frames
> doesn't
> >> work with outlinetext.
> >>
> >> 4. To achieve the desired result you can now a) use MetaPost to draw the
> >> complete card (letter plus frame) or b) use only TeX to put the letter
> in a
> >> frame and rotate it.
> >>
> >>  begin tex example
> >> \usecolors[svg]
> >>
> >> \defineframed
> >>[frameletter]
> >>[width=1.25em,
> >> height=1.75em,
> >> foregroundstyle=\ssbfc,
> >> corner=round,
> >> radius=0.1\bodyfontsize,
> >> rulethickness=1pt]
> >>
> >> \starttext
> >>
> >> \startTEXpage[offset=\linewidth]
> >> \dontleavehmode
> >> \rotate [rotation=5] {\color[darkred]   {\frameletter{A}}}
> >> \rotate [rotation=-5]{\color[green] {\frameletter{L}}}
> >> \rotate [rotation=5] {\color[mediumblue]{\frameletter{E}}}
> >> \rotate [rotation=-5]{\color[darkviolet]{\frameletter{A}}}
> >> \stopTEXpage
> >>
> >> \stoptext
> >>  end tex example
> >>
> >> Wolfgang
> >
> > Nice Example and good explanation, Wolfgang. But why did you use the
> command
> > "dontleavehmode"? It doesn't seem to be necessary in this example.
>
> I wrote the example without TeXpage where I needed \doneleavehmode to
> keep all cards on the same line. At the end I just added TeXpage to
> create a cropped image with with a small border and forgot to remove it.
>
> 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
>
> ___
>
___
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] Passing the parameters of a frame in an environment \startMPcode ... \stopMPcode

2020-04-19 Thread Fabrice Couvreur
Hi,
I try to reproduce the figure as faithfully as possible. I tried for the
rounded corners to put the key corner = round, but it does not work.
Thanks for your help.
Fabrice

\usecolors[xwi]
\definecolor [prune] [r=1.29,g=.20,b=.83]
\starttext
\setupframed[frameletter][corner=round,align=normal]

\startMPcode

 draw outlinetext.f
 ("\framed[frameletter]{A}")
 (withcolor darkred withpen pencircle scaled 1/10)
  rotated 5 xsized 2cm ;

 draw outlinetext.f
 ("\framed[frameletter]{L}")
 (withcolor green withpen pencircle scaled 1/10)
  rotated -5 xsized 2cm shifted (2cm,0);

 draw outlinetext.f
 ("\framed[frameletter]{E}")
 (withcolor \MPcolor{blueviolet} withpen pencircle scaled 1/10)
  rotated 5 xsized 2cm shifted (4.5cm,0);

 draw outlinetext.f
 ("\framed[frameletter]{A}")
 (withcolor \MPcolor{prune} withpen pencircle scaled 1/10)
  rotated -5 xsized 2cm shifted (6.5cm,0);

\stopMPcode

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

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


Re: [NTG-context] Text around an image

2020-04-17 Thread Fabrice Couvreur
Hi,
I found a way to solve it using the command \flushsidefloats
Is this the best solution ?
Thank you.
Fabrice

\startitem
Programmer une fonction \m{A(x)} qui renvoie l'aire totale du
terrain en fonction de la longueur \m{x}.
\stopitem
\flushsidefloats



Le jeu. 16 avr. 2020 à 12:33, Fabrice Couvreur 
a écrit :

> Hi,
> I know that this question has been raised several times (especially by me
> !), but the solutions provided sometimes work and sometimes not, especially
> in this example.
> Thanks for your help.
> Fabrice
>
>   \useMPlibrary [dum]
>
>\define\ItemCommand
>{\hskip\zeropoint\relax\autoinsertnextspace}
>
>   \setupitemgroup
> [itemize]
> [color=black,
>  style=bold,
>  distance=\zeropoint]
>
>   \setupitemgroup
> [itemize:1]
> [option={n,packed,fit,intext},
> command=\ItemCommand]
>
>   \setupitemgroup
> [itemize:2]
> [lefttext=,
> righttext=,
> option={a,text}]
>
>   \starttext
>
> \startitemize
>   \startitem
> Justifier que \m{x>4} et \m{y>2}.
>   \stopitem
>   \placefigure[right,none]{}{\externalfigure [dummy]}
>   \startitem
> Pour calculer la valeur de \m{y} en fonction de \m{x}, l'urbaniste
> a écrit la fonction en Python.
>
> \startitemize
>   \startitem
> Son algorithme est-il correct ?
>   \stopitem\par
>   \startitem
> Programmer une fonction \m{A(x)} qui renvoie l'aire totale du
> terrain en fonction de la longueur \m{x}.
>   \stopitem
> \stopitemize
>   \stopitem
>   \startitem
> On considère la fonction suivante.
>
> \startitemize
>   \startitem
> Qu'affiche l'instruction ?
>   \stopitem\par
>   \startitem
> Interpréter les résultats renvoyés.
>   \stopitem
> \stopitemize
>   \stopitem
> \stopitemize
>   \stoptext
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Text around an image

2020-04-16 Thread Fabrice Couvreur
Hi,
I know that this question has been raised several times (especially by me
!), but the solutions provided sometimes work and sometimes not, especially
in this example.
Thanks for your help.
Fabrice

  \useMPlibrary [dum]

   \define\ItemCommand
   {\hskip\zeropoint\relax\autoinsertnextspace}

  \setupitemgroup
[itemize]
[color=black,
 style=bold,
 distance=\zeropoint]

  \setupitemgroup
[itemize:1]
[option={n,packed,fit,intext},
command=\ItemCommand]

  \setupitemgroup
[itemize:2]
[lefttext=,
righttext=,
option={a,text}]

  \starttext

\startitemize
  \startitem
Justifier que \m{x>4} et \m{y>2}.
  \stopitem
  \placefigure[right,none]{}{\externalfigure [dummy]}
  \startitem
Pour calculer la valeur de \m{y} en fonction de \m{x}, l'urbaniste
a écrit la fonction en Python.

\startitemize
  \startitem
Son algorithme est-il correct ?
  \stopitem\par
  \startitem
Programmer une fonction \m{A(x)} qui renvoie l'aire totale du
terrain en fonction de la longueur \m{x}.
  \stopitem
\stopitemize
  \stopitem
  \startitem
On considère la fonction suivante.

\startitemize
  \startitem
Qu'affiche l'instruction ?
  \stopitem\par
  \startitem
Interpréter les résultats renvoyés.
  \stopitem
\stopitemize
  \stopitem
\stopitemize
  \stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Lmtx + pgfplots compilation error

2020-04-13 Thread Fabrice Couvreur
Hi Aditya,
Your solution seems to work even with the most complex files, it's a great
idea! The only small disadvantage is that you have to place this file in
each directory containing files using these modules.
Thank you very much even if this solution is temporary.
Fabrice

Le lun. 13 avr. 2020 à 12:13, Aditya Mahajan  a écrit :

> On Mon, 13 Apr 2020, Fabrice Couvreur wrote:
>
> > Hi,
> > Sorry to restart the discussion, but I have updated my entire system and
> > the problem remains. I used the example of Aditya.
> > Thank you.
> > Fabrice
> >
> > \usemodule[pgfplots]
> > \starttext
> > \starttikzpicture
> >   \startaxis
> > \addplot {x};
> >   \stopaxis
> > \stoptikzpicture
> > \stoptext
> >
> > tex error   > tex error on line 5 in file
> pgfplotsbinary.data.code.tex:
> > ! Undefined control sequence
> >
> > l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter
> > \endcsname{^0
> >
> >}\advance\counter by1
> > lua error:
>
> I have no clue what pgfplotsbinary.data.code.tex does, but simply
> bypassing that works for the simple example above.
>
> Simply create an empty file with the name pgfplotsbinary.data.code.tex in
> your current directory and compile your example.
>
> Note that if your code uses any of the features which are provided by this
> file (and I am not sure what they are), then it will fail. But at least
> this "fix" works for the simple example above.
>
> 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
>
> ___
>
___
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 + pgfplots compilation error

2020-04-13 Thread Fabrice Couvreur
Hi,
Sorry to restart the discussion, but I have updated my entire system and
the problem remains. I used the example of Aditya.
Thank you.
Fabrice

\usemodule[pgfplots]
\starttext
\starttikzpicture
   \startaxis
 \addplot {x};
   \stopaxis
\stoptikzpicture
\stoptext

tex error   > tex error on line 5 in file pgfplotsbinary.data.code.tex:
! Undefined control sequence

l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter
\endcsname{^0

}\advance\counter by1
lua error:

?


Le jeu. 9 avr. 2020 à 00:07, Aditya Mahajan  a écrit :

> On Wed, 8 Apr 2020, Aditya Mahajan wrote:
>
> > Simpler example:
>
> Sorry, pasted the wrong thing:
>
> \usemodule[pgfplots]
>
> \starttext
> \starttikzpicture
>\startaxis
>  \addplot {x};
>\stopaxis
> \stoptikzpicture
> \stoptext
>
> > Works with LMTX 2019.12.31 but fails with the most recent LMTX (same
> error as
> > below) using the same pgfplots module.
> >
> > Aditya
> >
> > On Wed, 8 Apr 2020, Fabrice Couvreur wrote:
> >
> >> Hi Henri,
> >> Sorry !
> >>
> >> \usemodule[pgfplots]
> >> \pgfplotsset{compat=newest}
> >> \starttext
> >> \starttikzpicture
> >>  \startaxis
> >>[
> >>  xlabel=$x$,
> >> ylabel={$f(x) = x^2 - x +4$}
> >>]
> >>\addplot {x^2 - x +4};
> >>  \stopaxis
> >> \stoptikzpicture
> >> \stoptext
> >>
> >>
> >> tex error   > tex error on line 5 in file
> pgfplotsbinary.data.code.tex:
> >> ! Undefined control sequence
> >>
> >> l.5 ...ode`\^0=11    \expandafter\xdef\csname pgfp@bin@\the\counter
> >> \endcsname{^0
> >>
> >>}\advance\counter by1
> >> lua error:
> >>
> >> ?
> >>
> >>
> >> Le mer. 8 avr. 2020 à 12:40, Henri Menke  a
> écrit :
> >>
> >>> MINIMAL working example...
> >>>
> >>> Cheers, Henri
> >>>
> >>> On 08/04/20, 11:52, Fabrice Couvreur wrote:
> >>>> Hi Henri,
> >>>> This file works well with context but does not work with lmtx.
> >>>>
> >>>> \usemodule[pgfplots]
> >>>> \usemodule[pgfpltstable]
> >>>> \pgfplotsset{compat=newest}
> >>>> \starttext
> >>>> \starttikzpicture
> >>>> \startaxis[
> >>>> title={\bf Relevé de notes chronologique},
> >>>> ymajorgrids=true,
> >>>> grid style={cyan!30},
> >>>> ymin=0,
> >>>> ymax=22,
> >>>> xmin=0,
> >>>> xmax=14,
> >>>> x=1cm,
> >>>> y=0.3cm,
> >>>> axis x line =bottom,
> >>>> axis y line =left,
> >>>> axis on top=true,
> >>>> axis line style =very thick,
> >>>> tick align=outside,
> >>>> tickwidth=0.12cm,
> >>>> tick style=very thick,
> >>>> xtick={\empty},
> >>>> ytick={0,2,...,18,20},
> >>>> extra x ticks={2,5,7,9,11,13},
> >>>> extra x tick labels={octobre,novembre,janvier,mars,avril, juin},
> >>>> extra x tick style={tick label style={rotate=45}},
> >>>> extra tick style={tick style={draw=none}},
> >>>> xlabel={Date},ylabel={Note},
> >>>> xlabel={Date},ylabel={Effectif},
> >>>>  every axis x label/.style={
> >>>>  at={(ticklabel* cs:1.01)},
> >>>>  anchor=west,
> >>>>  },
> >>>>  every axis y label/.style={
> >>>>  at={(ticklabel* cs:1.01)},
> >>>>  anchor=south,
> >>>>  },
> >>>>  samples=1000,
> >>>> >=stealth,
> >>>> ]
> >>>> \addplot [color=green,only marks] coordinates {
> >>>>   (1,5)
> >>>>   (2,7)
> >>>>   (3,5)
> >>>>   (4,10)
> >>>>   (5,5)
> >>>>   (6,8)
> >>>>   (7,10)
> >>>>   (8,8)
> >>>>   (9,10)
> >>>>   (10,14)
> >>>>   (11,18)
> >>>>   (12,14)
> >>>>   (13,11)
> >>>> };
> >>>> \stopaxis
> >>>> \stoptikzpicture
> >>>> \stoptext
> >>>>
> >>>>
> >>>> open source > level 7, order 88, name
> 'pgfplotsbinary.

Re: [NTG-context] Lmtx + pgfplots compilation error

2020-04-08 Thread Fabrice Couvreur
Hi Henri,
Sorry !

\usemodule[pgfplots]
\pgfplotsset{compat=newest}
\starttext
\starttikzpicture
  \startaxis
[
  xlabel=$x$,
 ylabel={$f(x) = x^2 - x +4$}
]
\addplot {x^2 - x +4};
  \stopaxis
\stoptikzpicture
\stoptext


tex error   > tex error on line 5 in file pgfplotsbinary.data.code.tex:
! Undefined control sequence

l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter
\endcsname{^0

}\advance\counter by1
lua error:

?


Le mer. 8 avr. 2020 à 12:40, Henri Menke  a écrit :

> MINIMAL working example...
>
> Cheers, Henri
>
> On 08/04/20, 11:52, Fabrice Couvreur wrote:
> > Hi Henri,
> > This file works well with context but does not work with lmtx.
> >
> > \usemodule[pgfplots]
> > \usemodule[pgfpltstable]
> > \pgfplotsset{compat=newest}
> > \starttext
> > \starttikzpicture
> > \startaxis[
> > title={\bf Relevé de notes chronologique},
> > ymajorgrids=true,
> > grid style={cyan!30},
> > ymin=0,
> > ymax=22,
> > xmin=0,
> > xmax=14,
> > x=1cm,
> > y=0.3cm,
> > axis x line =bottom,
> > axis y line =left,
> > axis on top=true,
> > axis line style =very thick,
> > tick align=outside,
> > tickwidth=0.12cm,
> > tick style=very thick,
> > xtick={\empty},
> > ytick={0,2,...,18,20},
> > extra x ticks={2,5,7,9,11,13},
> > extra x tick labels={octobre,novembre,janvier,mars,avril, juin},
> > extra x tick style={tick label style={rotate=45}},
> > extra tick style={tick style={draw=none}},
> > xlabel={Date},ylabel={Note},
> > xlabel={Date},ylabel={Effectif},
> >  every axis x label/.style={
> >  at={(ticklabel* cs:1.01)},
> >  anchor=west,
> >  },
> >  every axis y label/.style={
> >  at={(ticklabel* cs:1.01)},
> >  anchor=south,
> >  },
> >  samples=1000,
> >  >=stealth,
> > ]
> > \addplot [color=green,only marks] coordinates {
> >   (1,5)
> >   (2,7)
> >   (3,5)
> >   (4,10)
> >   (5,5)
> >   (6,8)
> >   (7,10)
> >   (8,8)
> >   (9,10)
> >   (10,14)
> >   (11,18)
> >   (12,14)
> >   (13,11)
> > };
> > \stopaxis
> > \stoptikzpicture
> > \stoptext
> >
> >
> > open source > level 7, order 88, name 'pgfplotsbinary.data.code.tex'
> >
> > tex error   > tex error on line 5 in file
> pgfplotsbinary.data.code.tex:
> > ! Undefined control sequence
> >
> > l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter
> > \endcsname{^0
> >
> > }\advance\counter by1
> > lua error:
> >
> > ?
> >
> >
> >
> > 
> >
> >
> > The control sequence at the end of the top line of your error message was
> > never
> > \def'ed. You can just continue as I'll forget about whatever was
> undefined.
> >
> >
> > mtx-context | fatal error: return code: 256
> >
> > TeX Output exited abnormally with code 1 at Wed Apr  8 11:49:56
> >
> >
> > Le mer. 8 avr. 2020 à 11:21, Henri Menke  a écrit
> :
> >
> > > Hi Fabrice,
> > >
> > > Could you provide a MWE, or maybe even open an issue on the bugtracker?
> > > https://github.com/pgf-tikz/pgfplots/issues
> > >
> > > Cheers, Henri
> > >
> > > On 07/04/20, 14:22, Fabrice Couvreur wrote:
> > > > Hi Henri,
> > > > Thank you for answering me. We're entering an area that I don't
> really
> > > know. I
> > > > replaced all ^^ by ^ but I'm not sure I understood. I now have the
> > > > following message :
> > > > Thank you
> > > > Fabrice
> > > >
> > > > tex error   > tex error on line 5 in file
> > > pgfplotsbinary.data.code.tex:
> > > > ! Undefined control sequence
> > > >
> > > > l.5 \catcode`\^00=11 \expandafter\xdef\csname pgfp@bin@\the\counter
> > > > \endcsname{^0
> > > >
> > > >0}\advance\counter by1
> > > > lua error:
> > > >
> > > > ?
> > > >
> > > >
> > > >
> > > > 
> > > >
> > > >
> > > > The control sequence at the end of the top line of your error
> message was
> > > > never
> > > > \def'ed. You can just continue as I'll forget about whatever was
> > > undefined.
> > > >
> > > >
> > > > mtx-conte

Re: [NTG-context] Lmtx + pgfplots compilation error

2020-04-08 Thread Fabrice Couvreur
Hi Henri,
This file works well with context but does not work with lmtx.

\usemodule[pgfplots]
\usemodule[pgfpltstable]
\pgfplotsset{compat=newest}
\starttext
\starttikzpicture
\startaxis[
title={\bf Relevé de notes chronologique},
ymajorgrids=true,
grid style={cyan!30},
ymin=0,
ymax=22,
xmin=0,
xmax=14,
x=1cm,
y=0.3cm,
axis x line =bottom,
axis y line =left,
axis on top=true,
axis line style =very thick,
tick align=outside,
tickwidth=0.12cm,
tick style=very thick,
xtick={\empty},
ytick={0,2,...,18,20},
extra x ticks={2,5,7,9,11,13},
extra x tick labels={octobre,novembre,janvier,mars,avril, juin},
extra x tick style={tick label style={rotate=45}},
extra tick style={tick style={draw=none}},
xlabel={Date},ylabel={Note},
xlabel={Date},ylabel={Effectif},
 every axis x label/.style={
 at={(ticklabel* cs:1.01)},
 anchor=west,
 },
 every axis y label/.style={
 at={(ticklabel* cs:1.01)},
 anchor=south,
 },
 samples=1000,
 >=stealth,
]
\addplot [color=green,only marks] coordinates {
  (1,5)
  (2,7)
  (3,5)
  (4,10)
  (5,5)
  (6,8)
  (7,10)
  (8,8)
  (9,10)
  (10,14)
  (11,18)
  (12,14)
  (13,11)
};
\stopaxis
\stoptikzpicture
\stoptext


open source > level 7, order 88, name 'pgfplotsbinary.data.code.tex'

tex error   > tex error on line 5 in file pgfplotsbinary.data.code.tex:
! Undefined control sequence

l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter
\endcsname{^0

}\advance\counter by1
lua error:

?






The control sequence at the end of the top line of your error message was
never
\def'ed. You can just continue as I'll forget about whatever was undefined.


mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Wed Apr  8 11:49:56


Le mer. 8 avr. 2020 à 11:21, Henri Menke  a écrit :

> Hi Fabrice,
>
> Could you provide a MWE, or maybe even open an issue on the bugtracker?
> https://github.com/pgf-tikz/pgfplots/issues
>
> Cheers, Henri
>
> On 07/04/20, 14:22, Fabrice Couvreur wrote:
> > Hi Henri,
> > Thank you for answering me. We're entering an area that I don't really
> know. I
> > replaced all ^^ by ^ but I'm not sure I understood. I now have the
> > following message :
> > Thank you
> > Fabrice
> >
> > tex error   > tex error on line 5 in file
> pgfplotsbinary.data.code.tex:
> > ! Undefined control sequence
> >
> > l.5 \catcode`\^00=11 \expandafter\xdef\csname pgfp@bin@\the\counter
> > \endcsname{^0
> >
> >0}\advance\counter by1
> > lua error:
> >
> > ?
> >
> >
> >
> > 
> >
> >
> > The control sequence at the end of the top line of your error message was
> > never
> > \def'ed. You can just continue as I'll forget about whatever was
> undefined.
> >
> >
> > mtx-context | fatal error: return code: 256
> >
> > TeX Output exited abnormally with code 1 at Tue Apr  7 14:15:58
> >
> > Le mar. 7 avr. 2020 à 04:21, Henri Menke  a écrit
> :
> >
> > > The problem is that pgfplots uses the ^^ syntax to access characters
> but
> > > this relies on ^ having catcode 7 which is not the case by default in
> > > ConTeXt.  I had a similar issue in PGF before and that was fixed by
> just
> > > replacing the ^^ syntax with the ascii code constants from
> > > syst-ini.mkxl.
> > >
> > > Cheers, Henri
> > >
> > > On 06/04/20, 22:23, Fabrice Couvreur wrote:
> > > > Hi,
> > > > Still with the idea of using lmtx, I get a compilation error when I
> use
> > > > pgfplots.
> > > > Thank you.
> > > > Fabrice
> > > > 
> > > > open source > level 9, order 92, name
> 'pgfplotsbinary.data.code.tex'
> > > >
> > > > tex error   > tex error on line 42 in file
> > > > pgfplotsbinary.data.code.tex: ! Undefined control sequence
> > > >
> > > > l.42 \catcode`\ =11^^I\expandafter\xdef\csname pgfp@bin@
> > > >
> > > > \the\counter^^I\endcsname{^^20}\endgroup\advance\counter by1
> > > > lua error:
> > > >
> > > > ?
> > > >
> > > >
> > > >
> > > > 
> > > >
> > > >
> > > > The control sequence at the end of the top line of your error
> message was
> > > > never
> > > > \def'ed. You can just continue as I'll forget about whateve

Re: [NTG-context] Background color of a framedtext that covers floats

2020-04-08 Thread Fabrice Couvreur
Hi Pablo,
Here a sample.
Fabrice

\useMPlibrary[dum]
\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
\starttext

\startframedtext[width=max,background=color,backgroundcolor=fondpaille]
 \starthanging[location=right]
 {\startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
 \input tufte
 \stophanging
\stopframedtext

\stoptext

Le mer. 8 avr. 2020 à 10:45, Pablo Rodriguez  a écrit :

> On 4/8/20 10:19 AM, Fabrice Couvreur wrote:
> > Hi,
> > Is there a more elegant way to have a white background for the table?
>
> Hi Fabrice,
>
> I think not including the table in the framed text is the easiest way to
> avoid the colored background.
>
> Or why do you need the table inside the framed text, which only adds the
> background color (and disables the frame)?
>
> > In fact, my question is more general: if we insert an image, the
> > background color envelops this image: how to solve this problem?
>
> Unless you provide a sample that shows the issue you are facing, not
> including the image in the frame may be your best option.
>
> Just in case it helps,
>
> 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
>
> ___
>
___
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] Background color of a framedtext that covers floats

2020-04-08 Thread Fabrice Couvreur
Hi,
Is there a more elegant way to have a white background for the table ?
In fact, my question is more general : if we insert an image, the
background color envelops this image : how to solve this problem ?
Thank you.
Fabrice

\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
\starttext
\startframedtext
  [frame=off,width=\textwidth,
background=color,backgroundcolor=fondpaille]
  \input tufte
  \startlinecorrection[blank]
   \startmidaligned
 \startxtable
   [align={lohi,middle}, option={stretch},framecolor=cyan,
offset=0.8ex,background=color,backgroundcolor=white]
   \startxrow
 \startxcell
   \bf Profondeur \m{x} (en mètre)
 \stopxcell
 \startxcell
   \bf Pression \m{P} (en bar)
 \stopxcell
 \startxcell
   \bf Volume \m{V} (en \m{\text{dm}^{3}})
 \stopxcell
   \stopxrow
   \startxrow
 \startxcell
   0 (niveau de la mer)
 \stopxcell
 \startxcell
   1
 \stopxcell
 \startxcell
   1
 \stopxcell
   \stopxrow
   \startxrow
 \startxcell
  10
 \stopxcell
 \startxcell
   2
 \stopxcell
 \startxcell
   0,5
 \stopxcell
   \stopxrow
 \stopxtable
   \stopmidaligned
 \stoplinecorrection
\stopframedtext
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Lmtx + pgfplots compilation error

2020-04-07 Thread Fabrice Couvreur
Hi Henri,
Thank you for answering me. We're entering an area that I don't really know. I
replaced all ^^ by ^ but I'm not sure I understood. I now have the
following message :
Thank you
Fabrice

tex error   > tex error on line 5 in file pgfplotsbinary.data.code.tex:
! Undefined control sequence

l.5 \catcode`\^00=11 \expandafter\xdef\csname pgfp@bin@\the\counter
\endcsname{^0

   0}\advance\counter by1
lua error:

?






The control sequence at the end of the top line of your error message was
never
\def'ed. You can just continue as I'll forget about whatever was undefined.


mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Tue Apr  7 14:15:58

Le mar. 7 avr. 2020 à 04:21, Henri Menke  a écrit :

> The problem is that pgfplots uses the ^^ syntax to access characters but
> this relies on ^ having catcode 7 which is not the case by default in
> ConTeXt.  I had a similar issue in PGF before and that was fixed by just
> replacing the ^^ syntax with the ascii code constants from
> syst-ini.mkxl.
>
> Cheers, Henri
>
> On 06/04/20, 22:23, Fabrice Couvreur wrote:
> > Hi,
> > Still with the idea of using lmtx, I get a compilation error when I use
> > pgfplots.
> > Thank you.
> > Fabrice
> > 
> > open source > level 9, order 92, name 'pgfplotsbinary.data.code.tex'
> >
> > tex error   > tex error on line 42 in file
> > pgfplotsbinary.data.code.tex: ! Undefined control sequence
> >
> > l.42 \catcode`\ =11^^I\expandafter\xdef\csname pgfp@bin@
> >
> > \the\counter^^I\endcsname{^^20}\endgroup\advance\counter by1
> > lua error:
> >
> > ?
> >
> >
> >
> > 
> >
> >
> > The control sequence at the end of the top line of your error message was
> > never
> > \def'ed. You can just continue as I'll forget about whatever was
> undefined.
> >
> >
> > mtx-context | fatal error: return code: 256
> >
> > TeX Output exited abnormally with code 1 at Mon Apr  6 22:19:01
>
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Lmtx + pgfplots compilation error

2020-04-06 Thread Fabrice Couvreur
Hi,
Still with the idea of using lmtx, I get a compilation error when I use
pgfplots.
Thank you.
Fabrice

open source > level 9, order 92, name 'pgfplotsbinary.data.code.tex'

tex error   > tex error on line 42 in file
pgfplotsbinary.data.code.tex: ! Undefined control sequence

l.42 \catcode`\ =11^^I\expandafter\xdef\csname pgfp@bin@

\the\counter^^I\endcsname{^^20}\endgroup\advance\counter by1
lua error:

?






The control sequence at the end of the top line of your error message was
never
\def'ed. You can just continue as I'll forget about whatever was undefined.


mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Mon Apr  6 22:19:01
___
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] Compile a file embedding modules with the lmtx engine

2020-04-03 Thread Fabrice Couvreur
Hi Pablo,
It seems to be working, thanks for your help.
Fabrice

Le ven. 3 avr. 2020 à 22:22, Pablo Rodriguez  a écrit :

> On 4/3/20 7:21 PM, Fabrice Couvreur wrote:
> >
> > I reinstalled context and lmtx, followed your instructions because I got
> > the same error message but now I get another error message; my editor is
> > Emacs.
> >
> > Running `LmtX' on `ESSAI' with
> > ``/home/viserion/LMTX/tex/texmf-linux-64/bin/mtxrun --autogenerate
> > --script context --autopdf ESSAI''
> > mtxrun  | unknown script 'context.lua' or 'mtx-context.lua'
>
> Hi Fabrice,
>
> from the shell, run "~/LMTX/tex/texmf-linux-64/bin/mtxrun --generate"
> before.
>
> After that, it should compile your document 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
>
> ___
>
___
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] Compile a file embedding modules with the lmtx engine

2020-04-03 Thread Fabrice Couvreur
I reinstalled context and lmtx, followed your instructions because I got
the same error message but now I get another error message; my editor is
Emacs.
Thank you.
Fabrice

Running `LmtX' on `ESSAI' with
``/home/viserion/LMTX/tex/texmf-linux-64/bin/mtxrun --autogenerate --script
context --autopdf ESSAI''
mtxrun  | unknown script 'context.lua' or 'mtx-context.lua'


TeX Output exited abnormally with code 1 at Fri Apr  3 19:15:18

Le ven. 3 avr. 2020 à 15:07, Pablo Rodriguez  a écrit :

> On 4/3/20 2:18 PM, Fabrice Couvreur wrote:
> > Hi,
> >
> > I did the installation then I copied the files and finally I did mtxrun
> > --generate
> > The file does not compile and I get a file where it says ERROR.
> >
> > viserion@archlinux ~]$ cd /home/viserion/data/context/tex/texmf-modules/
> > [viserion@archlinux texmf-modules]$ ls
> > doc  fonts  ls-R  metapost  scripts  source  tex  VERSION
>
> Hi Fabrice,
>
> I have just installed both LMTX and the ConTeXt Suite brand new. I moved
> the tex/texmf-modules contents form the Suite to LMTX tex/temxf-modules.
>
> Your file was compiled perfectly fine. I removed the contents of
> tex/texmf-modules and I got these errors:
>
> system  > jobfiles > unknown tex file
>
> '/home/ousia/64ctx/tex/texmf-modules/tex/context/pgf/frontendlayer/t-tikz.tex'
> modules > 'tikz' is loaded
>
> tex error   > tex error on line 2 in file ./a.tex: ! Undefined
> control sequence
>
>  \syst_helpers_triple_empty_two_nop  \usetikzlibrary
>
> l.2 \usetikzlibrary
>  [calc]
>
> If you get a similar error, I would do the following:
>
> 1. Remove tex/texmf-cache/luatex-cache.
> 2. Run "mtxrun --generate".
> 3. Compile the document.
>
> I hope this helps,
>
> 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
>
> ___
>
___
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] Compile a file embedding modules with the lmtx engine

2020-04-03 Thread Fabrice Couvreur
Hi,

I did the installation then I copied the files and finally I did mtxrun
--generate
The file does not compile and I get a file where it says ERROR.

viserion@archlinux ~]$ cd /home/viserion/data/context/tex/texmf-modules/
[viserion@archlinux texmf-modules]$ ls
doc  fonts  ls-R  metapost  scripts  source  tex  VERSION
[viserion@archlinux texmf-modules]$

Fabrice



Le ven. 3 avr. 2020 à 13:10, Pablo Rodriguez  a écrit :

> On 4/3/20 12:38 PM, Fabrice Couvreur wrote:
> > Hi,
> > I'm sorry but I didn't necessarily follow all the threads. I use to make
> > my graphics Metapost or Metafun, but I also sometimes use TiKz. This
> > file compiles with context but not with lmtx because the modules are not
> > recognized. I am willing to use only lmtx which seems to be the future
> > of ConteXt, but how do I do that?
>
> Hi Fabrice,
>
> do you have any modules installed in your LMTX distribution?
>
> As far as I know (sorry if I’ missing something), the user should
> install the modules manually for LMTX.
>
> Your sample compiles for me, but I copied the tex/texmf-modules
> directory from the ConTeXt Suite to the LMTX distribution.
>
> I hope this helps,
>
> 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
>
> ___
>
___
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] Compile a file embedding modules with the lmtx engine

2020-04-03 Thread Fabrice Couvreur
Hi,
I'm sorry but I didn't necessarily follow all the threads. I use to make my
graphics Metapost or Metafun, but I also sometimes use TiKz. This file
compiles with context but not with lmtx because the modules are not
recognized. I am willing to use only lmtx which seems to be the future of
ConteXt, but how do I do that ?
Thank you.
Fabrice


\usemodule[tikz]
\usetikzlibrary[calc]

\starttext

\startlinecorrection[blank]
  \startmidaligned
\starttikzpicture
   \draw[fill=orange!30e,draw=orange] (0,0) rectangle (5,5);
 \stoptikzpicture
 \stopmidaligned
\stoplinecorrection

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

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


Re: [NTG-context] Bug (Lua) ?

2020-03-19 Thread Fabrice Couvreur
Hi mf,
Thanks !
Fabrice

Le jeu. 19 mars 2020 à 11:46, mf  a écrit :

> Il 19/03/20 11:20, Fabrice Couvreur ha scritto:
> > Hi,
> > this file did not pose any problems but today yes.
> > Thank you.
> > Fabrice
> >
> > \starttext
> > \startluacode
> > local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" }
> > local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002",
> > "2003", "2004", "2005","2006" }
> > context.startxtable({"align={middle,lohi},
> > width=1.2cm,offset=0.8ex,bodyfont=9pt"})
> >
>
> context.startxtable( { align = "middle,lohi", width = "1.2cm", offset =
> "0.8ex", bodyfont = "9pt" } )
>
> The argument is a lua table. Values are usually strings.
>
> > context.startxrow({"background=color,backgroundcolor=green"})
>
> context.startxrow( { background = "color", backgroundcolor = "green" } )
>
> ... and so on.
>
> Best wishes,
> Massi
>
> ___
> 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
___


[NTG-context] Bug (Lua) ?

2020-03-19 Thread Fabrice Couvreur
Hi,
this file did not pose any problems but today yes.
Thank you.
Fabrice

\starttext
\startluacode
local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" }
local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002",
"2003", "2004", "2005","2006" }
context.startxtable({"align={middle,lohi},
width=1.2cm,offset=0.8ex,bodyfont=9pt"})

context.startxrow({"background=color,backgroundcolor=green"})
context.startxcell({"background=color,backgroundcolor=white,frame=off"})
context("")
context.stopxcell()
for _, letter in ipairs(letters_1) do
context.startxcell()
context(letter) context.stopxcell()
end
context.stopxrow()

context.startxrow()
for _, letter in ipairs(letters_2) do
context.startxcell() context(letter) context.stopxcell()
end
context.stopxrow()

context.startxrow()
context.startxcell() context("2") context.stopxcell()
context.startxcell({"width=2cm"}) context("Prix (kg)") context.stopxcell()
for i=0,8 do
context.startxcell() context("%0.5g",1.031^i) context.stopxcell()
end
context.stopxrow()

context.stopxtable()
\stopluacode
\stoptext


lua error   > lua error on line 34 in file /home/viserion/Table.tex:

[ctxlua]:5: unfinished string near '"align={middle,lohi},'

 1 \starttext
 2 \startluacode
 3 local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J"
}
 4 local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001",
"2002",
 5 "2003", "2004", "2005","2006" }
 6 >>  context.startxtable({"align={middle,lohi},
 7 width=1.2cm,offset=0.8ex,bodyfont=9pt"})
 8
 9 context.startxrow({"background=color,backgroundcolor=green"})
10
context.startxcell({"background=color,backgroundcolor=white,frame=off"})
11 context("")
12 context.stopxcell()
13 for _, letter in ipairs(letters_1) do
14 context.startxcell()
15 context(letter) context.stopxcell()
16 end

mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Thu Mar 19 11:15:49
___
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] Exercise file with statements and correction

2020-03-17 Thread Fabrice Couvreur
Hi Otared,

https://mailman.ntg.nl/pipermail/ntg-context/2016/087487.html

Thanks
Fabrice

Le mar. 17 mars 2020 à 22:56, Fabrice Couvreur 
a écrit :

> Hi Wolfgang,
> Is it possible to adapt your code with the environment that you proposed
> to me ?
> Thank you.
> Fabrice
>
> https://mailman.ntg.nl/pipermail/ntg-context/2016/087487.html
>
>  \defineframed
> [EXFRAME]
> [frame=off,
>  offset=0pt,
>  location=low,
>  width=\struttotal,
>  background=color,
>  backgroundcolor=black,
>  foregroundcolor=white,
>  forgroundstyle=bold]
>
>   \defineprocessor[ACPROCESSOR][command=\EXFRAME]
>   \defineconversionset[ACCONVERSION][][ACPROCESSOR->n]
>
>   \defineenumeration
>[ex]
>[text=,
> width=fit,
>numberconversionset=ACCONVERSION,
>alternative=serried,
>number=yes]
>
> Le mar. 17 mars 2020 à 22:14, Fabrice Couvreur <
> fabrice1.couvr...@gmail.com> a écrit :
>
>> Hi Pablo,
>> Thank you very much, it's a great base to start with.
>> Fabrice
>>
>> Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez  a écrit :
>>
>>> On 3/17/20 9:14 PM, Fabrice Couvreur wrote:
>>> > Hello,
>>> > I would like to make files with statements of exercises and correction
>>> > where it would be enough to click on "correction" to access the
>>> > correction at the end of the file. I'm running out of time, does anyone
>>> > have a model to share ?
>>>
>>> Hi Fabrice,
>>>
>>> I don’t have a model, but the following sample could give you a hint:
>>>
>>>   \setupinteraction[state=start, focus=standard]
>>>   \starttext
>>>   \startbodymatter
>>>   \chapter[lesson-1]{Lesson 1}
>>>   \section[exercises-1]{Exercises 1}
>>>   These are the exercises.
>>>
>>>   Here you have their key (\about[key-1]).
>>>   \stopbodymatter
>>>   \startappendices
>>>   \section[key-1]{Key to Lesson 1}
>>>   This is the key
>>>
>>>   Back to exercises (\about[exercises-1])
>>>   \stopappendices
>>>   \stoptext
>>>
>>> I hope it helps,
>>>
>>> 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
>>>
>>> ___
>>>
>>
___
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] Exercise file with statements and correction

2020-03-17 Thread Fabrice Couvreur
Hi Kavian,
Thank you so much. I don't even have time to offer examples !
Fabrice

Le mar. 17 mars 2020 à 22:56, Fabrice Couvreur 
a écrit :

> Hi Wolfgang,
> Is it possible to adapt your code with the environment that you proposed
> to me ?
> Thank you.
> Fabrice
>
> https://mailman.ntg.nl/pipermail/ntg-context/2016/087487.html
>
>  \defineframed
> [EXFRAME]
> [frame=off,
>  offset=0pt,
>  location=low,
>  width=\struttotal,
>  background=color,
>  backgroundcolor=black,
>  foregroundcolor=white,
>  forgroundstyle=bold]
>
>   \defineprocessor[ACPROCESSOR][command=\EXFRAME]
>   \defineconversionset[ACCONVERSION][][ACPROCESSOR->n]
>
>   \defineenumeration
>[ex]
>[text=,
> width=fit,
>numberconversionset=ACCONVERSION,
>alternative=serried,
>number=yes]
>
> Le mar. 17 mars 2020 à 22:14, Fabrice Couvreur <
> fabrice1.couvr...@gmail.com> a écrit :
>
>> Hi Pablo,
>> Thank you very much, it's a great base to start with.
>> Fabrice
>>
>> Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez  a écrit :
>>
>>> On 3/17/20 9:14 PM, Fabrice Couvreur wrote:
>>> > Hello,
>>> > I would like to make files with statements of exercises and correction
>>> > where it would be enough to click on "correction" to access the
>>> > correction at the end of the file. I'm running out of time, does anyone
>>> > have a model to share ?
>>>
>>> Hi Fabrice,
>>>
>>> I don’t have a model, but the following sample could give you a hint:
>>>
>>>   \setupinteraction[state=start, focus=standard]
>>>   \starttext
>>>   \startbodymatter
>>>   \chapter[lesson-1]{Lesson 1}
>>>   \section[exercises-1]{Exercises 1}
>>>   These are the exercises.
>>>
>>>   Here you have their key (\about[key-1]).
>>>   \stopbodymatter
>>>   \startappendices
>>>   \section[key-1]{Key to Lesson 1}
>>>   This is the key
>>>
>>>   Back to exercises (\about[exercises-1])
>>>   \stopappendices
>>>   \stoptext
>>>
>>> I hope it helps,
>>>
>>> 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
>>>
>>> ___
>>>
>>
___
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] Exercise file with statements and correction

2020-03-17 Thread Fabrice Couvreur
Hi Wolfgang,
Is it possible to adapt your code with the environment that you proposed to
me ?
Thank you.
Fabrice

https://mailman.ntg.nl/pipermail/ntg-context/2016/087487.html

 \defineframed
[EXFRAME]
[frame=off,
 offset=0pt,
 location=low,
 width=\struttotal,
 background=color,
 backgroundcolor=black,
 foregroundcolor=white,
 forgroundstyle=bold]

  \defineprocessor[ACPROCESSOR][command=\EXFRAME]
  \defineconversionset[ACCONVERSION][][ACPROCESSOR->n]

  \defineenumeration
   [ex]
   [text=,
width=fit,
   numberconversionset=ACCONVERSION,
   alternative=serried,
   number=yes]

Le mar. 17 mars 2020 à 22:14, Fabrice Couvreur 
a écrit :

> Hi Pablo,
> Thank you very much, it's a great base to start with.
> Fabrice
>
> Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez  a écrit :
>
>> On 3/17/20 9:14 PM, Fabrice Couvreur wrote:
>> > Hello,
>> > I would like to make files with statements of exercises and correction
>> > where it would be enough to click on "correction" to access the
>> > correction at the end of the file. I'm running out of time, does anyone
>> > have a model to share ?
>>
>> Hi Fabrice,
>>
>> I don’t have a model, but the following sample could give you a hint:
>>
>>   \setupinteraction[state=start, focus=standard]
>>   \starttext
>>   \startbodymatter
>>   \chapter[lesson-1]{Lesson 1}
>>   \section[exercises-1]{Exercises 1}
>>   These are the exercises.
>>
>>   Here you have their key (\about[key-1]).
>>   \stopbodymatter
>>   \startappendices
>>   \section[key-1]{Key to Lesson 1}
>>   This is the key
>>
>>   Back to exercises (\about[exercises-1])
>>   \stopappendices
>>   \stoptext
>>
>> I hope it helps,
>>
>> 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
>>
>> ___
>>
>
___
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] Exercise file with statements and correction

2020-03-17 Thread Fabrice Couvreur
Hi Pablo,
Thank you very much, it's a great base to start with.
Fabrice

Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez  a écrit :

> On 3/17/20 9:14 PM, Fabrice Couvreur wrote:
> > Hello,
> > I would like to make files with statements of exercises and correction
> > where it would be enough to click on "correction" to access the
> > correction at the end of the file. I'm running out of time, does anyone
> > have a model to share ?
>
> Hi Fabrice,
>
> I don’t have a model, but the following sample could give you a hint:
>
>   \setupinteraction[state=start, focus=standard]
>   \starttext
>   \startbodymatter
>   \chapter[lesson-1]{Lesson 1}
>   \section[exercises-1]{Exercises 1}
>   These are the exercises.
>
>   Here you have their key (\about[key-1]).
>   \stopbodymatter
>   \startappendices
>   \section[key-1]{Key to Lesson 1}
>   This is the key
>
>   Back to exercises (\about[exercises-1])
>   \stopappendices
>   \stoptext
>
> I hope it helps,
>
> 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
>
> ___
>
___
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] Exercise file with statements and correction

2020-03-17 Thread Fabrice Couvreur
Hello,
I would like to make files with statements of exercises and correction
where it would be enough to click on "correction" to access the correction
at the end of the file. I'm running out of time, does anyone have a model
to share ?
Thank you so much.
Fabrice
___
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] Quizz

2020-03-16 Thread Fabrice Couvreur
Hi Hans,
Thank you, I will try to use your file.
Fabrice

Le lun. 16 mars 2020 à 11:32, luigi scarso  a
écrit :

>
>
> On Mon, Mar 16, 2020 at 11:14 AM Hans Hagen  wrote:
>
>> On 3/15/2020 10:34 AM, Fabrice Couvreur wrote:
>> > Hi,
>> > With the Coronavirus pandemic, my school will close like all the
>> others.
>> > We chose to work with Microsoft Teams. I know how to file Math
>> exercises
>> > written with ConteXt and export to pdf format. Is it possible with
>> > ConteXt to create interactive Quizz?
>> it should be doable (in the past we've made those with choice, fill in
>> etc questions) but one problem with pdf is that there has been
>> introduced some restrictions, for instance one cannot save in the reader
>> so one then need to run a server that picks up the filled in stuff and
>> regenerates a pdf file ... no big deal but i must admit that i don't
>> have that code (if at all) around in loadable module form
>>
>
> In google chrome this seems to work, apart the choice fields (the choice
> selected has the red frame but  it has  no mark inside):
> https://martin-thoma.com/images/2012/02/pdf-form.pdf
>
> --
> luigi
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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] Quizz

2020-03-15 Thread Fabrice Couvreur
Hi,
With the Coronavirus pandemic, my school will close like all the others. We
chose to work with Microsoft Teams. I know how to file Math exercises
written with ConteXt and export to pdf format. Is it possible with ConteXt
to create interactive Quizz?
Thank you
Fabrice
___
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] Hatch color in a table cell

2020-03-12 Thread Fabrice Couvreur
Hi,
I would like to hatch the cell green.
Thank you.
Fabrice

\usecolors[xwi]
\startuniqueMPgraphic{meta:hash}{linewidth,linecolor,angle,gap}
if unknown context_back : input mp-back ; fi ;
some_hash ( OverlayWidth, OverlayHeight ,
\MPvar{linewidth}, \MPvar{linecolor} ,
\MPvar{angle}, \MPvar{gap} ) ;
\stopuniqueMPgraphic

\setupMPvariables
[meta:hash]
[gap=.25\bodyfontsize,
angle=45,
linewidth=\overlaylinewidth,
linecolor=\overlaylinecolor]

\def\metahashoverlay#1{\uniqueMPgraphic{meta:hash}{angle=#1}}
\defineoverlay[meta:hash:right]
[\metahashoverlay{ +45}]
\defineoverlay[meta:hash:left]
[\metahashoverlay{ -45}]
\defineoverlay[meta:hash:horizontal][\metahashoverlay{+180}]
\defineoverlay[meta:hash:vertical] [\metahashoverlay{ -90}]
\starttext
  \startmidaligned
\startxtable
  [align={lohi,middle}, width=1.5cm, background=color,
backgroundcolor=white, framecolor=purple,
meta:hash:linecolor=green]
  \startxrow

\startxcell[background=color,backgroundcolor=paleturquoise]
  i
\stopxcell
\startxcell[background=meta:hash:right,frame=off]

\stopxcell
\startxcell
  0
\stopxcell
\startxcell
  1
\stopxcell
\startxcell
  2
\stopxcell
  \stopxrow
  \startxrow

\startxcell[background=color,backgroundcolor=paleturquoise]
  S
\stopxcell
\startxcell
  0
\stopxcell
\startxcell

\stopxcell
\startxcell

\stopxcell
\startxcell

\stopxcell
  \stopxrow
  \startxrow

\startxcell[background=color,backgroundcolor=paleturquoise]
  a
\stopxcell
\startxcell
  3
\stopxcell
\startxcell

\stopxcell
\startxcell

\stopxcell
\startxcell

\stopxcell
\stopxrow
\stopxtable
  \stopmidaligned
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Problem with shading when using rotation (Metapost)

2020-03-03 Thread Fabrice Couvreur
Hi,
No idea ?
Thanks
Fabrice

Le sam. 29 févr. 2020 à 11:01, Fabrice Couvreur 
a écrit :

> Hi,
> Sorry to come back with my match problem. In fact, I do not understand
> why a rotation of 90 influences the degraded color of the ends of the
> matches.
> Thank you.
> Fabrice
>
> \starttext
> \startMPcode
>
>   def match (expr alpha, pos) =
> numeric l;
> l = 4.6cm;
> picture pic;
> pic = image (
> fill unitsquare xscaled 4cm  yscaled 0.2cm  withcolor yellow ;
> fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) --
> cycle withcolor(.6yellow + black);
> draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
> -- (0.1cm,-0.05cm) -- cycle ;
> fill fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm) shaded
> withshademethod "circular"
> withshadefactor 0.75
> withshadecolors (white,red););
> draw (fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm));
> draw pic rotated alpha shifted pos;
> enddef;
>
> picture house ;
> house = image (
> match(90,(0,0));
> match(0,(0,0));
> match(90,(l,0));
> match(120,(l,l));
> match(60,(0,l)););
>
> draw house;
>
> \stopMPcode
>
___
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] Problem with shading when using rotation (Metapost)

2020-02-29 Thread Fabrice Couvreur
Hi,
Sorry to come back with my match problem. In fact, I do not understand why
a rotation of 90 influences the degraded color of the ends of the matches.
Thank you.
Fabrice

\starttext
\startMPcode

  def match (expr alpha, pos) =
numeric l;
l = 4.6cm;
picture pic;
pic = image (
fill unitsquare xscaled 4cm  yscaled 0.2cm  withcolor yellow ;
fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) --
cycle withcolor(.6yellow + black);
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
-- (0.1cm,-0.05cm) -- cycle ;
fill fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm) shaded
withshademethod "circular"
withshadefactor 0.75
withshadecolors (white,red););
draw (fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm));
draw pic rotated alpha shifted pos;
enddef;

picture house ;
house = image (
match(90,(0,0));
match(0,(0,0));
match(90,(l,0));
match(120,(l,l));
match(60,(0,l)););

draw house;

\stopMPcode
___
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] Shading

2020-02-26 Thread Fabrice Couvreur
Hi Wolfgang,
I would like the same result as the code with TikZ.
Thank you.
Fabrice


\usemodule[tikz]
\starttext
\startMPcode
fill fullcircle xscaled 1cm yscaled 0.88cm shaded
withshademethod "circular"
withshadefactor 0.75
withshadecolors (white,red);
\stopMPcode


\starttikzpicture
  \shade[ball color=red] (0,0) ellipse (0.5cm and 0.44cm);
\stoptikzpicture
\stoptext

Le mar. 25 févr. 2020 à 17:18, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> On Tue, 25 Feb 2020 12:34:00 +0100
> Fabrice Couvreur  wrote:
>
> > Hi,
> > In the Metafun documentation on page 410, there is a shaded bullet "fill
> > fullcircle shaded cshade".
> > I tried to reproduce the same effect, but it is not exactly the same
> result.
>
> It's different because your code isn't the same as the example in the
> manual.
>
> \starttext
>
> \startMPcode
> fill fullcircle scaled 4cm shaded withshademethod "circular" ;
> \stopMPcode
>
> \stoptext
>
> > \starttext
> > \startMPcode
> > fill fullcircle scaled 4cm shaded  withshademethod "circular"
> >withshadevector (1,0)
> >withshadecolors (red, white) ;
> > \stopMPcode
> > \stoptext
>
> Not sure what you're trying to achieve but this is closer the example
> above.
>
> \starttext
>
> \startMPcode
> fill fullcircle scaled 4cm shaded
> withshademethod "circular"
> withshadefactor 0.75
> withshadecolors (white,red)
> ;
> \stopMPcode
>
> \stoptext
>
> Wolfgang
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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] Shading

2020-02-25 Thread Fabrice Couvreur
Hi,
In the Metafun documentation on page 410, there is a shaded bullet "fill
fullcircle shaded cshade".
I tried to reproduce the same effect, but it is not exactly the same result.
Thank you.
Fabrice

\starttext
\startMPcode
fill fullcircle scaled 4cm shaded  withshademethod "circular"
   withshadevector (1,0)
   withshadecolors (red, white) ;
\stopMPcode
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-15 Thread Fabrice Couvreur
Hi Henri,
Why does the blue path not rotate 90 with the draw command but rotate with
the fill command ?

\startMPcode

  def match (expr alpha, pos) =
fill unitsquare xscaled 4cm  yscaled 0.2cm rotated alpha shifted pos
withcolor yellow ;
fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) --
cycle rotated alpha withcolor(.6yellow + black);
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
-- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor blue;
 draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
-- (0.1cm,-0.05cm) -- cycle rotated alpha withcolor blue;
draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
rotated alpha;
draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
rotated alpha
withshademethod "circular 1"
withshadevector (0,1)
withshadecolors (red,white);
enddef;
  match(0,(0,0));
  match(90,(4.2cm,0));
  match(90,(0,0));
  match(0,(0,4.2cm));

\stopMPcode


Le sam. 15 févr. 2020 à 00:01, Fabrice Couvreur 
a écrit :

> Hi,
> Hi,
> I have corrected for the dimensions of the ellipse but I cannot achieve
> the same effect for the red color.
> Thank you.
> Fabrice
> \startMPcode
>   def match (expr pos) =
> fill unitsquare xscaled 4cm  yscaled 0.2cm shifted pos withcolor
> yellow;
> fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) -- cycle
>  withcolor(.6yellow + black);
> draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
> -- (0.1cm,-0.05cm) -- cycle;
> fill fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
> withcolor red;
> draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm);
> draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
>  withshademethod "circular"
>  withshadevector (0,1)
>  withshadecolors (red,white)
>   enddef;
>   match((0,0));
>
> \stopMPcode
>
>
>
> Le ven. 14 févr. 2020 à 16:43, Fabrice L  a
> écrit :
>
>> Hi,
>>
>> Le 13 févr. 2020 à 16:45, Fabrice Couvreur 
>> a écrit :
>>
>>
>> How to have the color defined by {yellow!60!black} with Metapost ?
>>
>>
>> color MyColor ; MyColor := .6[yellow,black] ;
>>
>> See metafun manual, section 1.13.
>>
>> Thank you.
>> Fabrice
>>
>>
>> Fabrice (another one !).
>>
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>>
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-14 Thread Fabrice Couvreur
Hi,
Hi,
I have corrected for the dimensions of the ellipse but I cannot achieve the
same effect for the red color.
Thank you.
Fabrice
\startMPcode
  def match (expr pos) =
fill unitsquare xscaled 4cm  yscaled 0.2cm shifted pos withcolor yellow;
fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) -- cycle
 withcolor(.6yellow + black);
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
-- (0.1cm,-0.05cm) -- cycle;
fill fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
withcolor red;
draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm);
draw fullcircle xscaled 0.50cm yscaled 0.44cm shifted (4.125cm,0.1cm)
 withshademethod "circular"
 withshadevector (0,1)
 withshadecolors (red,white)
  enddef;
  match((0,0));

\stopMPcode



Le ven. 14 févr. 2020 à 16:43, Fabrice L  a écrit :

> Hi,
>
> Le 13 févr. 2020 à 16:45, Fabrice Couvreur 
> a écrit :
>
>
> How to have the color defined by {yellow!60!black} with Metapost ?
>
>
> color MyColor ; MyColor := .6[yellow,black] ;
>
> See metafun manual, section 1.13.
>
> Thank you.
> Fabrice
>
>
> Fabrice (another one !).
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Metapost and TikZ color code equivalent

2020-02-14 Thread Fabrice L
Hi,

> Le 13 févr. 2020 à 16:45, Fabrice Couvreur  a 
> écrit :

> How to have the color defined by {yellow!60!black} with Metapost ?

color MyColor ; MyColor := .6[yellow,black] ;

See metafun manual, section 1.13.

> Thank you.
> Fabrice

Fabrice (another one !).
> ___
> 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
___


  1   2   3   4   5   6   7   8   >