Re: [NTG-context] Loop and graphictext (Metafun)

2015-10-05 Thread Fabrice Couvreur
Hi Hans,
In fact, as the loop does not work, I have not added to the code.
It's true that your solution is simple !
Thank you,
Fabrice

2015-10-05 19:48 GMT+02:00 Hans Hagen <pra...@wxs.nl>:

> On 10/5/2015 6:28 PM, Fabrice Couvreur wrote:
>
>> Hi,
>> I tried to write a loop to display the title, but it does not. How to do ?
>> Thank you,
>> Fabrice
>>
>> \setuppagenumbering[location=]
>>
>> \setupcolors
>>[state=start]
>>
>> \definecolor[pagecolor][s=.6]
>> \definecolor[textcolor][r=.6]
>>
>>
>> \startMPinclusions
>>color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
>>color textcolor ; textcolor := \MPcolor{textcolor} ;
>> \stopMPinclusions
>>
>> \setMPtext{title}{Serie statistiques à deux variables}
>>
>> \startuseMPgraphic{Title}
>>
>>path p ; p := OverlayBox  ;
>>fill OverlayBox withcolor pagecolor ;
>>setbounds currentpicture to OverlayBox ;
>>
>> \stopuseMPgraphic
>>
>> \defineoverlay[Title][\useMPgraphic{Title}]
>>
>> \defineframedtext
>>[MyTitle]
>>[before={\blank[line,halfline]},
>> after={\blank},
>> frame=off,
>> background=Title,
>> width=\textwidth,
>> height=fit,
>> ]
>>
>> \starttext
>>
>> \startMyTitle
>>
>> \startMPcode
>>
>> numeric k ; k :=0 ;
>> string s ; s := \MPstring{title} ;
>> picture r ;
>> r := image (graphictext
>>  substring (k,k+1) of s
>>  randomized .5pt
>>  scaled 5pt
>>  withfillcolor textcolor
>>  withpen pencircle scaled 1pt ; ) ;
>>draw r ;
>>
>> \stopMPcode
>>
>> \stopMyTitle
>>
>> \stoptext
>>
>
> i see no loop, why not just
>
> r := image (graphictext
> s
>
>
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>  | 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Loop and graphictext (Metafun)

2015-10-05 Thread Fabrice Couvreur
\startmidaligned

\startMPcode

...

\stopMPcode

\stopmidaligned

2015-10-05 20:31 GMT+02:00 Fabrice Couvreur <fabrice1.couvr...@gmail.com>:

> How to center the title ?
>
> 2015-10-05 20:11 GMT+02:00 Fabrice Couvreur <fabrice1.couvr...@gmail.com>:
>
>> Hi Hans,
>> In fact, as the loop does not work, I have not added to the code.
>> It's true that your solution is simple !
>> Thank you,
>> Fabrice
>>
>> 2015-10-05 19:48 GMT+02:00 Hans Hagen <pra...@wxs.nl>:
>>
>>> On 10/5/2015 6:28 PM, Fabrice Couvreur wrote:
>>>
>>>> Hi,
>>>> I tried to write a loop to display the title, but it does not. How to
>>>> do ?
>>>> Thank you,
>>>> Fabrice
>>>>
>>>> \setuppagenumbering[location=]
>>>>
>>>> \setupcolors
>>>>[state=start]
>>>>
>>>> \definecolor[pagecolor][s=.6]
>>>> \definecolor[textcolor][r=.6]
>>>>
>>>>
>>>> \startMPinclusions
>>>>color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
>>>>color textcolor ; textcolor := \MPcolor{textcolor} ;
>>>> \stopMPinclusions
>>>>
>>>> \setMPtext{title}{Serie statistiques à deux variables}
>>>>
>>>> \startuseMPgraphic{Title}
>>>>
>>>>path p ; p := OverlayBox  ;
>>>>fill OverlayBox withcolor pagecolor ;
>>>>setbounds currentpicture to OverlayBox ;
>>>>
>>>> \stopuseMPgraphic
>>>>
>>>> \defineoverlay[Title][\useMPgraphic{Title}]
>>>>
>>>> \defineframedtext
>>>>[MyTitle]
>>>>[before={\blank[line,halfline]},
>>>> after={\blank},
>>>> frame=off,
>>>> background=Title,
>>>> width=\textwidth,
>>>> height=fit,
>>>> ]
>>>>
>>>> \starttext
>>>>
>>>> \startMyTitle
>>>>
>>>> \startMPcode
>>>>
>>>> numeric k ; k :=0 ;
>>>> string s ; s := \MPstring{title} ;
>>>> picture r ;
>>>> r := image (graphictext
>>>>  substring (k,k+1) of s
>>>>  randomized .5pt
>>>>  scaled 5pt
>>>>  withfillcolor textcolor
>>>>  withpen pencircle scaled 1pt ; ) ;
>>>>draw r ;
>>>>
>>>> \stopMPcode
>>>>
>>>> \stopMyTitle
>>>>
>>>> \stoptext
>>>>
>>>
>>> i see no loop, why not just
>>>
>>> r := image (graphictext
>>> s
>>>
>>>
>>>
>>> -
>>>   Hans Hagen | PRAGMA ADE
>>>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>> tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>>>  | 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://tex.aanhet.net
>>> archive  : http://foundry.supelec.fr/projects/contextrev/
>>> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Loop and graphictext (Metafun)

2015-10-05 Thread Fabrice Couvreur
How to center the title ?

2015-10-05 20:11 GMT+02:00 Fabrice Couvreur <fabrice1.couvr...@gmail.com>:

> Hi Hans,
> In fact, as the loop does not work, I have not added to the code.
> It's true that your solution is simple !
> Thank you,
> Fabrice
>
> 2015-10-05 19:48 GMT+02:00 Hans Hagen <pra...@wxs.nl>:
>
>> On 10/5/2015 6:28 PM, Fabrice Couvreur wrote:
>>
>>> Hi,
>>> I tried to write a loop to display the title, but it does not. How to do
>>> ?
>>> Thank you,
>>> Fabrice
>>>
>>> \setuppagenumbering[location=]
>>>
>>> \setupcolors
>>>[state=start]
>>>
>>> \definecolor[pagecolor][s=.6]
>>> \definecolor[textcolor][r=.6]
>>>
>>>
>>> \startMPinclusions
>>>color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
>>>color textcolor ; textcolor := \MPcolor{textcolor} ;
>>> \stopMPinclusions
>>>
>>> \setMPtext{title}{Serie statistiques à deux variables}
>>>
>>> \startuseMPgraphic{Title}
>>>
>>>path p ; p := OverlayBox  ;
>>>fill OverlayBox withcolor pagecolor ;
>>>setbounds currentpicture to OverlayBox ;
>>>
>>> \stopuseMPgraphic
>>>
>>> \defineoverlay[Title][\useMPgraphic{Title}]
>>>
>>> \defineframedtext
>>>[MyTitle]
>>>[before={\blank[line,halfline]},
>>> after={\blank},
>>> frame=off,
>>> background=Title,
>>> width=\textwidth,
>>> height=fit,
>>> ]
>>>
>>> \starttext
>>>
>>> \startMyTitle
>>>
>>> \startMPcode
>>>
>>> numeric k ; k :=0 ;
>>> string s ; s := \MPstring{title} ;
>>> picture r ;
>>> r := image (graphictext
>>>  substring (k,k+1) of s
>>>  randomized .5pt
>>>  scaled 5pt
>>>  withfillcolor textcolor
>>>  withpen pencircle scaled 1pt ; ) ;
>>>draw r ;
>>>
>>> \stopMPcode
>>>
>>> \stopMyTitle
>>>
>>> \stoptext
>>>
>>
>> i see no loop, why not just
>>
>> r := image (graphictext
>> s
>>
>>
>>
>> -
>>   Hans Hagen | PRAGMA ADE
>>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>> tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>>  | 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://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Loop and graphictext (Metafun)

2015-10-05 Thread Fabrice Couvreur
Hi,
I tried to write a loop to display the title, but it does not. How to do ?
Thank you,
Fabrice

\setuppagenumbering[location=]

\setupcolors
  [state=start]

\definecolor[pagecolor][s=.6]
\definecolor[textcolor][r=.6]


\startMPinclusions
  color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
  color textcolor ; textcolor := \MPcolor{textcolor} ;
\stopMPinclusions

\setMPtext{title}{Serie statistiques à deux variables}

\startuseMPgraphic{Title}

  path p ; p := OverlayBox  ;
  fill OverlayBox withcolor pagecolor ;
  setbounds currentpicture to OverlayBox ;

\stopuseMPgraphic

\defineoverlay[Title][\useMPgraphic{Title}]

\defineframedtext
  [MyTitle]
  [before={\blank[line,halfline]},
   after={\blank},
   frame=off,
   background=Title,
   width=\textwidth,
   height=fit,
   ]

\starttext

\startMyTitle

\startMPcode

numeric k ; k :=0 ;
string s ; s := \MPstring{title} ;
picture r ;
r := image (graphictext
substring (k,k+1) of s
randomized .5pt
scaled 5pt
withfillcolor textcolor
withpen pencircle scaled 1pt ; ) ;
  draw r ;

\stopMPcode

\stopMyTitle

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Space between both environments

2015-09-12 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you for your help, it works fine.
Fabrice

2015-09-08 20:24 GMT+02:00 Wolfgang Schuster <schuster.wolfg...@gmail.com>:

> Fabrice Couvreur <fabrice1.couvr...@gmail.com>
> 8. September 2015 18:29
> Hi,
> @Otared I accept your answer until I can not fix my code, thank you.
>
> A better solution is to increase the space before each environment because
> the part of the title which sticks out of the box does not exist for TeX.
>
> Changing the before value to “before={\blank[line,halfline]}” should be
> enough.
>
> @Woffgang  I have to change the code (how ?) because I realize that the
> text of the second environment exceeds the frame (if you draw it).
>
> Add
>
> maxwidth=\availablehsize,
>
> to your column setup.
>
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Space between both environments

2015-09-08 Thread Fabrice Couvreur
Hi,
@Otared I accept your answer until I can not fix my code, thank you.

@Woffgang  I have to change the code (how ?) because I realize that the text of
the second environment exceeds the frame (if you draw it).

2015-09-07 21:02 GMT+02:00 Wolfgang Schuster <schuster.wolfg...@gmail.com>:

> Fabrice Couvreur <fabrice1.couvr...@gmail.com>
> 7. September 2015 19:35
> Hi,
> I can not insert a space between my two environments.
>
> There is a space but you can’t see it because the colored background of
> your frames is placed too low (you can see it when you use "frame=on").
>
> Thank you.
> Fabrice
>
> % macros=mkvi
>
> \setupcolors[state=start]
>
>
> \definecolor[MyColorA][c=0.00, m=0.10, y=0.20, k=0.00]
>
> \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
>
> \definecolor[MyColorC][c=0.3, m=0.00, y=0.00, k=0.05]
>
> \definecolor[MyColorD][c=0.6, m=0.00, y=0.00, k=0.10]
>
>
> \defineframedtext
>   [MyDefinition]
>   [before={\blank},
>after={\blank},
>frame=off,
>background=MyFrame,
>width=\textwidth,
>height=fit,
>location=left,
>style=italic]
>
> \defineoverlay
>   [MyFrame]
>   [\useMPgraphic{MyFrame}]
>
> \definelabel
>   [Définition]
>   [headstyle=\bf\smallcaps]
>
> \startuseMPgraphic{MyFrame}
> path b ;
> picture p ;
> p := textext.rt("\white\Définition") ;
> p := p shifted (2BodyFontSize,OverlayHeight-ypart center
> p+.25ExHeight) ;
> b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
> fill OverlayBox withcolor \MPcolor{MyColorA} ;
> fill b withcolor \MPcolor{MyColorB} ;
> draw p ;
>
> setbounds currentpicture to OverlayBox ;
>
> \stopuseMPgraphic
>
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Sectioning and structure

2015-09-07 Thread Fabrice Couvreur
Hi,
I'm about to write a book using a structure. The desire is to get this like
contents of the table of contents :

Chapter 1 Title

  Part 1  Title

   1.
   2.


  Part 2  Title

   1.
   2.

  Part 3  Title

   1.
   2.


Chapter 2 Title

  Part 1 Title

  1.
  2.


  Part 2 Title

  1.
  2.

Part 3 Title

  1.
  2.

##
lesson.tex


\project manual

\startproduct lesson

\startfrontmatter
  \component   titlepage
  \component   contents
\stopfrontmatter

\startbodymatter
  \component  chapter-1
  \component  chapter-2
\stopbodymatter

\stopproduct



chapter-1.tex

\startcomponent chapter-1

  \component activities-1
  \component synthesis-1
  \component training-1

\stopcomponent

#

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Space between both environments

2015-09-07 Thread Fabrice Couvreur
Hi,
I can not insert a space between my two environments.
Thank you.
Fabrice

% macros=mkvi

\setupcolors[state=start]


\definecolor[MyColorA][c=0.00, m=0.10, y=0.20, k=0.00]

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]

\definecolor[MyColorC][c=0.3, m=0.00, y=0.00, k=0.05]

\definecolor[MyColorD][c=0.6, m=0.00, y=0.00, k=0.10]


\defineframedtext
  [MyDefinition]
  [before={\blank},
   after={\blank},
   frame=off,
   background=MyFrame,
   width=\textwidth,
   height=fit,
   location=left,
   style=italic]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt("\white\Définition") ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight)
;
b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic


\definemixedcolumns
  [myColumn]
  [n=2,
   separator=rule,
   rulecolor=MyColorC,
   rulethickness=1pt,
   balance=yes]

\setupalign[verytolerant,stretch,hanging]


\defineoverlay
  [Funny]
  [\useMPgraphic{Funny}]

\definelabel
  [MÉTHODE]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{Funny}
interim linejoin := mitered ;
interim linecap := squared ;
path b ;
picture p ;
p := textext.rt("\white\MÉTHODE") ;
p := p shifted (0,OverlayHeight) ;
b := boundingbox p ;
drawoptions (withpen pencircle scaled 3mm withcolor \MPcolor{MyColorC})
;
draw leftboundary OverlayBox ;
fill b withcolor \MPcolor{MyColorD} ;
draw p ;
setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\defineframedtext
  [Methode]
  [before={\blank},
   after={\blank},
   frame=off,
   background=Funny,
   width=\textwidth,
   height=fit,
   ]



\starttext

\startMyDefinition
\input knuth
\stopMyDefinition

\startMethode

\startmyColumn

\input ward

\column
\input knuth
\stopmyColumn


\stopMethode
\stopsection
\stopchapter
\stoppart
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] New beta

2015-09-02 Thread Fabrice Couvreur
Hi,
If you compile the following file with new beta, the placement of the table
and the figure is incorrect.
Thank you,
Fabrice


\definefloat
   [recipe]
   [figure]

\setupfloat
   [recipe]
   [default={right,none}]

\startsetups[table:initialize]
  \setupTABLE[start][align={middle,lohi},offset=1ex]
\stopsetups

\starttext

\placerecipe{}{\externalfigure[louvre.jpg][width=5cm]}
Le tableau ci-dessous indique le nombre d'entrées (en milliers) au musée du
Louvre :
\blank
\startmidaligned
\bTABLE[setups=table:initialize]
\bTR
\bTH  Années \eTH
\bTD  2010\eTD
\bTD  2011\eTD
\bTD  2012\eTD
\bTD 2 013\eTD
\eTR
\bTR
\bTH Entrées (en milliers) \eTH
\bTD  8\,346   \eTD
\bTD  8\,841   \eTD
\bTD  9\,720   \eTD
\bTD  9\,200   \eTD
\eTR
\eTABLE
\stopmidaligned
\blank

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] New beta

2015-09-02 Thread Fabrice Couvreur
Hi,
If you compile the following file with new beta, the placement of the table
and the figure is incorrect.
Thank you,
Fabrice


\definefloat
   [recipe]
   [figure]

\setupfloat
   [recipe]
   [default={right,none}]

\startsetups[table:initialize]
  \setupTABLE[start][align={middle,lohi},offset=1ex]
\stopsetups

\starttext

\placerecipe{}{\externalfigure[louvre.jpg][width=5cm]}
Le tableau ci-dessous indique le nombre d'entrées (en milliers) au musée du
Louvre :
\blank
\startmidaligned
\bTABLE[setups=table:initialize]
\bTR
\bTH  Années \eTH
\bTD  2010\eTD
\bTD  2011\eTD
\bTD  2012\eTD
\bTD 2 013\eTD
\eTR
\bTR
\bTH Entrées (en milliers) \eTH
\bTD  8\,346   \eTD
\bTD  8\,841   \eTD
\bTD  9\,720   \eTD
\bTD  9\,200   \eTD
\eTR
\eTABLE
\stopmidaligned
\blank

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Bug with the command \blank ?

2015-08-30 Thread Fabrice Couvreur
Hi,
It seems there is a bug with the command \blank in the latest standalone
context.
If you compile with ConTeXt (texlive 2015), the result is as expected.
Thank you,
Fabrice

\setuppagenumbering[location=]

\setupcolors
  [state=start]

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]
\definecolor[MyColorC][c=0.3, m=0.00, y=0.00, k=0.05]

\defineframedtext
  [MyDefinition]
  [before={\blank},
   after={\blank},
   frame=off,
   background=MyFrame,
   width=\textwidth,
   height=fit,
   location=left,
   style=italic]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt(\white\Définition) ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight)
;
b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorC} ;
draw p ;
\stopuseMPgraphic


\starttext

\startchapter
[title={Chapter one}]

\startMyDefinition

\input knuth
\stopMyDefinition

\stopchapter
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Left border of a rectangle (Metafun)

2015-08-29 Thread Fabrice Couvreur
Hi,
I want to draw the left border of the rectangle, but it is drawn in the
middle.
Why ?
Thank you,
Fabrice

\setupcolors[state=start]


\definecolor[MyColorA][c=0.3, m=0.00, y=0.00, k=0.05]



\defineoverlay
  [Funny]
  [\useMPgraphic{Funny}]

\startuseMPgraphic{Funny}
interim linecap := butt ;
path p ;
p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
drawoptions (withpen pencircle scaled 6.5pt withcolor
\MPcolor{MyColorA}) ;
draw ulcorner p--llcorner p ;
\stopuseMPgraphic

\defineframedtext
  [Methode]
  [before={\blank},
   after={\blank},
   frame=off,
   background=Funny,
   width=\textwidth,
   height=fit]

\starttext

\startMethode
\input knuth
\stopMethode

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Bug with the latest ConTeXt Standalone (TiKZ) ?

2015-08-28 Thread Fabrice Couvreur
Hi,
If I compile this simple file with context (TeXLive 2015), no problems.

\setupcolors[state=start]

\usemodule[tikz]

\starttext
\starttikzpicture
\draw[-,red] (0,0) -- (3,3);
\stoptikzpicture
\stoptext

If I compile with the latest version of context Standalone, I get the
following message :

tex errortex error on line 8 in file /home/fab/ntg32.tex: !
Package pgfkeys Error: I do not know the key '/tikz/animations/whom', to
which you passed '[scope]@auto', and I am going to ignore it. Perhaps you
misspelled it.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] No space after a closing delimiter

2015-08-27 Thread Fabrice Couvreur
In fact, you are both right, write the macro differently.


\def\repere{\bigl(O\,;I,J\bigr)}

\starttext
\dorecurse{2}{blabla} $\repere$ \dorecurse{2}{blabla}

\dorecurse{2}{blabla} $\bigl(O\,;I,J\bigr)$ \dorecurse{2}{blabla}

\stoptext

Thanks,
Fabrice

2015-08-27 13:32 GMT+02:00 Peter Münster pmli...@free.fr:

 On Thu, Aug 27 2015, Fabrice Couvreur wrote:

  I did not know it because, before migrating to context, I used latex with
  this :  \newcommand{\repere}{$\bigl(O\,;I,J\bigr)$.

 In LaTeX there is no space neither:

 --8---cut here---start-8---
 \newcommand{\repere}{$\bigl(O\,;I,J\bigr)$}
 \documentclass{article}
 \begin{document}
 x \repere x
 \end{document}
 --8---cut here---end---8---

 --
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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] About graphictext macro (Metafun)

2015-08-27 Thread Fabrice Couvreur
Hi Hans,
I installed pstoedit :

root@debian:/home/fab# dpkg --status pstoedit
Package: pstoedit
Status: install ok installed
Priority: optional
Section: graphics
Installed-Size: 662
Maintainer: Roland Stigge sti...@antcom.de
Architecture: amd64
Source: pstoedit (3.62-2)
Version: 3.62-2+b3
Depends: libc6 (= 2.2.5), libpstoedit0c2a, libstdc++6 (= 4.1.1),
ghostscript
Suggests: xfig | ivtools-bin | tgif | transfig
Description: PostScript and PDF files to editable vector graphics converter
 pstoedit converts Postscript and PDF files to various editable
 vector graphic formats including tgif, xfig, PDF graphics, gnuplot format,
 idraw, MetaPost, GNU Metafile, PIC, Kontour and flattened PostScript.
Homepage: http://www.pstoedit.net/
root@debian:/home/fab#

I compiled the file as this : context test.tex but it is still empty.
Thanks,
Fabrice


\setuppagenumbering[location=]

\setupcolors
  [state=start]

\setMPtext{text}{MATH\'{E}MATIQUES}


\starttext
\startuseMPgraphic{test}
picture pic ;
pic := image(graphictext \MPstring{text}
withdrawcolor red
withpen pencircle scaled 1pt ; ) ;
\stopuseMPgraphic
\stoptext



2015-08-27 10:23 GMT+02:00 Fabrice Couvreur fabrice1.couvr...@gmail.com:

 Hi Hans,

 Do you have pstoedit installed ?


 root@debian:/home/fab# apt-cache search pstoedit
 libpstoedit0c2a - PostScript to editable vector graphics library (runtime
 files)
 root@debian:/home/fab#

 I compile the file test.tex  with  context test.tex
 Fabrice

 2015-08-27 9:39 GMT+02:00 Hans Hagen pra...@wxs.nl:

 On 8/26/2015 7:12 PM, Fabrice Couvreur wrote:

 Hi,
 I try to understand how this macro by testing a simple example. Why pdf
 file is empty?
 This question follows my question Cover page (Metafun)
 http://www.ntg.nl/pipermail/ntg-context/2015/083078.html
 Thank you.

 \setuppagenumbering[location=]

 \setupcolors
[state=start]

 \setMPtext{text}{MATHEMATIQUES}


 \starttext
 \startuseMPgraphic{test}
 picture pic ;
 pic := image(graphictext \MPstring{text}
 withdrawcolor red
 withpen pencircle scaled 1pt ; ) ;
 addto currentpicture also pic ;
 \stopuseMPgraphic
 \stoptext


 Do you have pstoedit installed?

 Anyway, there is a new mechanism that doesn't depend on additional
 programs:

 % outlinetext   (text) transformations ;
 % outlinetext.d (text) (draw options) transformations ;
 % outlinetext.f (text) (fill options) transformations ;
 % outlinetext.b (text) (draw options) (fill options) transformations ;
 % outlinetext.r (text) (fill options) (draw options) transformations ;

 \starttext

 \startMPdefinitions
 let graphictext = new_graphictext ;
 \stopMPdefinitions

 \startMPpage

 draw outlinetext.b
 (\framed[align=normal]{\input{tufte}})
 (withcolor .5white)
 (withcolor red withpen pencircle scaled 1/10)
 xsized 10cm ;

 \stopMPpage

 \startMPpage

 draw outlinetext.r
 (\framed[align=normal]{\input{tufte}})
 (withcolor red withpen pencircle scaled 1/10)
 (withcolor .5white)
 xsized 10cm ;

 \stopMPpage

 \startMPpage

 draw outlinetext.d
 (\framed[align=normal]{\input{tufte}})
 (withcolor .5white)
 xsized 10cm ;

 \stopMPpage

 \startMPpage

 picture p ; p := outlinetext.p(PX) ;

 for i within p :
 draw i withcolor red withpen pencircle scaled 1/10 ;
 endfor ;

 \stopMPpage

 \stoptext



 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] No space after a closing delimiter

2015-08-27 Thread Fabrice Couvreur
Hi Otared,
I did not know it because, before migrating to context, I used latex with
this :  \newcommand{\repere}{$\bigl(O\,;I,J\bigr)$.
It's not very convenient to add \ every time !
Thanks,
Fabrice

2015-08-27 11:30 GMT+02:00 Otared Kavian ota...@gmail.com:

 Hi Fabrice,

 This is a normal behaviour of TeX macro commands. You should use your
 command by invoking it like the following:

 \repere\ blabla blabal

 Best regards: OK

  On 27 Aug 2015, at 10:06, Fabrice Couvreur fabrice1.couvr...@gmail.com
 wrote:
 
  Hi,
  The macro \repere does not create a space between the closing delimiter
 and the following text, why ?
  Thanks,
  Fabrice
 
  \def\repere{$\bigl(O\,;I,J\bigr)$}
 
  \starttext
  \dorecurse{2}{blabla} \repere \dorecurse{2}{blabla}
 
  \dorecurse{2}{blabla} $\bigl(O\,;I,J\bigr)$ \dorecurse{2}{blabla}
 
  \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://tex.aanhet.net
  archive  : http://foundry.supelec.fr/projects/contextrev/
  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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] No space after a closing delimiter

2015-08-27 Thread Fabrice Couvreur
Hi,
The macro \repere does not create a space between the closing delimiter and the
following text, why ?
Thanks,
Fabrice

\def\repere{$\bigl(O\,;I,J\bigr)$}

\starttext
\dorecurse{2}{blabla} \repere \dorecurse{2}{blabla}

\dorecurse{2}{blabla} $\bigl(O\,;I,J\bigr)$ \dorecurse{2}{blabla}

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] About graphictext macro (Metafun)

2015-08-27 Thread Fabrice Couvreur
Hi Hans,

Do you have pstoedit installed ?


root@debian:/home/fab# apt-cache search pstoedit
libpstoedit0c2a - PostScript to editable vector graphics library (runtime
files)
root@debian:/home/fab#

I compile the file test.tex  with  context test.tex
Fabrice

2015-08-27 9:39 GMT+02:00 Hans Hagen pra...@wxs.nl:

 On 8/26/2015 7:12 PM, Fabrice Couvreur wrote:

 Hi,
 I try to understand how this macro by testing a simple example. Why pdf
 file is empty?
 This question follows my question Cover page (Metafun)
 http://www.ntg.nl/pipermail/ntg-context/2015/083078.html
 Thank you.

 \setuppagenumbering[location=]

 \setupcolors
[state=start]

 \setMPtext{text}{MATHEMATIQUES}


 \starttext
 \startuseMPgraphic{test}
 picture pic ;
 pic := image(graphictext \MPstring{text}
 withdrawcolor red
 withpen pencircle scaled 1pt ; ) ;
 addto currentpicture also pic ;
 \stopuseMPgraphic
 \stoptext


 Do you have pstoedit installed?

 Anyway, there is a new mechanism that doesn't depend on additional
 programs:

 % outlinetext   (text) transformations ;
 % outlinetext.d (text) (draw options) transformations ;
 % outlinetext.f (text) (fill options) transformations ;
 % outlinetext.b (text) (draw options) (fill options) transformations ;
 % outlinetext.r (text) (fill options) (draw options) transformations ;

 \starttext

 \startMPdefinitions
 let graphictext = new_graphictext ;
 \stopMPdefinitions

 \startMPpage

 draw outlinetext.b
 (\framed[align=normal]{\input{tufte}})
 (withcolor .5white)
 (withcolor red withpen pencircle scaled 1/10)
 xsized 10cm ;

 \stopMPpage

 \startMPpage

 draw outlinetext.r
 (\framed[align=normal]{\input{tufte}})
 (withcolor red withpen pencircle scaled 1/10)
 (withcolor .5white)
 xsized 10cm ;

 \stopMPpage

 \startMPpage

 draw outlinetext.d
 (\framed[align=normal]{\input{tufte}})
 (withcolor .5white)
 xsized 10cm ;

 \stopMPpage

 \startMPpage

 picture p ; p := outlinetext.p(PX) ;

 for i within p :
 draw i withcolor red withpen pencircle scaled 1/10 ;
 endfor ;

 \stopMPpage

 \stoptext



 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] About graphictext macro (Metafun)

2015-08-26 Thread Fabrice Couvreur
 Hi,
I try to understand how this macro by testing a simple example. Why pdf file
is empty ?
This question follows my question Cover page (Metafun)
http://www.ntg.nl/pipermail/ntg-context/2015/083078.html
Thank you.

\setuppagenumbering[location=]

\setupcolors
  [state=start]

\setMPtext{text}{MATHEMATIQUES}


\starttext
\startuseMPgraphic{test}
picture pic ;
pic := image(graphictext \MPstring{text}
withdrawcolor red
withpen pencircle scaled 1pt ; ) ;
addto currentpicture also pic ;
\stopuseMPgraphic
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-14 Thread Fabrice Couvreur
Hi Rik,
I actually read that Wolfgang had written, but there is some confusion for
me. Indeed, my environment uses a frame and Wolfgang said to be used \
starthanging ... \stophanging rather than \placefigure. But my text contains
a blank line which is to create a new paragraph and so I should use \
placefigure !!!

2015-08-14 3:38 GMT+02:00 Rik Kabel cont...@rik.users.panix.com:

 On 2015-08-13 11:19, Fabrice Couvreur wrote:

 Hi,
 Sorry to revive this discussion (which I initiated), but the text in the
 following code does not wrapped around the figure.
 Why ?
 Fabrice


 \setupcolors
   [state=start]

 \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
 \definecolor[MyColorA][.75(MyColorB,white)]

 \defineframedtext
   [MyText]
   [frame=off,
background=MyFrame,
width=\textwidth,
height=fit,
location=left,
style=italic]

 \defineoverlay
   [MyFrame]
   [\useMPgraphic{MyFrame}]

 \definelabel
   [Définition]
   [headstyle=\bf\smallcaps]

 \startuseMPgraphic{MyFrame}
 path b ;
 picture p ;
 p := textext.rt(\white\Définition) ;
 p := p shifted (2BodyFontSize,OverlayHeight-ypart center
 p+.25ExHeight) ;
 b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
 fill OverlayBox withcolor \MPcolor{MyColorA} ;
 fill b withcolor \MPcolor{MyColorB} ;
 draw p ;
 \stopuseMPgraphic

 \starttext

 \startMyText

 \starthanging[location=right]
 {\startMPcode
   path p ;
   p := fullcircle xscaled 4cm yscaled 2cm ;
   fill p withcolor  cmyk(0,0.62,1,0) ;
   path q ; q := fullcircle scaled 1cm shifted (1cm, ypart center
 p) ;
   fill q withcolor blue ;
   picture r ;
   r := textext(\white E)shifted (-0.75cm,ypart center p) ;
   picture s ;
   s := textext(\white A)shifted (1cm, ypart center p) ;
   draw r ;
   draw s ;
   draw p ;
   draw q ;
  \stopMPcode}
 Soit A une partie d'un ensemble E.

 Si $n_E$ et $n_A$ sont respectivement les nombres d'éléments de E et de A,
 la {\bi proportion} des éléments de A dans E est le quotient
 $p=\frac{n_A}{n_E}$.
 \stophanging

 \stopMyText


 Wolfgang wrote on the list a few days ago (
 http://www.mail-archive.com/ntg-context%40ntg.nl/msg79347.html
 http://www.mail-archive.com/ntg-context%40ntg.nl/msg79347.html):

 The \starthangaround environment reserves space for the image etc. only for
 the first paragraph

 while \placefigure includes more paragraphs if necessary.

 --
 Rik


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

 maillist : ntg-context@ntg.nl /
 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Cover page (Metafun)

2015-08-14 Thread Fabrice Couvreur
Hi Hans,
To progress in the use of Metafun, I try to do the same cover page as
your document
'Metafun . Without looking at the code (but using the definitions of your
colors), I managed to get the mosaic.
I would write the word MATHÉMATIQUES as you did with the word CONTEXTEN.
Thank you,
Fabrice


\setuppagenumbering[location=]

\setupcolors
  [state=start]

\definecolor[maincolor][g=.6]
\definecolor[pagecolor][s=.6]
\definecolor[darkcolor][s=.2]
\definecolor[textcolor][r=.6]


\startMPinclusions
  color maincolor ; maincolor := \MPcolor{maincolor} ;
  color pagecolor ; pagecolor := \MPcolor{pagecolor} ;
  color darkcolor ; darkcolor := \MPcolor{darkcolor} ;
  color textcolor ; textcolor := \MPcolor{textcolor} ;
\stopMPinclusions

\startuseMPgraphic{CoverPage}
  path p ; p := OverlayBox xyscaled (1/2,1/7) ;
  fill OverlayBox withcolor pagecolor ;
  path q ; q := p enlarged -12pt randomized 12pt ;
  pair a ;
  for j=0 upto 6 :
 for i=0 upto 1 :
a := (i*xpart urcorner p,j*ypart urcorner p) ;
q := p enlarged -12pt randomized 12pt shifted a ;
circular_shade
  (q, ceiling(uniformdeviate 4), maincolor, .5maincolor) ;
   draw q withpen pencircle scaled 8pt withcolor darkcolor ;
  endfor ;
endfor ;
\stopuseMPgraphic

\defineoverlay[CoverPage][\useMPgraphic{CoverPage}]

\setupbackgrounds
  [rightpage]
  [background=CoverPage]

\starttext

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-13 Thread Fabrice Couvreur
Hi,
Sorry to revive this discussion (which I initiated), but the text in the
following code does not wrapped around the figure.
Why ?
Fabrice


\setupcolors
  [state=start]

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   width=\textwidth,
   height=fit,
   location=left,
   style=italic]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt(\white\Définition) ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight)
;
b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic

\starttext

\startMyText

\starthanging[location=right]
{\startMPcode
  path p ;
  p := fullcircle xscaled 4cm yscaled 2cm ;
  fill p withcolor  cmyk(0,0.62,1,0) ;
  path q ; q := fullcircle scaled 1cm shifted (1cm, ypart center p)
;
  fill q withcolor blue ;
  picture r ;
  r := textext(\white E)shifted (-0.75cm,ypart center p) ;
  picture s ;
  s := textext(\white A)shifted (1cm, ypart center p) ;
  draw r ;
  draw s ;
  draw p ;
  draw q ;
 \stopMPcode}
Soit A une partie d'un ensemble E.

Si $n_E$ et $n_A$ sont respectivement les nombres d'éléments de E et de A,
la {\bi proportion} des éléments de A dans E est le quotient
$p=\frac{n_A}{n_E}$.
\stophanging

\stopMyText


2015-08-10 1:11 GMT+02:00 Jeong Dal hak...@me.com:

 Dear Otared and Wolfgang,

 It works fine after replacing the text itself.
 Thank you for the info.

 Best regards,

 Dalyoung


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

 maillist : ntg-context@ntg.nl /
 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Title of the section that begins

2015-08-13 Thread Fabrice Couvreur
\setupfootertexts[text][{\getmarking[section]}][{\getmarking[chapter]}]



2015-08-12 23:10 GMT+02:00 Fabrice Couvreur fabrice1.couvr...@gmail.com:

 Hi Wolfgang,
 There is no question, I'm confused !
 I will try to be clearer. At the bottom, I wish the title of the current
 chapter and title of the current section much like in the document Metafun
 .
 Fabrice

 2015-08-12 18:15 GMT+02:00 Wolfgang Schuster schuster.wolfg...@gmail.com
 :

 Fabrice Couvreur fabrice1.couvr...@gmail.com
 12. August 2015 17:09
 Hi,
 The first section begins, so the title appears footer on each page as the
 second section does not start. Then the second section starts and was the
 title of the second section as the third section does not start and so
 on.

 What is your question?

 Should the footer on the second page be empty or do you expect ConText to
 print the title of the second chapter on the footer on the fourth page.

 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-13 Thread Fabrice Couvreur
Hi,
Well, I think I have solved the problem : it is because of the blank line.
Why ?
Fabrice

2015-08-13 17:19 GMT+02:00 Fabrice Couvreur fabrice1.couvr...@gmail.com:

 Hi,
 Sorry to revive this discussion (which I initiated), but the text in the
 following code does not wrapped around the figure.
 Why ?
 Fabrice


 \setupcolors
   [state=start]

 \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
 \definecolor[MyColorA][.75(MyColorB,white)]

 \defineframedtext
   [MyText]
   [frame=off,
background=MyFrame,
width=\textwidth,
height=fit,
location=left,
style=italic]

 \defineoverlay
   [MyFrame]
   [\useMPgraphic{MyFrame}]

 \definelabel
   [Définition]
   [headstyle=\bf\smallcaps]

 \startuseMPgraphic{MyFrame}
 path b ;
 picture p ;
 p := textext.rt(\white\Définition) ;
 p := p shifted (2BodyFontSize,OverlayHeight-ypart center
 p+.25ExHeight) ;
 b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
 fill OverlayBox withcolor \MPcolor{MyColorA} ;
 fill b withcolor \MPcolor{MyColorB} ;
 draw p ;
 \stopuseMPgraphic

 \starttext

 \startMyText

 \starthanging[location=right]
 {\startMPcode
   path p ;
   p := fullcircle xscaled 4cm yscaled 2cm ;
   fill p withcolor  cmyk(0,0.62,1,0) ;
   path q ; q := fullcircle scaled 1cm shifted (1cm, ypart center
 p) ;
   fill q withcolor blue ;
   picture r ;
   r := textext(\white E)shifted (-0.75cm,ypart center p) ;
   picture s ;
   s := textext(\white A)shifted (1cm, ypart center p) ;
   draw r ;
   draw s ;
   draw p ;
   draw q ;
  \stopMPcode}
 Soit A une partie d'un ensemble E.

 Si $n_E$ et $n_A$ sont respectivement les nombres d'éléments de E et de A,
 la {\bi proportion} des éléments de A dans E est le quotient
 $p=\frac{n_A}{n_E}$.
 \stophanging

 \stopMyText


 2015-08-10 1:11 GMT+02:00 Jeong Dal hak...@me.com:

 Dear Otared and Wolfgang,

 It works fine after replacing the text itself.
 Thank you for the info.

 Best regards,

 Dalyoung


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

 maillist : ntg-context@ntg.nl /
 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Title of the section that begins

2015-08-12 Thread Fabrice Couvreur
Hi,
The first section begins, so the title appears footer on each page as the
second section does not start. Then the second section starts and was the
title of the second section as the third section does not start and so on.
Thanks,
Fabrice

\setuppagenumbering
  [alternative=doublesided]

\setupfootertexts[margin][][{\getmarking[chapter]}]

\starttext

\chapter{First}

\section{one}

\section{two}

\chapter{Second}

\section{one}

\section{two}

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Title of the section that begins

2015-08-12 Thread Fabrice Couvreur
Hi Wolfgang,
There is no question, I'm confused !
I will try to be clearer. At the bottom, I wish the title of the current
chapter and title of the current section much like in the document Metafun.
Fabrice

2015-08-12 18:15 GMT+02:00 Wolfgang Schuster schuster.wolfg...@gmail.com:

 Fabrice Couvreur fabrice1.couvr...@gmail.com
 12. August 2015 17:09
 Hi,
 The first section begins, so the title appears footer on each page as the
 second section does not start. Then the second section starts and was the
 title of the second section as the third section does not start and so on.

 What is your question?

 Should the footer on the second page be empty or do you expect ConText to
 print the title of the second chapter on the footer on the fourth page.

 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Output compilation

2015-08-12 Thread Fabrice Couvreur
Hi,
My product lesson contains the component chapter-1 which itself contains
the components activities and synthesis.
Is it possible to compile lesson.tex and have the output that
activities.pdf file
?
Thanks,
Fabrice



\project manual

\startproduct lesson

\startfrontmatter
  \component   titlepage
  \component   contents
\stopfrontmatter

\startbodymatter
  \component  chapter-1
\stopbodymatter

\stopproduct

##

\startcomponent chapter-1

  \component activities
  \component synthesis

\stopcomponent
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Output compilation

2015-08-12 Thread Fabrice Couvreur
Hi Hans,
I think my initial request was unclear.
In fact, I want to get output only content activities.tex file.
Fabrice

2015-08-12 13:18 GMT+02:00 Hans Hagen pra...@wxs.nl:

 On 8/12/2015 12:42 PM, Fabrice Couvreur wrote:

 Hi,
 My product lesson contains the componentchapter-1 which itself contains
 the components activities and synthesis.
 Is it possible to compile lesson.tex and have the output that
 activities.pdf file ?
 Thanks,


 --result=activities


 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Output compilation

2015-08-12 Thread Fabrice Couvreur
Hi Wolfgang,
In fact, I had already tried what you propose without success. But I
just realized
that the contents of my file is :

\startcomponent activities

...

\stopcomponent

and I forgot *\project manual * that contains :

\environment my-fonts
\environment my-layout
\environment my-modules
\environment my-styles
\environment my-commands

\startproject manual

  \product lesson

\stopproject


Thank you.

2015-08-12 14:43 GMT+02:00 Wolfgang Schuster schuster.wolfg...@gmail.com:

 Fabrice Couvreur fabrice1.couvr...@gmail.com
 12. August 2015 14:22
 Hi Hans,
 I think my initial request was unclear.
 In fact, I want to get output only content activities.tex file.

 context activites.tex

 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Command that does not give the expected result (Metafun)

2015-08-11 Thread Fabrice Couvreur
Hi Wolfgang,
I will follow your advice but I will try to understand, when I have the time
, the difference between
\unexpanded\def\ChapterCommand#1#2% et \def\ChapterCommand#1#2%.
Fabrice

2015-08-10 22:38 GMT+02:00 Wolfgang Schuster schuster.wolfg...@gmail.com:

 Fabrice Couvreur fabrice1.couvr...@gmail.com
 10. August 2015 09:13
 Dear Hans,
 I tested without understanding what \unexpanded, and of course it works !

 You can use ConTeXt’s \define command where you don’t have to think about
 \unexpanded etc., e.g.

 \define[2]\ChapterCommand
   {\setbox\scratchbox\hbox to \leftmarginwidth{#1\hss}%
\hskip-\dimexpr\leftmarginwidth+\leftmargindistance\relax
\framed
  [background=titled,frame=off,offset=0pt]
  {\box\scratchbox
   \hskip\leftmargindistance
   #2}}

 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Strange behavior (TikZ)

2015-08-11 Thread Fabrice Couvreur
Hi,
Strange behavior: why is the colored text ?
Thanks,
Fabrice

\usemodule[tikz]

\startuniqueMPgraphic{titled}
path p ;
p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
pickup pencircle scaled 1mm ;
drawoptions(withcolor .625yellow) ;
draw llcorner p--lrcorner p ;
setbounds currentpicture to p ;
\stopuniqueMPgraphic

\defineoverlay[titled][\uniqueMPgraphic{titled}]

\define[2]\ChapterCommand
  {\setbox\scratchbox\hbox to \leftmarginwidth{#1\hss}%
   \hskip-\dimexpr\leftmarginwidth+\leftmargindistance\relax
   \framed
 [background=titled,frame=off,offset=0pt]
 {\box\scratchbox
  \hskip\leftmargindistance
  #2}}

\setuphead
  [chapter]
  [command=\ChapterCommand,
   textstyle=\ss,
   color=darkred,
   conversion=Characters]

\setuphead
  [section]
  [command=\ChapterCommand,
   textstyle=\ss,
   color=darkred,
   sectionsegments=section:section]

\starttext

\startchapter
  [title={Activités d'approche}]

\startsection
  [title={Sans carreaux}]

\placefigure[right,none]{}
{
\hbox{
\starttikzpicture[=stealth,scale=0.8]
\draw [-,color=blue,ultra thick] (0,0)--(5,2);
\draw [-,color=green,ultra thick] (6,1.5)--(5,0);
\draw [-,color=red,ultra thick] (4,-0.8)--(2,-0.1);
\draw [color=blue](2.5,1) node[above] {$\vec{u}$};
\draw [color=green](5.5,0.75) node[right] {$\vec{v}$};
\draw [,color=red](3,-0.45)   node[above] {$\vec{w}$};
\node (A) at (0.5,-0.5) {A};
\node [above right] at (A) {$\times$};
\stoptikzpicture}}
\startitemize[n][stopper={)},style=bold]
On a tracé trois vecteurs et placé un point A sur la figure ci-contre.
\startitemize[a][stopper={)},style=bold]
\item Construire le point C tel que $\vec{\rm{AC}}=\vec{u} + \vec{v}$.
\item Construire le point B tel que  $\vec{\rm{AB}}=\vec{u} + \vec{v} +
\vec{w} $.
\stopitemize
\stopitemize

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] About fonts

2015-08-10 Thread Fabrice Couvreur
Hi,
I want to have the title of the chapters, sections and sub-sections in sans
serif Helvetica, body text and mathematics in Palatino.
Is this the right approach ?
Thanks,
Fabrice

\definetypeface [me] [rm]  [serif][palatino]   [default]
\definetypeface [me] [ss]   [sans]  [helvetica]  [default]
\definetypeface [me] [mm] [math]  [palatino]   [default]

\setupbodyfont[me,11pt]

\setuphead
  [chapter,section,subsection]
  [command=\ChapterCommand,
   textstyle=\ss,
   color=darkred]
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Command that does not give the expected result (Metafun)

2015-08-10 Thread Fabrice Couvreur
Dear Hans,
I tested without understanding what \unexpanded, and of course it works !
Thank you,
Fabrice

2015-08-09 15:40 GMT+02:00 Hans Hagen pra...@wxs.nl:

 On 8/9/2015 1:27 PM, Fabrice Couvreur wrote:

 Hi Hans,
 In the document Metafun, you use commands that I like, and I try to
 understand the definition and operation, which is not always easy with
 TeX commands.
 Also, in the following code, this does not give the expected result.
 Thank you.
 Fabrice

 \showframe

 \setupcolors
[state=start]

 \setuppagenumbering[location=,alternative]

 \startuniqueMPgraphic{titled}
 path p ;
 p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
 pickup pencircle scaled 1mm ;
 drawoptions(withcolor .625yellow) ;
 draw llcorner p--lrcorner p ;
 setbounds currentpicture to p ;
 \stopuniqueMPgraphic

 \defineoverlay[titled][\uniqueMPgraphic{titled}]

 \def\ChapterCommand#1#2%
{\setbox0=\hbox to \leftmarginwidth{#1\hss}%
 \hskip-\leftmarginwidth
 \hskip-\leftmargindistance
 \framed
   [background=titled,frame=off,offset=0pt]
   {\box0
\hskip\leftmargindistance
#2}}

 \setuphead
[chapter,section,subsection]
[command=\ChapterCommand,
 color=darkred]

 \starttext
 \chapter{First}
 \section{First}
 \subsection{First}
 \stoptext


 \unexpanded\def\ChapterCommand#1#2%

 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Command that does not give the expected result (Metafun)

2015-08-09 Thread Fabrice Couvreur
Hi Hans,
In the document Metafun, you use commands that I like, and I try to
understand the definition and operation, which is not always easy with TeX
commands.
Also, in the following code, this does not give the expected result.
Thank you.
Fabrice

\showframe

\setupcolors
  [state=start]

\setuppagenumbering[location=,alternative]

\startuniqueMPgraphic{titled}
path p ;
p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
pickup pencircle scaled 1mm ;
drawoptions(withcolor .625yellow) ;
draw llcorner p--lrcorner p ;
setbounds currentpicture to p ;
\stopuniqueMPgraphic

\defineoverlay[titled][\uniqueMPgraphic{titled}]

\def\ChapterCommand#1#2%
  {\setbox0=\hbox to \leftmarginwidth{#1\hss}%
   \hskip-\leftmarginwidth
   \hskip-\leftmargindistance
   \framed
 [background=titled,frame=off,offset=0pt]
 {\box0
  \hskip\leftmargindistance
  #2}}

\setuphead
  [chapter,section,subsection]
  [command=\ChapterCommand,
   color=darkred]

\starttext
\chapter{First}
\section{First}
\subsection{First}
\stoptext


ntg29.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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-09 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you for all these explanations that make me progress in the use of
Context.
Fabrice

2015-08-08 10:40 GMT+02:00 Wolfgang Schuster schuster.wolfg...@gmail.com:

 Fabrice Couvreur fabrice1.couvr...@gmail.com
 8. August 2015 00:49
 Hi,
 Why the text does not move in the first framedtext like the second
 framedtext ?

 You have to use \starthanging instead of \placefgure when you’re in a
 frame.

 \starttext

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

 \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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Text around a figure in a framedtext

2015-08-08 Thread Fabrice Couvreur
Hi Otared,
A small mistake on your part : do not write \input knuth.tex but \input
knuth.
Then I want the text in the first framedtext wrapped around the figure as in
the second.
Fabrice

2015-08-08 6:18 GMT+02:00 Otared Kavian ota...@gmail.com:

 Hi,

 You should use the same width if you want to obtain the same result (by
 the way, you have to say also \stopframedtext in your source file):

 \startframedtext[width=\textwidth]{
 \placefigure[right,none]{}{%
  \startMPcode
   draw unitsquare scaled 2cm ;
   \stopMPcode}
 \input knuth.tex }
 \stopframedtext

 Best regards: OK

  On 08 Aug 2015, at 00:49, Fabrice Couvreur fabrice1.couvr...@gmail.com
 wrote:
 
  Hi,
  Why the text does not move in the first framedtext like the second
 framedtext ?
  Thank you.
  Fabrice
 
  \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
  \definecolor[MyColorA][.75(MyColorB,white)]
 
  \defineframedtext
[MyText]
[frame=off,
 background=MyFrame,
 width=\textwidth,
 location=right]
 
  \defineoverlay
[MyFrame]
[\useMPgraphic{MyFrame}]
 
  \definelabel
[Définition]
[headstyle=\bf\smallcaps]
 
  \startuseMPgraphic{MyFrame}
  path b ;
  picture p ;
  p := textext.rt(\white\Définition) ;
  p := p shifted (2BodyFontSize,OverlayHeight-ypart center
 p+.25ExHeight) ;
  b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
  fill OverlayBox withcolor \MPcolor{MyColorA} ;
  fill b withcolor \MPcolor{MyColorB} ;
  draw p ;
  \stopuseMPgraphic
 
  \starttext
  \startMyText
  \placefigure[right,none]{}{%
   \startMPcode
draw unitsquare scaled 2cm ;
\stopMPcode}
  \input knuth
  \stopMyText
 
  \startframedtext{
  \placefigure[right,none]{}{%
   \startMPcode
draw unitsquare scaled 2cm ;
\stopMPcode}
  \input knuth}
 
  \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://tex.aanhet.net
  archive  : http://foundry.supelec.fr/projects/contextrev/
  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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Text around a figure in a framedtext

2015-08-07 Thread Fabrice Couvreur
Hi,
Why the text does not move in the first framedtext like the second
framedtext ?
Thank you.
Fabrice

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   width=\textwidth,
   location=right]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt(\white\Définition) ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight)
;
b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic

\starttext
\startMyText
\placefigure[right,none]{}{%
 \startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
\input knuth
\stopMyText

\startframedtext{
\placefigure[right,none]{}{%
 \startMPcode
  draw unitsquare scaled 2cm ;
  \stopMPcode}
\input knuth}

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Some questions about an environment (Metafun)

2015-08-07 Thread Fabrice Couvreur
Hi Hans,
Thank you for responding to my request, it's really nice. By cons I do not
understand what you mean 
some day textext might handle it okay
Fabrice

2015-08-07 14:26 GMT+02:00 Hans Hagen pra...@wxs.nl:

 On 8/6/2015 11:38 PM, Fabrice Couvreur wrote:

 Hi,
 The following code (Metafun documentation, thanks again Hans !) is fully
 understood and works very well. Sorry if I insist, but can we create a
 counter to avoid writing \FrameTitle{Définition 1},
 \FrameTitle{Définition 2}... ?
 Thus, the only invocation \startMyText ... \stopMyText, \startMyText ...
 \stopMyText... this return Définition 1, Définition 2 ...

 Thank you,
 Fabrice


 \setupbodyfont [palatino,11pt]

 \setupcolors[state=start,cmyk=yes]

 \definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
 \definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]

 \defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

 \defineframedtext
 [MyText]
 [frame=off,
  background=MyFrame,
  width=\textwidth,
  location=right]

 \defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

 \def\StartFrame{\startMyText}
 \def\StopFrame{\startMyText}

 \def\FrameTitle#1{\setMPtext{MyFrame}{\hbox spread
 1em{\hss\strut{\bf\feature[+][f:smallcaps]}#1\hss}}}

 \setMPtext{MyFrame}{}

 \startuseMPgraphic{MyFrame}
 path a ;
 path b ;
 picture p ;
 o := BodyFontSize ;
 p :=textext.rt(\MPstring{MyFrame}) ;
 p := p shifted (2o,OverlayHeight-ypart center p) ;
 a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
 fill a withcolor \MPcolor{MyColor} ;
 b := boundingbox p ;
 fill b withcolor \MPcolor{myColor} ;
 draw p withcolor white ;
 \stopuseMPgraphic
 \starttext
 \FrameTitle{Définition 1}
 \startMyText
 \input knuth
 \stopMyText
 \FrameTitle{Définition 2}
 \startMyText
 \input knuth
 \stopMyText
 \stoptext


 \setupbodyfont [palatino,11pt]

 \definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
 \definecolor[MyColorA][.75(MyColorB,white)]  %c=0.00, m=0.10, y=0.20,
 k=0.00]

 \defineframedtext
   [MyText]
   [frame=off,
background=MyFrame,
width=\textwidth,
location=right]

 \defineoverlay
   [MyFrame]
   [\useMPgraphic{MyFrame}]

 \definelabel
   [Définition]
   [headstyle=\bf\smallcaps]

 \startuseMPgraphic{MyFrame}
 path b ;
 picture p ;
 p := textext.rt(\white\Définition) ; % some day textext might handle
 it okay
 p := p shifted (2BodyFontSize,OverlayHeight-ypart center
 p+.25ExHeight) ;
 b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
 fill OverlayBox withcolor \MPcolor{MyColorA} ;
 fill b withcolor \MPcolor{MyColorB} ;
 draw p ;
 \stopuseMPgraphic

 \starttext

 \startMyText
 \input knuth
 \stopMyText

 \startMyText
 \input knuth
 \stopMyText

 \stoptext

 2015-08-04 21:30 GMT+02:00 Fabrice Couvreur fabrice1.couvr...@gmail.com
 mailto:fabrice1.couvr...@gmail.com:

 Hi Aditya,
 Thank you, I have already thought of this solution, but I do not
 know to use with the environment that I created.
 Fabrice

 2015-08-04 18:02 GMT+02:00 Aditya Mahajan adit...@umich.edu
 mailto:adit...@umich.edu:

 On Tue, 4 Aug 2015, Fabrice Couvreur wrote:

 How to have Definition 1, Definition 2, Definition 3 ... ?


 \defineenumeration[definition][text=Definition]

 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
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net

 ___



 --

 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | 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

Re: [NTG-context] Some questions about an environment (Metafun)

2015-08-06 Thread Fabrice Couvreur
Hi,
The following code (Metafun documentation, thanks again Hans !) is fully
understood and works very well. Sorry if I insist, but can we create a
counter to avoid writing \FrameTitle{Définition 1},
\FrameTitle{Définition 2}... ?
Thus, the only invocation \startMyText ... \stopMyText,  \startMyText ... \
stopMyText ... this return Définition 1, Définition 2 ...
Thank you,
Fabrice


\setupbodyfont [palatino,11pt]

\setupcolors[state=start,cmyk=yes]

\definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
\definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]

\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

\defineframedtext
   [MyText]
   [frame=off,
background=MyFrame,
width=\textwidth,
location=right]

\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

\def\StartFrame{\startMyText}
\def\StopFrame{\startMyText}

\def\FrameTitle#1{\setMPtext{MyFrame}{\hbox spread
1em{\hss\strut{\bf\feature[+][f:smallcaps]}#1\hss}}}

\setMPtext{MyFrame}{}

\startuseMPgraphic{MyFrame}
path a ;
path b ;
picture p ;
o := BodyFontSize ;
p :=textext.rt(\MPstring{MyFrame}) ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
fill a withcolor \MPcolor{MyColor} ;
b := boundingbox p ;
fill b withcolor \MPcolor{myColor} ;
draw p withcolor white ;
\stopuseMPgraphic
\starttext
\FrameTitle{Définition 1}
\startMyText
\input knuth
\stopMyText
\FrameTitle{Définition 2}
\startMyText
\input knuth
\stopMyText
\stoptext


2015-08-04 21:30 GMT+02:00 Fabrice Couvreur fabrice1.couvr...@gmail.com:

 Hi Aditya,
 Thank you, I have already thought of this solution, but I do not know to
 use with the environment that I created.
 Fabrice

 2015-08-04 18:02 GMT+02:00 Aditya Mahajan adit...@umich.edu:

 On Tue, 4 Aug 2015, Fabrice Couvreur wrote:

 How to have Definition 1, Definition 2, Definition 3 ... ?


 \defineenumeration[definition][text=Definition]

 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Some questions about an environment (Metafun)

2015-08-04 Thread Fabrice Couvreur
 Hi,
How to have Definition 1, Definition 2, Definition 3 ... ?

Is it possible to translate the image p until the left edge of the text area
?

Thank you,
Fabrice

\showframe

\setupcolors[state=start,cmyk=yes]

\definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
\definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]

\setupbodyfont[11pt]
\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

\defineframedtext
   [MyText]
   [frame=off,
background=MyFrame,
width=0.9\textwidth,
location=right]

\defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

\def\StartFrame{\startMyText}
\def\StopFrame{\startMyText}

\setMPtext{MyFrame}{\hbox spread 1em {\hss\strut
{\bf\feature[+][f:smallcaps]  Définition 1 }\hss}}}

\startuseMPgraphic{MyFrame}

path a ;
path b ;
picture p ;
o := BodyFontSize ;
p :=textext.rt(\MPstring{MyFrame}) ;
p := p shifted (0,OverlayHeight-ypart center p) ;
a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ;
fill a withcolor \MPcolor{MyColor} ;
b := boundingbox p ;
fill b withcolor \MPcolor{myColor} ;
draw p withcolor white ;

\stopuseMPgraphic

\starttext
\startlinecorrection[blank]
\startMyText
\input knuth
\stopMyText
\stoplinecorrection

\startlinecorrection[blank]
\startMyText
\input knuth
\stopMyText
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Some questions about an environment (Metafun)

2015-08-04 Thread Fabrice Couvreur
Hi Hans,
Thank you for your suggestion, but it's not what I want, but I probably
misstated my request. For me, the image p contains the text Définition 1, and
this is what I want orange rectangle translate to the left edge of the text
area.
Am I more clearly ?
Fabrice

2015-08-04 20:08 GMT+02:00 Hans Hagen pra...@wxs.nl:

 On 8/4/2015 5:04 PM, Fabrice Couvreur wrote:

 Hi,
 How to have Definition 1, Definition 2, Definition 3 ...?

 Is it possible to translate the image p until the left edge of the text
 area ?



 \startuseMPgraphic{MyFrame}
 picture p ;
 p := textext.rt(\MPstring{MyFrame}) ;
 p := p shifted (0,OverlayHeight-ypart center p) ;
 fill OverlayBox leftenlarged .1TextWidth withcolor \MPcolor{MyColor} ;
 fill boundingbox p withcolor \MPcolor{myColor} ;
 draw p withcolor white ;
 setbounds currentpicture to OverlayBox ;
 \stopuseMPgraphic



 Thank you,
 Fabrice

 \showframe

 \setupcolors[state=start,cmyk=yes]

 \definecolor[MyColor][c=0.00, m=0.10, y=0.20, k=0.00]
 \definecolor[myColor][c=0.00, m=0.62, y=1.00, k=0.00]

 \setupbodyfont[11pt]
 \defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

 \defineframedtext
 [MyText]
 [frame=off,
  background=MyFrame,
  width=0.9\textwidth,
  location=right]

 \defineoverlay[MyFrame][\useMPgraphic{MyFrame}]

 \def\StartFrame{\startMyText}
 \def\StopFrame{\startMyText}

 \setMPtext{MyFrame}{\hbox spread 1em {\hss\strut
 {\bf\feature[+][f:smallcaps]  Définition 1 }\hss}}}

 \startuseMPgraphic{MyFrame}

 path a ;
 path b ;
 picture p ;
 o := BodyFontSize ;
 p :=textext.rt(\MPstring{MyFrame}) ;
 p := p shifted (0,OverlayHeight-ypart center p) ;
 a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ;
 fill a withcolor \MPcolor{MyColor} ;
 b := boundingbox p ;
 fill b withcolor \MPcolor{myColor} ;
 draw p withcolor white ;

 \stopuseMPgraphic

 \starttext
 \startlinecorrection[blank]
 \startMyText
 \input knuth
 \stopMyText
 \stoplinecorrection

 \startlinecorrection[blank]
 \startMyText
 \input knuth
 \stopMyText
 \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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net

 ___



 --

 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Questions around my page design

2015-08-03 Thread Fabrice Couvreur
Hi,
I wish the numérotion pages is reversed at each new page: right left right
...
I wish the bottom of the title page of each section of the current page.
Thanks for your help,
Fabrice


\setuppagenumbering
  [location=]

\setupheadertexts
  [margin]
  [][\hfill\pagenumber\hfill]

\setupheadertexts[{\getmarking[chapter]}]

\setupfootertexts[{\getmarking[section]}]


\starttext

\startchapter
  [title=First]

\startsection
  [title=One]
\dorecurse{5}{\input ward}
\stopsection

\stopchapter

\startchapter
  [title=Second]

\startsection
  [title=One]
\dorecurse{5}{\input ward}
\stopsection

\startsection
  [title=Two]
\dorecurse{5}{\input ward}
\stopsection

\stopchapter


\startchapter
  [title=Third]

\startsection
  [title=One]
\dorecurse{5}{\input ward}
\stopsection

\startsection
  [title=Two]
\dorecurse{5}{\input ward}
\stopsection

\startsection
  [title=Three]
\dorecurse{5}{\input ward}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Floating dimensions that adapts automaticall

2015-08-03 Thread Fabrice Couvreur
 Hi,
In the code below, we can see that the table overflows.
Of course, one can play on the table dimensions to adjust its position.
However it is possible to define a floating whose dimensions automatically
adapt to the available space ?
Thank you,
Fabrice

\definefloat
   [MyFloat]
   [figure]

\setupfloat
   [MyFloat]
   [default={right,none}]

\startsetups[table:initialize]
  \setupTABLE[start][align={middle,lohi},width=2cm,offset=1ex]
  \setupTABLE[column][first][width=4cm]
  \setupTABLE[row][first][background=color,backgroundcolor=lightgray]
\stopsetups

\showframe

\starttext
\placeMyFloat{}{\externalfigure[louvre.jpg][width=5cm]}
Le tableau ci-dessous indique le nombre d'entrées (en milliers) au musée du
Louvre :
\blank[medium]
\startmidaligned
\placeMyFloat{}{
\bTABLE[setups=table:initialize]
\bTR
\bTH  \eTH
\bTD  \eTD
\bTD  \eTD
\bTD  \eTD
\bTD  \eTD
\eTR
\bTR
\bTH  \eTH
\bTD  \eTD
\bTD  \eTD
\bTD  \eTD
\bTD  \eTD
\eTR
\eTABLE
\stopmidaligned}
\blank[medium]
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Structure : problem with an environment

2015-07-30 Thread Fabrice Couvreur
Hi,
In my project, there is an env-03.tex file that contains this :


\startenvironment env-03

\defineenumeration
  [def]
  [text={Définition},
   headstyle={\bf\feature[+][f:smallcaps]},
   width=fit,
   alternative=left,
   stopper={.}]

\stopenvironment



If I compile, I get this :

open source  4  119  env-03.tex

tex errortex error on line 10 in file env-03.tex: ! You can't use
a prefix with `\begingroup'

to be read again
\begingroup
\strc_enumerations_command #1-\begingroup
   \strc_constructions_initialize
{#...
to be read again
\201
\dostepwiserecurse ...on \recursedepth \endcsname
  ##1##2{#4}\global
\expanda...
inserted text ...numerationsub {\v!sub \currentenumerationsub }}
  \else \let
\currentenumera...
\define_enumeration ...he \everydefineenumeration
  \let \currentenumeration
\...
...
l.10


 1 \startenvironment env-03
 2
 3 \defineenumeration
 4   [def]
 5   [text={Définition},
 6headstyle={\bf\feature[+][f:smallcaps]},
 7width=fit,
 8alternative=left,
 9stopper={.}]
10 
11 \stopenvironment
12

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Numbered page template

2015-07-30 Thread Fabrice Couvreur
In this manual, I like the numbered pages indicating each chapter. I
suppose they are made with Metafun. Is it possible to have an explanation ?
Thank You,
Fabrice

http://www.pragma-ade.nl/general/manuals/cont-enp.pdf
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Small problems with my columns

2015-07-30 Thread Fabrice Couvreur
Hi,
In the code below, how to make the line hyphenation is in the first column and
not in the second.
Thank You.
Fabrice

\setupcolors[state=start]
\definemixedcolumns
  [mycolumn]
  [
n=2,
separator=rule,
rulecolor=gray,
rulethickness=1pt,
balance=yes,
  ]
\setuppapersize[A4][A4]

\setuplayout[
backspace=15mm,
width=middle,
topspace=15mm,
height=middle,
header=0pt,
footer=0pt,
]
\loadtypescriptfile[mathdesign]

\definetypeface [mainface] [rm] [serif] [palatino] [default]
\definetypeface [mainface] [tt] [mono]  [modern] [default] [rscale=0.9]
\definetypeface [mainface] [mm] [math]  [xits] [default]

\setupbodyfont[mainface,11pt]

\starttext
\startmycolumn
\startitemize[n][stopper={)},style=bold]
\item
\startitemize[a][stopper={)},style=bold]
\item
\item
\item \'Emettre une conjecture sur la nature de la transformation
correspondant à l'enchaînement de ces deux translations.
\startframedtext[frame=on,background=color,backgroundcolor=lightgray,width=local]
On notera $\vec{u} + \vec{v}$ les caractéristiques de cette nouvelle
transformation.
\stopframedtext
\stopitemize
\column
\item
\startitemize[a][stopper={)},style=bold]
\item
\item
\item
\stopitemize
\item
\startitemize[a][stopper={)},style=bold]
\item
\item
\item
\stopitemize
\stopitemize
\stopmycolumn
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Environment \starttikzpicture \stoptikzpicture like float

2015-05-24 Thread Fabrice Couvreur
Hi,
Why the command \placerecipe{}{} does not with an environment \
starttikzpicture
\stoptikzpicture ?
Fabrice

\setupexternalfigures[location={local,global,default}]

\setuppagenumbering[location=]

\usemodule[tikz]
\usemodule[pgfplots]
\pgfplotsset{compat=1.8}

\definefloat
   [recipe]
   [figure]

\setupfloat
   [recipe]
   [default={right,none}]

\starttext
\startitemize[n][stopper={.},style=bold]
\placerecipe
   {}
{\externalfigure[cow.pdf][width=4cm]}
\item \input knuth
\placerecipe
   {}
{
\starttikzpicture[level 1/.style={level distance=35mm,sibling
distance=40mm},level 2/.style={level distance=25mm,sibling
distance=15mm},cadre/.style={rectangle,draw}]
\node{}[grow=right]
child{node{$\overline{R}$}
child{node{$\overline{M}$}
edge from parent node [below=0.2cm,midway] {\unknown}}
child{node{$M$}
edge from parent node [above=0.2cm,midway] {\unknown}}
edge from parent node [below=0.2cm,midway] {\unknown}
}
child{node{$R$}
child{node{$\overline{M}$}
edge from parent node [below=0.2cm,midway] {\unknown}}
child{node{$M$}
edge from parent node [above=0.2cm,midway] {\unknown}}
edge from parent node [above=0.2cm,scale=0.75] {\unknown}
};
\stoptikzpicture
}
\item \input knuth
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Latest beta : command that no longer works

2015-04-03 Thread Fabrice Couvreur
With the latest version of Context Standalone, this command \filler[dots] no
longer works.
Best regards,
Fabrice

\definefiller[dots][left=\dontleavehmode, right=\hskip\ZeroPoint\par]
\starttext
\dorecurse{4}{\filler[dots]}
\stoptext

fab@debian:~$ source context/tex/setuptex
Setting /home/fab/context/tex as ConTeXt root.
fab@debian:~$ context ntg19.tex

resolvers   | trees | analyzing 'home:texmf'
mtx-context | run 1: luatex
--fmt=/home/fab/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en
--jobname=ntg19
--lua=/home/fab/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui
--no-parse-first-line --c:currentrun=1 --c:fulljobname=./ntg19.tex
--c:input=./ntg19.tex --c:kindofrun=1 --c:maxnofruns=8 cont-yes.mkiv
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/dev) (rev 5195)
 \write18 enabled.

resolverstrees  analyzing 'home:texmf'
open source  1  1 
/home/fab/context/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2015.04.01 12:00 MKIV beta  fmt: 2015.4.3  int:
english/english

system   'cont-new.mkiv' loaded
open source  2  2 
/home/fab/context/tex/texmf-context/tex/context/base/cont-new.mkiv
close source 2  2 
/home/fab/context/tex/texmf-context/tex/context/base/cont-new.mkiv
system   files  jobname 'ntg19', input './ntg19', result 'ntg19'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
open source  2  3  /home/fab/ntg19.tex
fontspreloading latin modern fonts (second stage)
fonts'fallback modern-designsize rm 12pt' is loaded

tex errorerror on line 3 in file /home/fab/ntg19.tex: ! Undefined
control sequence


\166dots:right -\hskip \ZeroPoint
\par
\spac_fillers_indeed ...\fillerparameter \c!right
  \relax \scratchdimen
\fill...
\syst_helpers_recurse_indeed_yes ...curse_content

\syst_helpers_recurse_indeed
to be read again
{
inserted text
2
\syst_helpers_recurse_indeed ...the \innerrecurse
  }{#2}
l.3 \dorecurse{4}{\filler[dots]}


1 \definefiller[dots][left=\dontleavehmode, right=\hskip\ZeroPoint\par]
2 \starttext
3   \dorecurse{4}{\filler[dots]}
4 \stoptext
5 %%% Local Variables:
6 %%% Mode: context
7 %%% End:
8


?
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Color in an environment

2015-03-29 Thread Fabrice Couvreur
Hi,

1. In the following code, the color is not included in the \startframedtext
\stopframedtext environment

2. How can the height of the red square adapts to the height of the text ?

3. Can we improve the code ?


Best regards,
Fabrice

\setupcolors[state=start]
\definecolor[mycolor][c=0.00, m=0.10, y=0.20, k=0.00]

\defineenumeration
  [definition]
  [text={\blue DÉFINITION : },
   headstyle={\bf\feature[+][f:smallcaps]},
   headcommand={
   \startMPcode
   u:=0.3cm;
   filldraw (0,0)--(1u,0)--(1u,1u)--(0,1u)--cycle withcolor red ;
   \stopMPcode},
   width=fit,
   alternative=top,
   title=yes,
   titleright=,
   titleleft=,

before={\startframedtext[width=\textwidth,frame=off,background=color,backgroundcolor=\MPcolor{mycolor}]},
   after={\stopframedtext}]

\starttext
\startdefinition{\red Expérience aléatoire}
Une {\bf expérience aléatoire} est une expérience renouvelable dont les
résultats possibles sont connus sans qu'on puisse déterminer lequel sera
réalisé.
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Frame and rulethickness

2015-03-28 Thread Fabrice Couvreur
Hi,
Is it possible to have a different line thickness right and bottom ?
Best regards,
Fabrice


\defineframed
  [ACFRAME]
  [topframe=off,
   bottomframe=on,
   rightframe=off,
   leftframe=on,
   framecolor=green,
   rulethickness=2pt,
   width=fit,
   align=flushleft,
   location=low,
   background=color,
   backgroundcolor=lightgray]

\defineenumeration
  [exemple]
  [text={Exemple},
   headstyle={\bf\feature[+][f:smallcaps]},
   headcommand=\ACFRAME,
   numberconversionset=ACCONVERSION,
   inbetween={\blank[big]},
   ]

\starttext
\startexemple
\dorecurse{10}{blabla}
\stopexemple
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Problem after updating TeXlive 2014

2015-03-27 Thread Fabrice Couvreur
 Hi,
Following an update TeXlive 2014, the compilation of my old files causes the
same error :

loading : ConTeXt File Macros / Helpers
! LuaTeX error
...ab/texlive/2014/texmf-dist/tex/context/base/file-ini.lua:49: attempt to
call local 'implement' (a nil value)
stack traceback:
...ab/texlive/2014/texmf-dist/tex/context/base/file-ini.lua:49: in
function 'code'
...ab/texlive/2014/texmf-dist/tex/context/base/util-lua.lua:84: in
function 'loadedluacode'
...ab/texlive/2014/texmf-dist/tex/context/base/luat-env.lua:104: in
function 'luafilechunk'
...ab/texlive/2014/texmf-dist/tex/context/base/luat-cod.lua:45: in
function 'registercode'
[\directlua]:1: in main chunk.
\registerctxluafile ...ua.registercode(#1,#2)}

l.31 \registerctxluafile{file-ini}{1.001}

?

Best regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Alignment on the baseline in a itemize environment with \dfrac{}{}

2015-03-22 Thread Fabrice Couvreur
The alignment of the second item on the baseline is not correct if I use the
command \dfrac{}{}.
How to solve this problem without using the command \framed ?
Best regards,
Fabrice

\starttext
\startitemize[columns,A,joinedup,three][stopper={)},style=bold]
\item  $f^{\prime}(x) = \dfrac{- 1}{(x + 1)^2}$
\item  $f^{\prime}(x) = 1$
\item  $f^{\prime}(x) = \dfrac{1}{x + 1}$
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Problem in using vlingrid() and hlingrid() macros (Metafun)

2015-03-14 Thread Fabrice Couvreur
Hi,
I encounter some problems in the use of vlingrid() and hlingrid() macros. In
the code below, we see that the grid is not correct.
Does the code can be improved ?
thank you,
Fabrice

\starttext
\startMPcode
 path p ;
 u := 2cm ; v:= 1cm ;
 p := (-u,-5v)--(3u,-5v)--(3u,4v)--(-u,4v)--cycle ;
 drawoptions(withpen pencircle scaled 0.5pt withcolor
\MPcolor{mycolor});
 draw vlingrid(-u,3u,u,4u,9v) shifted (0,-5v) ;
 draw hlingrid(-5v,4v,v,9v,4u)  shifted (-u,0)  ;
 drawoptions(withpen pencircle scaled 1pt) ;
 drawarrow (-u,0)--(3u,0) ;
 drawarrow (0,-5v)--(0,4v) ;
   draw curvedfunction (x, 3*x*x-5*x+1, -1, 3, 0.01) xyscaled (u,v)
withcolor red ;
 draw curvedfunction (x, -5*x+1, -1, 3, 0.01) xyscaled (u,v)
withcolor blue ;
 draw curvedfunction (x, 7*x-11, -1, 3, 0.01) xyscaled (u,v)
withcolor green ;
 label.bot(btex $x$ etex,(2.97u,-0.1v)) ;
 label.rt(btex $y$ etex,(0.01u,3.9v)) ;
 label.llft(0,(0,0)) ;
 dotlabel.urt(A,(0,v)) ;
 dotlabel(,(u,-4v)) ;
 label.rt(C,(1.02u,-4v)) ;
 dotlabel.lrt(B,(2u,3v)) ;
 label.bot(1,(u,0)) ;
 label.lft(1,(0,v)) ;
 clip currentpicture to p ;
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Add labels to a grid (Metafun)

2015-03-06 Thread Fabrice Couvreur
To add labels to a grid, Hans wrote a macro hlintext (Min, Max, Step, Lenght
, Format). I do not know what to put in Format.
Best regards,
Fabrice

\definecolor[mycolor][c=.4,m=0,y=0,k=0]
\starttext
\start
\switchtobodyfont[small]
\startMPcode
 input tex;
 numeric xmin, xmax, ymin, ymax;
 xmin := 0; xmax := 22; ymax :=460 ;ymin:=0; u := 0.5cm; v:= 0.025cm;
 drawoptions(withpen pencircle scaled 0.5pt withcolor
\MPcolor{mycolor});
 draw hlingrid(ymin,ymax,20,11.5cm,11cm);
 draw vlingrid(xmin,xmax,2,11cm,11.5cm);
 drawoptions(withpen pencircle scaled 1pt) ;
 drawarrow (0,0)--(22,0) scaled u ;
 drawarrow (0,0)--(0,460) scaled v ;
 for i=0 step 2 until 20 :
label.bot(TEX($decimal(i)$),(i,0)*u);
 endfor;
 for i=0 step 20 until 440:
label.lft(TEX($decimal(i)$),(0,i)*v);
  endfor;
 label.bot( $x$,(10.8cm,-0.1cm)) ;
 label.rt( $y$,(0.1cm,11.3cm)) ;

\stopMPcode
\stop
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Change the dots of the macro \periods[n]

2015-03-06 Thread Fabrice Couvreur
Hi,
Is it possible to change the shape of the dots of  macro \periods[n] to be like
the dots of  macro \definefiller[dots][left=\dontleavehmode, right=\hskip\
ZeroPoint\par] ?
Best regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Bug with macro tightfunction (Metafun)

2015-02-16 Thread Fabrice Couvreur
 Hi,
This code generates an error while it was working fine a month ago.
Best regards,
Fabrice

\definecolor[mycolor][c=.4,m=0,y=0,k=0]

\starttext
\start
\switchtobodyfont[small]
\startMPcode
 input hvdm;
 input tex;
 l:=3mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
 defineDefaultArrow (l, r, alfa, beta, gamma);
 numeric xmin, xmax, ymin, ymax;
 xmin := 0; xmax := 110; ymax :=8000 ;ymin:=0; u := 0.1cm; v:= 0.002cm;
 color mycolor; mycolor:=(0.4,0,0);
 drawoptions(withpen pencircle scaled 0.3pt withcolor
\MPcolor{mycolor});
 draw hlingrid(ymin,ymax,1000,16cm,11cm);
 draw vlingrid(xmin,xmax,10,11cm,16cm);
 pickup pencircle scaled 1pt ;
 arrowline ((xmin,0) -- (xmax,0)) scaled u;
 arrowline ((0,ymin) -- (0,ymax)) scaled v;
 drawoptions(withpen pencircle scaled 1pt);
 draw tightfunction (x, x*x-84*x+5000, 0, 100, 0.01) xyscaled (u,v);
 for i=0 step 10 until 100:
 label.bot(TEX($decimal(i)$),(i*u,0));
 endfor;
 for i=0 step 1000 until 7000:
 label.lft(TEX($decimal(i)$),(0,i*v));
  endfor;
   label.top(Nombre de lots,(90u,50v));
   label.lrt(btex $f(x)$ (en euros) etex,(0,7800v));
\stopMPcode
\stop
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Hatch an area with Metapost (Metafun)

2015-02-09 Thread Fabrice Couvreur
Hi,
How hatched trapezoid MBCD ?
Best regards,
Fabrice

\starttext
\startMPcode
path p ;
p=unitsquare scaled 4cm ;
draw p ;
pair z ;
z=point 3.6 of p ;
draw z--urcorner p ;
label.llft(btex B etex,llcorner p) ;
label.lrt(btex C etex,lrcorner p) ;
label.ulft(btex A etex,ulcorner p) ;
label.urt(btex  D etex, urcorner p) ;
label.lft(btex M etex, z) ;
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] How to place text to the right of a brace

2015-02-01 Thread Fabrice Couvreur
Hi,
Wolfgang wrote, there was some time already, a nice macro to draw a brace.
In the code below, how to have the arrow and the text to the right of the
brace ?
Best regards,
Fabrice

\startuseMPgraphic{accolade}
z1  = (-233,0) ;
z2  = (-220,22) ;
z3  = (-155,211) ;
z4  = (-200,690) ;
z5  = (-142,1033) ;
z6  = (-97,1106) ;
z7  = (-71,1125) ;
z8  = (-61,1104) ;
z9  = (-80,1077) ;
z10 = (-108,1002) ;
z11 = (-129,666) ;
z12 = (-117,207) ;
z13 = (-197,19) ;
z14 = (-208,0) ;
z15 = (-197,-19) ;
z16 = (-117,-207) ;
z17 = (-129,-666) ;
z18 = (-108,-1026) ;
z19 = (-80,-1077) ;
z20 = (-61,-1104) ;
z21 = (-71,-1125) ;
z22 = (-97,-1106) ;
z23 = (-143,-1031) ;
z24 = (-199,-673) ;
z25 = (-155,-211) ;
z26 = (-220,-22) ;
fill z1 for i=2 upto 14: .. z[i] endfor  z14 for j=15 upto 26: .. z[j]
endfor .. z1  cycle  withcolor red ;
\stopuseMPgraphic

\defineoverlay[leftbrace] [\leftaligned
{\scale[height=\overlayheight]{\useMPgraphic{accolade}}}]
\defineoverlay[rightbrace][\rightaligned{\mirror{\scale[height=\overlayheight]{\useMPgraphic{accolade]



\starttext

\framedtext[frame=off,loffset=1em,roffset=1em,background={rightbrace}]{
  La longueur est \unit{4 centimeter} ; on donne à $L$ la valeur $4$.

  La largeur est \unit{3 centimeter} ; on donne à  $l$ la valeur $3$.
}
\dontleavehmode\startMPcode drawarrow (0,0)--(2cm,0) withpen pencircle
scaled 1pt withcolor red ; \stopMPcode\hskip 1cm \color[red]{Initialisation}

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Indentation inside environment

2015-01-30 Thread Fabrice Couvreur
Hi,
I would have no indentation for the text (ward)
thank you,
Fabrice

\starttext
\startitemize[A][stopper={.},style=bold]
\iem
\blank[big]
\input ward
\startitemize[n][stopper={.},style=bold]
\item
\item
\item
\stopitemize
\item
\blank[big]
\input ward
\startitemize[n][stopper={.},style=bold]
\item
\item
\item
\stopitemize
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Positioning an arrow between two values (Metapost)

2015-01-17 Thread Fabrice Couvreur
Hi,
I went from PSTricks to Metapost (Metafun) gradually. For positioning arrows
between two values in an array of variations, I used a command like this \
ncline {A}{B}, which avoids fumbling.
Can we do the same with Metapost ?
The idea would be to convert the value into a path or an image, much like in
the code below.

\starttext
\startMPcode
u:=1cm ;
path p, q ;
p=fullsquare scaled u ;
q=fullsquare scaled u shifted (4u,-2u) ;
draw p ;
draw q ;
drawarrow center p--center q ;
label(btex $5$ etex,center p) ;
label(btex $-2 $ etex,center q) ;
\stopMPcode
\stoptext

Best regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Center two frames

2015-01-13 Thread Fabrice Couvreur
Hi,
I wish the second frame is centered with the first frame. I guess this is
the figure that prevents this. However, even by reducing the value of u, it
does not work.
Best regards,
Fabrice

\definecolor[Border][c=0.00, m=0.00, y=0.00, k=0.25]

\defineframed
   [Myframed]
   [width=0.6\textwidth,
foregroundstyle={\switchtobodyfont[10pt]},
align={high,flushleft},
frame=off,
framecolor=0.625white,
background=borderline,
]

\definefiller[dots][left=\dontleavehmode,right=\hskip\zeropoint\par]

\startsetups[table:initialize]
  \setupTABLE[start]
 [align={lohi,right}
 offset=1ex,
 frame=off,
 ]
  \setupTABLE[column][first][width=0.25\textwidth]
  \setupTABLE[column][2][width=0.35\textwidth]
\stopsetups

\starttext

\startuniqueMPgraphic{borderline}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled
1.2pt ;
\stopuniqueMPgraphic

\defineoverlay[borderline][\uniqueMPgraphic{borderline}]

\placefigure[right,none]{}{
\start
\switchtobodyfont[7pt]
\startMPcode
numeric u;
u=0.7cm;
z0=(0,0) ;
z1=(2.5u,0) ;
z2=(2.5u,2.5u) ;
z3=(0,2.5u) ;
z4=(-0.2u,0) ;
z5=(-0.2u,2.5u) ;
z6=(0,2.7u) ;
z7=(2.5u,2.7u) ;
z8=(1.25u,1.25u) ;
drawdblarrow z4--z5 ;
drawdblarrow z6--z7 ;
fill z0--z1--z2--z3--cycle withcolor green ;
draw z0--z1--z2--z3--cycle ;
label.top(\unit{100 meter},0.5[z6,z7]) ;
label.lft(\unit{100 meter},0.5[z4,z5]) ;
\stopMPcode
\stop}
Compléter chacun des algorithmes ci-dessous afin qu'ils affichent en
\unit{square meter}, puis en hectares, la superficie d'un terrain
rectangulaire de longueur $L$ mètres et de largeur $l$ mètres, saisies en
entrée.

\startbuffer
\input knuth
\stopbuffer

\blank[big]
\startmidaligned
\Myframed{\getbuffer}
\stopmidaligned

\startbuffer
\input ward
\stopbuffer

\blank[big]
\startmidaligned
\Myframed{\getbuffer}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] About the macro ulcircle

2015-01-09 Thread Fabrice Couvreur
Hi,
I discovered some macro Metafun particular.
I then wanted to outline, but it does not fit with the boundary of the
quadrant.
Can I have some explanation ?
Best regards,
Fabrice

\starttext
\startMPcode
u:=1cm ;
pickup pencircle scaled 1pt ;
fill ulcircle scaled 8u withcolor lightgray ;
fill llcircle scaled 2u shifted (1u,0) withcolor lightgray ;
fill lrcircle scaled 4u shifted (1u,1u) withcolor lightgray ;
fill urcircle scaled 6u shifted (0,1u) withcolor lightgray ;
label.lft(btex $x$ etex, (0,0.5u)) ;
fill unitsquare scaled 1u withcolor lightgray ;
draw unitsquare scaled 1u ;
draw (-4u,0)--(0,0) dashed evenly ;
draw (0,1u)--(0,4u) dashed evenly ;
draw (1u,1u)--(3u,1u) dashed evenly ;
draw (1u,0)--(1u,-1u) dashed evenly ;
draw (-4u,0){up}..(0,4u)..(3u,1u){down} ;
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Center horizontally and vertically a table with a graphic in a paragraph environment

2015-01-09 Thread Fabrice Couvreur
Hi,
Is it possible to center horizontally and vertically the table with the
graphics ?
Best regards,
Fabrice

\defineparagraphs[TwoColumns][n=2]
\setupparagraphs[TwoColumns][1][width=0.45\textwidth]

\startsetups[table:initialize]

\setupTABLE[start][align={middle,lohi},width=1.5cm,offset=0.5ex,style=small]
  \setupTABLE[row][first][background=color,backgroundcolor=lightgray]
\stopsetups

\usemodule[graph]
\definecolor[mycolor][c=.4,m=0,y=0,k=0]
\starttext
\startTwoColumns
\start
\switchtobodyfont[small]
\startMPpage[instance=graph]
drawoptions(withpen pencircle scaled 1pt);
w := 10cm; h := 8cm;
ahlength := .25cm;
draw begingraph (w,h)
numeric xmin, xmax, ymin, ymax;
xmin := 0; xmax :=100; ymax :=8000 ;ymin:=0;
setrange((xmin,ymin),(xmax,ymax));
for x=xmin step 10 until xmax:
grid.bot(format(@g,x),x) withcolor \MPcolor{mycolor}
withpen pencircle scaled .3pt;
endfor
for y=ymin step 1000 until ymax:
grid.lft(format(@g,y),y) withcolor \MPcolor{mycolor}
withpen pencircle scaled .3pt;
endfor
glabel.bot(textext(Nombre de chaises),OUT);
glabel.lft(textext(Euros) rotated 90,OUT);
glabel.bot(${\cal C}$,(5,3000));
glabel.top(${\cal R}$,(15,500));
save a; numeric a[];
a0 := 2000 ; a1 := 50 ; a2 := -0.2 ;
gdraw makefunctionpath(xmin,90,1000,polynomial_function(a,2,x));
b0 := 0 ; b1 := 80 ;
gdraw makefunctionpath(xmin,90,1000,polynomial_function(b,1,x));
endgraph ;
\stopMPpage
\stop
\TwoColumns
\framed[frame=off,width=local,align={lohi,middle},location=middle]{%
\bTABLE[setups=table:initialize]
\bTR
\bTD Jours \eTD
\bTD Entrées \eTD
\eTR
\bTR
\bTD 1 \eTD
\bTD \unknown \eTD
\eTR
\bTR
\bTD 2 \eTD
\bTD \unknown \eTD
\eTR
\bTR
\bTD 3 \eTD
\bTD \unknown \eTD
\eTR
\bTR
\bTD 4 \eTD
\bTD \unknown \eTD
\eTR
\bTR
\bTD 5 \eTD
\bTD 870 \eTD
\eTR
\bTR
\bTD 6 \eTD
\bTD 910 \eTD
\eTR
\bTR
\bTD 7 \eTD
\bTD 1\,000 \eTD
\eTR
\eTABLE
}
\stopTwoColumns
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Title and defineenumeration

2014-12-31 Thread Fabrice Couvreur
Dear list,
Is it possible to remove the parentheses of the title ?
Best regards,
Fabrice

\defineframed
  [ACFRAME]
  [frame=off,
   width=fit,
   align=flushleft,
   location=low,
   background=color,
   backgroundcolor=lightgray]

\defineenumeration
  [ac]
  [text={Activité},
   headstyle={\bf\feature[+][f:smallcaps]},
   headcommand=\ACFRAME,
   numberconversionset=ACCONVERSION,
   width=fit,
   alternative=top,
   title=yes,
   ]

\defineprocessor[ACPROCESSOR][color=red,command=\groupedcommand{}{.}]

\defineconversionset[ACCONVERSION][][ACPROCESSOR-n]

\starttext
\startac{En Bretagne, il fait beau\unknown plusieurs fois par jour !}
\stopac
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Define a new type section with metafun

2014-12-26 Thread Fabrice Couvreur
Hi,
I wish red separation is exactly in the middle of the dial and the title of the
section. Then, the line is too long, it should not exceed the boundary of
the ellipse.
Best regards,
Fabrice

% macros=mkvi
\setuppapersize[A4][A4]

\setupcolors[state=start,cmyk=yes,mpcmyk=yes]
\definecolor[mycolor][c=0.45,m=0.00,y=0.1,k=0.00]
\definecolor[colortext][c=1,m=0.00,y=0.3,k=0.3]

\starttext

\startuniqueMPgraphic{funny}
path p ;
numeric h ;
h := OverlayHeight ;
p:=unitsquare xscaled \overlaywidth yscaled \overlayheight superellipsed
0.9 ;
pickup pencircle scaled \overlaylinewidth ;
fill p withcolor \MPcolor{\overlaycolor} ;
draw p withcolor \MPcolor{\overlaylinecolor} ;
draw (20,0)--(20,h) withcolor red ;
\stopuniqueMPgraphic

\defineoverlay[funny][\uniqueMPgraphic{funny}]

\define[2]\MySectionCommand
   {\framed
  [background=funny,
   frame=off,
   width=0.5\textwidth,
   align={right},
   framecolor=mycolor,
   rulethickness=1.5pt,
   backgroundcolor=white,
   offset=4pt]
  {\tfb #1\space\colortext#2}}

\setuphead[section][command=\MySectionCommand,ownnumber=yes,numbercolor=colortext]

\section{A}{PLAN DE L'ESPACE}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Parameters of a table that interfere on another table

2014-12-09 Thread Fabrice Couvreur
Hi,
I do not understand why the parameters of the first table apply to the
second table.
Best regards,
Fabrice

\setuppapersize[A4][A4]

\setuplayout[
backspace=15mm,
width=middle,
topspace=15mm,
height=middle,
header=0pt,
footer=0pt,
]
\definelabel[TableRow][text=,headcolor=red,numberconversion=characters,numberstopper=.]

\starttext
\starmidaligned
\blank[big]
\setupTABLE[row][first][align={right}]
\setupTABLE[row][first][align={right,lohi},
topframe=off,leftframe=off,rightframe=off]
\bTABLE[width=0.25\textwidth,offset=1ex]
   \bTR[nc=4]
   \bTD text \eTD
   \eTR
   \bTR
\bTD \TableRow \ text  \eTD
\bTD \TableRow \ text  \eTD
\bTD \TableRow \ text  \eTD
\bTD \TableRow \ text  \eTD
   \eTR
\bTR
\bTD
\eTD
\bTD
\eTD
\eTR
\eTABLE
\stopmidaligned

\blank[big]
\startmidaligned
\bTABLE[align={middle,lohi}]
\setupTABLE[column][first][width=0.3\textwidth]
\setupTABLE[column][two][width=0.7\textwidth]
\bTR
\bTD[nc=3]
text
\eTD
\bTD[nr=2]
\eTD
\eTR
\bTR
\bTD
text
\eTD
\bTD[nc=2]
text
\eTD
\eTR
\eTABLE
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Strange behavior with itemize

2014-12-06 Thread Fabrice Couvreur
 Hi,
Why the first two items are not there ?
Best regards,
Fabrice

\starttext
\startitemize[n][stopper={.},style=bold]
\item \startitemize[a][stopper={.},style=bold]
\item Étudier le signe de $B^{\prime}(x)$ sur l'intervalle
$\left[0\,;40\right]$.
\item Dresser le tableau de variation de la fonction $B$ sur l'intervalle
$\left[0\,;40\right]$.
\item En déduire combien de matelas l'entreprise doit produire et vendre
chaque jour pour que le bénéfice réalisé soit maximal. Que vaut alors ce
bénéfice maximal ?
\item Expliquer comment retrouver graphiquement ce résultat. Faire
apparaître les traits de constructions utiles à la lecture graphique.
\stopitemize
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Table and framedtext

2014-12-05 Thread Fabrice Couvreur
Hi,
In the following code, I would like columns that contain the figures have a
white background.
Best regards,
Fabrice

\definecolor[mycolor][c=0.1, m=0.00, y=0.00, k=0.00]
\setupcaptions[number=no]
\starttext
\startframedtext[
width=\textwidth,
frame=on,
location=middle,
background=color,
backgroundcolor=mycolor]
\leftaligned{\color[red]{PROPRIÉTÉ}}
\blank[big]
Deux plans ${\cal P}_1$ et ${\cal P}_2$ de l'espace sont soit sécants, soit
parallèles.
\blank[big]
\bTABLE[align={middle,lohi}]
\setupTABLE[column][first][width=0.3\textwidth]
\setupTABLE[column][two][width=0.7\textwidth]
\setupTABLE[row][first][background=color,backgroundcolor=mycolor]
\bTR
\bTD
${\cal P}_1$ et ${\cal P}_2$ sont {\bf sécants}.
\eTD
\bTD[nc=2]
${\cal P_1}$ et ${\cal P_2}$ sont {\bf parallèles}.
\eTD
\eTR
\bTR
\bTD
\dontleavehmode\placefigure[] {${\cal P}_1$ et ${\cal P}_2$ sont {\bf
sécants} suivant une droite $d$.} {\externalfigure[cow.pdf][width=4cm]}
\eTD
\bTD
\dontleavehmode\placefigure[] {${\cal P}_1$ et ${\cal P}_2$ sont {\bf
strictement parallèles}.} {\externalfigure[cow.pdf][width=4cm]}
\eTD
\bTD
\dontleavehmode\placefigure[] {${\cal P}_1$ et ${\cal P}_2$ sont {\bf
confondus}.} {\externalfigure[cow.pdf][width=4cm]}
\eTD
\eTR
\eTABLE
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Space around a figure in a table

2014-11-28 Thread Fabrice Couvreur
 Hi,
Why up space and down space is not the same around each figure ?
Best regards,
Fabrice

\definecolor[FondTableaux][c=0.00, m=0.00, y=0.20, k=0.00]
\startsetups[table:initialize]
  \setupTABLE[column][1,2][offset=1ex,width=2cm]
  \setupTABLE[column][3][offset=1ex,width=10cm]
  \setupTABLE[row][first][background=color,backgroundcolor=FondTableaux]
  \setupTABLE[start][align={middle,lohi}]
\stopsetups
\starttext
\blank[big]
\startmidaligned
\bTABLE[setups=table:initialize]
\bTR
 \bTH  $a$ \eTH
 \bTH $\Delta$ \eTH
 \bTH Signe de $f(x)$ \eTH
\eTR
\bTR
 \bTD 1 \eTD
 \bTD   \eTD
 \bTD \dontleavehmode\externalfigure[cow.pdf]\eTD
\eTR
\bTR
 \bTD 2 \eTD
 \bTD   \eTD
 \bTD \dontleavehmode\externalfigure[cow.pdff]  \eTD
\eTR
\bTR
 \bTD 4 \eTD
 \bTD   \eTD
 \bTD  \dontleavehmode\externalfigure[cow.pdf] \eTD
\eTR
\bTR
 \bTD 6 \eTD
 \bTD   \eTD
 \bTD  \dontleavehmode\externalfigure[cow.pdf] \eTD
\eTR
\eTABLE
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Strange behavior of a macro with ConTeXt ver : 2014.11.12 9:46 p.m. MKIV beta

2014-11-15 Thread Fabrice Couvreur
Hi,
Macro written by Hans does not work.
Best regards,
Fabrice

% macros=mkvi
\starttext

\starttexdefinition MyOtherHeader #where #day #month #year #title

\defineoverlay[whatever][\useMPgraphic{whatever}]

\startuseMPgraphic{whatever}
 path p;
 p:=fullsquare xyscaled (\overlaywidth,\overlayheight) squeezed 1pt;
 fill p withcolor white ;
 draw p withpen pencircle scaled 2pt withcolor 0.625white ;
 picture d ;
 d :=
textext(\quad#where\space\endash\space\date[d=#day,m=#month,y=#year]\quad)
 shifted .5[ulcorner p,urcorner p];
 fill boundingbox d withcolor white ; draw d ;
setbounds currentpicture to p ;
\stopuseMPgraphic

\framed [
width=\hsize,
height=5em,
foregroundstyle=\itx,
Background=whatever,
frame=off,
]
   {#title
}

\stoptexdefinition

\MyOtherHeader{Premières STMGB-STMGD}{17}{11}{2014}{{\ss \tfb \bf Second
degré : résolution d'une équation du second degré}}

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Create an item marker with a counter with Metapost

2014-11-10 Thread Fabrice Couvreur
Hi,
With the book Metafun I created a marker with metapost. How to add a counter
?
Best regards,
Fabrice

\startuseMPgraphic{itemize:fuzzy}
numeric u;
u:=0.5cm;
save p; path p;
p := fullcircle xyscaled (u,u) randomized 2pt;
pickup pencircle scaled 1pt;
fill p withcolor green;
draw p withcolor blue;
\stopuseMPgraphic
\definesymbol[itemize:fuzzy][\useMPgraphic{itemize:fuzzy}]
\setupitemize[1][symbol=itemize:fuzzy]
\starttext
\startitemize
\item \input knuth
\item \input knuth
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Numbering in a Table

2014-11-07 Thread Fabrice Couvreur
Hi,
Is it possible to use an itemize environment in a table ?
Best regards,
Fabrice

\starttext
\startsetups[table:initialize]
  \setupTABLE[height=0.8cm,align={middle,lohi}]
  \setupTABLE[row][1][background=color,backgroundcolor=cyan]
  \setupTABLE[1][1][background=color,backgroundcolor=white]
  \setupTABLE[column][1][width=10cm,align={right,lohi}]
  \setupTABLE[column][2,3,4][width=2.5cm,align={middle,lohi}]
  \setupTABLE[1][1][frame=off]
\stopsetups
\bTABLE[setups=table:initialize]
\bTR
\bTD \eTD
\bTD Vrai \eTD
\bTD Faux \eTD
\bTD Peut-être \eTD
\eTR
\bTR
\bTD \color[red]{a.} Les droites (IJ) et (AB) sont parallèles.\eTD
\bTD \eTD
\bTD \eTD
\bTD \eTD
\eTR
\bTR
\bTD \color[red]{b.} Les droites (JK) et  (BC) sont parallèles. \eTD
\bTD \eTD
\bTD \eTD
\bTD \eTD
\eTR
\eTABLE{}
\stopmidaligned
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Strange behavior with the command \color[]{}

2014-11-02 Thread Fabrice Couvreur
Hi,
In the code below, if I comment the two lines, it's okay, but if I
uncomment those
two lines, the number of faces of the cubes is not white but black, and there
are pieces of text green.
Best regards,
Fabrice

\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[cd]
\usetikzlibrary[3d]
\usetikzlibrary[arrows.meta]
\usetikzlibrary[positioning]
%\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
%\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]
\starttext

\startsetups[table:initialize]
  \setupTABLE[height=2.5cm,align={middle,lohi}]
  \setupTABLE[column][2][[width=3cm,align={right,lohi},frame=off]
  \setupTABLE[column][3][[width=8cm,align={right,lohi},frame=off]
  \setupTABLE[1][1][[width=5cm,align={right,lohi},frame=off]
  \setupTABLE[1][2,3][bottomframe=off]
  \setupTABLE[1][3,4][topframe=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[11pt]
\bTR \bTD \color[orange]{\tfa Suite d'instructions correspondant au
programme de calcul :} \eTD \bTD \eTD \bTD \color[orange]{\tfa Valeur de la
variable $X$ après l'exécution de chaque instruction :} \eTD \eTR
\bTR
\bTD $X$ prend la valeur $7$ \eTD \bTD \dontleavehmode \startMPcode
input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor blue  ;\stopMPcode \eTD
\bTD On affecte à $X$ la valeur $7$ : la valeur de $X$ est
\color[green]{$7$}. \eTD
\eTR
\bTR
\bTD $X$ prend la valeur $2X$ \eTD \bTD \dontleavehmode
\startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor red  ;\stopMPcode\eTD
\bTD On affecte à $X$ la valeur $2X$.\\Comme la valeur de $X$ est
\color[green]{$7$}, la nouvelle valeur de $X$ est :
$2\times\color[green]{7}$.\\La valeur de $X$ est maintenant
\color[green]{$14$}.
 \eTD
\eTR
\bTR
\bTD $X$ prend la valeur $X+3$ \eTD \bTD \dontleavehmode
\startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (0cm,0cm)--(3cm,0cm) withcolor green  ;\stopMPcode\eTD
\eTR
\bTD On affecte à $X$ la valeur $X+3$.\\Comme la valeur de $X$ est
\color[green]{$14$}, la nouvelle valeur de $X$ est :
$\color[green]{14}+3$.\\La valeur de $X$ est maintenant \color[green]{$17$}.
 \eTD
\eTABLE{}

\startsetups[table:initialize]
  \setupTABLE[height=2cm,align={middle,lohi}]
  \setupTABLE[column][1][[width=4cm,align={right,lohi},frame=on,
framecolor=H1prime]
  \setupTABLE[column][2][[width=5cm,align={middle,lohi},frame=off]
  \setupTABLE[column][3][[width=1cm,align={middle,lohi},frame=off]
  \setupTABLE[column][4][[width=9cm,align={right,lohi},frame=off]
  \setupTABLE[1][1][frame=off]
  \setupTABLE[1][2,3][bottomframe=off]
  \setupTABLE[1][3,4][topframe=off]
\stopsetups
\bTABLE[setups=table:initialize]
\switchtobodyfont[10pt]
\bTR
\bTD \color[red]{ Suite d'instructions :} \eTD
\bTD \eTD
\bTD \eTD
 \bTD \color[orange]{ Valeur de la variable $A$  et valeur de la variable
$B$ après l'exécution de chaque instruction :}\eTD
\eTR
\bTR
\bTD $A$ prend la valeur $3$ \eTD
\bTD
\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white,
  },
  face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, xscale=1/3] {};
   }}
}
\starttikzpicture
\pic [cube face/.append style={ball color=green}] at (-1, 1) {cube=3  with
$A$};\pic [cube face/.append style={ball color=red}] at ( 1, 1) {cube={}
with $B$};

\stoptikzpicture
 \eTD
\bTD
\dontleavehmode \startMPcode input hvdm;
l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
defineDefaultArrow (l, r, alfa, beta, gamma); pickup pencircle scaled
0.4mm; arrowline (1cm,0cm)--(0cm,0cm)  ;\stopMPcode
\eTD
\bTD La valeur de $A$ est \color[green]{3} et $B$  n'a pas encore de valeur
\eTD
\eTR
\bTR
\bTD $B$ prend la valeur $A+1$ \eTD
\bTD
\tikzset{%
  cube join/.style={
thick, -{Stealth},
  },
  cube face/.style={
minimum size=1cm, outer sep=0pt,
draw=white, thick, line join=round,
shading=ball,
text=white, font=\bfseries
  },
 face color/.style={cube face/.append style={ball color=#1}},
  pics/cube/.style args={#1 with #2}{
  code={
\node [cube face, label={[name=-label]below:#2}] (-front) {#1};
\node [cube face] (-top)  at (-front.north west) [anchor=south west,
xslant=1, yscale=1/3] {};
\node [cube face] (-side) at (-front.south east) [anchor=south west,
yslant=1, 

[NTG-context] Package {tikz-cd} with ConTeXt

2014-10-28 Thread Fabrice Couvreur
Hi,
The following code compiles with pdflatex :

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{3d,shapes}

\begin{document}
\tikzset{xzplane/.style={canvas is xz plane at y=#1,
thick,shading=ball,ball color=red,draw=black}}
\tikzset{yzplane/.style={canvas is yz plane at x=#1,thick,shading=ball,
ball color=red,draw=black}}
\tikzset{xyplane/.style={canvas is xy plane at z=#1,thick,shading=ball,ball
color=red,draw=black}}
\tikzcdset{
arrow style=tikz,
diagrams={=stealth}}
\[\begin{tikzcd}
\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){\Large 7};
\draw[xyplane=2] node[below=0.25cm] at (1,0){\Large X};}
\arrow[thick, bend left, start anchor = north, end anchor = north, shorten
=1mm]{r}[scale=2]{\times 2}
\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){\Large 14};
\draw[xyplane=2] node[below=0.25cm] at (1,0) {\Large X};}
\arrow[thick, bend left, start anchor = north, end anchor = north, shorten
= 1mm]{r}[scale=2]{+ 3}
\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){\Large 17};
\draw[xyplane=2] node[below=0.25cm] at (1,0){\Large X};}
\end{tikzcd}\]

\begin{tikzpicture}
  \tikzstyle {bulle}=[circle,draw,thick]
  \tikzstyle{fleche}=[thick,=stealth,-]
  \node(debut1) at (0,0) {$7$};
  \node(debut3) at (4,0) {$14$};
  \draw [fleche](debut1.north) to [bend left] (debut3.north);
  \node [bulle,fill=white] (debut6) at (2,0.75) {$\times 2$};
\end{tikzpicture}
\end{document}

I tried with Context, but it does not work :

\usemodule[tikz]
\usetikzlibrary[calc]
\usetikzlibrary[cd]
\usetikzlibrary[3d]
\usetikzlibrary[arrows]
\usetikzlibrary[positioning]
\starttext
\tikzset{xzplane/.style={canvas is xz plane at y=#1,
thick,shading=ball,ball color=red,draw=black}}
\tikzset{yzplane/.style={canvas is yz plane at x=#1,thick,shading=ball,
ball color=red,draw=black}}
\tikzset{xyplane/.style={canvas is xy plane at z=#1,thick,shading=ball,ball
color=red,draw=black}}
\tikzcdset{
arrow style=tikz,
diagrams={=stealth}}
\starttikzcd
\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){ 7};
\draw[xyplane=2] node[below=0.25cm] at (1,0){X};}
\arrow[thick, bend left, start anchor = north, end anchor = north, shorten
=1mm]{r}[scale=2]{$\times 2$}
\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){ 14};
\draw[xyplane=2] node[below=0.25cm] at (1,0) {X};}
\arrow[thick, bend left, start anchor = north, end anchor = north, shorten
= 1mm]{r}[scale=2]{+ 3}
\tikz{\draw[xzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[yzplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] (0,0)--(2,0)--(2,2)--(0,2) --cycle;
\draw[xyplane=2] node[white] at (1,1){ 17};
\draw[xyplane=2] node[below=0.25cm] at (1,0){X};}
\stoptikzcd
\stoptext

Best regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Extra line in a list

2014-10-21 Thread Fabrice Couvreur
Hi,
In the code below, why is there an extra line in the first item ?
Best regards,
Fabrice

\usesymbols[mvs]
\setupsymbolset[europe]

\starttext

\startitemize[n][stopper={.},style=bold]
\item
\startitemize[a][stopper={.},style=bold]
\item On pose $P_A=9$ et $P_B=7$.

On a alors $\frac{1}{2}P_A+\frac{1}{2}P_B=4,5+3,5=8$.

Le prix du kilogramme de mélange $M_1$ dont la moitié est de variété A est
donc de 8 \symbol[EUR].
\item $\frac{1}{4}P_A+\frac{3}{4}P_B=2,25+5,25=7,5$.

Le prix du kilogramme de mélange $M_2$ contenant $\frac{1}{4}$ de variété A
est donc de 7,5 \symbol[EUR].
\item $\frac{3}{5}P_A+\frac{2}{5}P_B=5,4+2,8=8,2$.

Le prix du kilogramme de mélange $M_3$ contenant $\frac{2}{5}$ de variété B
est donc de 8,2 \symbol[EUR].
\stopitemize
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Module algorithmic

2014-10-18 Thread Fabrice Couvreur
Hi Wolfgang,
How to reduce the size of the float ?
Best regards,
Fabrice

\usemodule[algorithmic]
\definefloat[algorithm][algorithms]


\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]

\setupfloat
  [algorithm]
  [background=color,
   frame=on,
   framecolor=H1prime,
   backgroundcolor=H4,
   width=0.5\textwidth]

\starttext
\placealgorithm[none][]{}
  {\startalgorithmic\black
   \STATE{\bf Variables :}
   \STATE  $N$ et $P$ sont deux entiers naturels
   \STATE  $A$ est un nombre réel
\STATE{\bf Entrée :}
   \STATE Demander à l'utilisateur la valeur de $N$
   \STATE{\bf Initialisation :}
   \STATE Affecter à $A$ la valeur $92\,000$
   \STATE{\bf Traitement :}
   \STATE Affecter à $P$ la valeur $N-1$
   \FOR{$I=1$ to $P$}
   \STATE Affecter à $A$ la valeur $1,163 \times A$
   \STATE Afficher A
   \ENDFOR
   \stopalgorithmic}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] (no subject)

2014-10-13 Thread Fabrice Couvreur
hi,
In the following code, the default stopper is the point.

\starttext
\startitemize[columns,a,joinedup]
\item $f(0)$
\item $g(0,3)$
\item $f(\sqrt 2)$
\item $g(-4)$
\stopitemize
\stoptext

How to have a break ?
Best regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Stopper and itemize

2014-10-13 Thread Fabrice Couvreur
hi,
In the following code, the default stopper is the point.

\starttext
\startitemize[columns,a,joinedup]
\item $f(0)$
\item $g(0,3)$
\item $f(\sqrt 2)$
\item $g(-4)$
\stopitemize
\stoptext

How to have a break ?
Best regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Using \startframedtext with \startcombination

2014-09-29 Thread Fabrice Couvreur
Hi,
Why the second frame is not displayed ?
Best regards,
Fabrice

\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
\starttext
\startcombination[2*1]
{%
\startframedtext[
width=0.45\textwidth,
frame=on,
framecolor=H1prime,
location=left,
background=color,
backgroundcolor=lightgray]
{\bf Algorithme A}
\startitemize[2]
\item Choisir un nombre
\item Élever au carré
\item Multiplier par 4
\item Ajouter le produit du nombre choisi au départ par 28
\item Donner le résultat
\stopitemize
\stopframedtext
}{}
{%
\startframedtext[
width=0.45\textwidth,
frame=on,
framecolor=H1prime,
location=right,
background=color,
backgroundcolor=H4]
\startitemize[2]
{\bf Algorithme B}
 \item Choisir un nombre
\item Prendre son double
\item Ajouter 7
\item Prendre le carré du résultat
\item Retrancher 49
\item Donner le résultat
\stopitemize
\stopframedtext
}{}
\stopcombination
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Change linewidth of a table

2014-09-17 Thread Fabrice Couvreur
Hi,
How to complete the grid ?
Thank you.
Fabrice

\setuppapersize[A4]
\setuplayout[
backspace=5mm,
width=middle,
topspace=5mm,
height=middle,
header=0pt,
footer=0pt,
]

\definetypeface [me] [rm] [serif] [pagella] [default]
\definetypeface [me] [ss] [sans]  [dejavu]  [default]
\definetypeface [me] [mm] [math]  [xits][default]

\setupbodyfont[me,12pt]


\startsetups[table:initialize]
  \setupTABLE[height=2.25cm,width=2.25cm]
  \setupTABLE[column][1,4,7][frame=off,rulethickness=1.2pt,leftframe=on]
  \setupTABLE[column][9][frame=off,rulethickness=1.2pt,rightframe=on]
  \setupTABLE[row][9][frame=off,rulethickness=1.2pt,bottomframe=on]
  \setupTABLE[row][1,4,7][frame=off,rulethickness=1.2pt,topframe=on]
  \setupTABLE[start][align={middle,lohi}]
\stopsetups
\starttext
\startmidaligned
\switchtobodyfont[small]
\bTABLE[setups=table:initialize]
\bTR
\bTD  \eTD
\bTD $\sqrt{25}$ \eTD
\bTD  \eTD
\bTD Partie entière de $\pi$ \eTD
\bTD  \eTD
\bTD $\frac{48}{8}$ \eTD
\bTD  \eTD
\bTD  \eTD
\bTD 5 augmenté de 40\,\% \eTD
\eTR
\bTR
\bTD  \eTD
\bTD  \eTD
\bTD  \eTD
\bTD  \eTD
\bTD $4\sqrt{4}$ \eTD
\bTD  Le double de $\frac{15^3 \times 2^2}{5^2 \times 6^3}$\eTD
\bTD  \eTD
\bTD Nombre premier pair \eTD
\bTD Nombre de faces d'une pyramide à base triangulaire
\eTD
\eTR
\bTR
\bTD  \eTD
\bTD 30\,\% de 30  \eTD
\bTD $2^3$ \eTD
\bTD  Opposé de $(5-9)$\eTD
\bTD Nombre d'axes de symétrie d'un rectangle \eTD
\bTD \eTD
\bTD Nombre de faces d'un cube \eTD
\bTD  \eTD
\bTD \eTD
\eTR
\bTR
\bTD$\frac{\sqrt{324}}{2}$  \eTD
\bTD  \eTD
\bTD $27^0$ \eTD
\bTD \eTD
\bTD  \eTD
\bTD Numérateur de la fraction irréductible égale à
$\frac{9\,261}{33\,957}$ \eTD
\bTD L'inverse de $\sin{\unit{30 degree}}$\eTD
\bTD\eTD
\bTD PGCD de 11\,760 et de 2\,574\eTD
\eTR
\bTR
\bTD \eTD
\bTD $\sqrt{25-9}$ \eTD
\bTD \eTD
\bTD \eTD
\bTD  \eTD
\bTD  \eTD
\bTD \eTD
\bTD $\frac{10^{-2}}{0.01}$\eTD
\bTD\eTD
\eTR
\bTR
\bTD$\frac{125}{25}$ \eTD
\bTD \eTD
\bTD Quatrième nombre premier \eTD
\bTD $\sqrt{1}\times \sqrt{4}$\eTD
\bTD Nombre de diviseurs de 20 \eTD
\bTD  \eTD
\bTD Numérateur de
$\frac{7}{4}-\frac{1}{2}+\frac{5}{8}-\frac{3}{4}$\eTD
\bTD \eTD
\bTD $\left(2\sqrt{2}\right)^2$ \eTD
\eTR
\bTR
\bTD Le quart du seizième de $256$\eTD
\bTD \eTD
\bTD Nombre de côtés d'un pentagone\eTD
\bTD \eTD
\bTD L'opposé de la différence du tiers de $21$ et du carré
de $4$ \eTD
\bTD  \eTD
\bTD Nombre d'axes de symétrie d'un triangle équilatéral\eTD
\bTD Nombre de sommets d'un cube\eTD
\bTD\eTD
\eTR
\bTR
\bTD \eTD
\bTD $\frac{\left(2\sqrt{3}\right)^2}{12}$\eTD
\bTD \eTD
\dontleavehmode \bTD
\startMPcode
defaultscale:=0.8;
angle_radius:=4pt;
def mark_rt_angle(expr a, b, c)=
draw((1,0)--(1,1)--(0,1))
zscaled (angle_radius*unitvector(a-b))
shifted b
enddef;
def midpoint(expr a, b) = (.5[a,b]) enddef;
u:=0.4cm;
path p;
z0=(0,0);
z1=(4u,0);
z2=(0,3u);
z3=(2u,0);
z4=(0,1.5u);
z5=midpoint(z1,z2);
draw z0--z1--z2--cycle;
mark_rt_angle(z1,z0,z2);
label.bot(4,z3);
label.lft(3,z4);
label.urt(?,z5);
\stopMPcode
\eTD\bTD Solution de l'équation $4x-5=2x+9$ \eTD
\bTD  \eTD
\bTD  \eTD
\bTD  \eTD
\bTD$\left(\frac{2}{\sqrt{2}}\right)^2$\eTD
\eTR
\bTR
\bTD$\frac{\sqrt{192}-\sqrt{128}}{\sqrt{3}-\sqrt{2}}$ \eTD
\bTD \eTD
\bTD \eTD
\bTD $2^{\rm ?}=2$ \eTD
\bTD  \eTD
\bTD Nombre d'axes de symétrie d'un carré \eTD
\bTD \eTD
\bTD $\sqrt{81}-\sqrt{4}$\eTD
\bTD\eTD
\eTR
\eTABLE
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Placement of a figure

2014-09-02 Thread Fabrice Couvreur
Hi,
In this code, the figure is placed on the base line. How to make the
numbering at the top of the figure ?

\starttext
\startitemize[n][stopper=),style=bf]
\item \midaligned{\externalfigure[figure1_reperage.pdf]}
\startitemize[a][stopper=),style=bf]
  \item Donner les coordonnées des points $A$ et $B$ dans le repère
$\left(O,\, I,\, J\right)$.
  \item Compléter les phrases suivantes :

les abscisses des points $A$ et $B$ sont $\ldots$ ;

les ordonnées des points $A$ et $B$ sont $\dots\;$.
\item Placer les points $C$ et $D$ de coordonnées respectives
$\left(-2\,;3\right)$ et  $\left(4\,;0\right)$.
\item Placer le point $E$ de même abscisse que $C$ et d'ordonnée $-1$.
\stopitemize
\stoptext

With LaTeX, I did this : \raisebox{-\height+1em}{\includegraphics{}}

thank you
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Itemize and framed

2014-08-29 Thread Fabrice Couvreur
Hi,
Is this the best way to insert a list in a frame ?
thank you,
Fabrice

\setupcolors[state=start]
\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]
\definecolor[H4][c=0.07, m=0.00, y=0.15, k=0.00]
\starttext
\framed[corner=06,frame=on,framecolor=H1prime,location=middle,background=color,backgroundcolor=H4]{%
\rbox{
\startitemize[1]
 \item planter le piquet 1 à côté de l'arbre 1 ;
 \item aligner le piquet 1, le piquet 2 et les deux arbres puis fixer les
piquets 3 et 4 ;
\item se placer de manière à être aligné avec l'arbre 2 et le piquet 3
d'une part ;

 et avec l'arbre 1 et le piquet 4 d'autre part.
\item mesurer sa distance à l'arbre 1 ;
\item rechercher, dans le tableau, la distance correspondante entre les
deux arbres.
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Strange behavior in a table.

2014-08-29 Thread Fabrice Couvreur
Everything is in the title, thank you.

\starttext
\`A l'aide du graphique, compléter les tableaux de correspondance suivants.
\blank[small]
{\setupTABLE[row][even][height=0.6cm]
\setupTABLE[row][odd][height=0.6cm]
\setupTABLE[1][1,2][width=3.2cm]
\setupTABLE[column][2,3,4,5,6,7][width=0.14\textwidth]
\bTABLE[align={middle,lohi}]
\bTR
\bTH {Hauteur en dm} \eTH
\bTD {0} \eTD
\bTD {0,5} \eTD
\bTD {1} \eTD
\bTD {1,5} \eTD
\bTD {2} \eTD
\bTD {2,5} \eTD
\eTR
\bTR
\bTH {Volume d'eau en L} \eTH
\bTD {} \eTD
\bTD {}  \eTD
\bTD {}  \eTD
\bTD {}  \eTD
\bTD {}  \eTD
\bTD {} \eTD
\eTR
\eTABLE
\blank[small]
\bTABLE[align={middle,lohi}]
\bTR
\bTH {Volume d'eau en L} \eTH
\bTD {1} \eTD
\bTD {2} \eTD
\bTD {3} \eTD
\bTD {4} \eTD
\bTD {5} \eTD
\bTD {10} \eTD
\eTR
\bTR
\bTH {Hauteur en dm} \eTH
\bTD {} \eTD
\bTD {}  \eTD
\bTD {}  \eTD
\bTD {}  \eTD
\bTD {}  \eTD
\bTD {} \eTD
\eTR
\eTABLE}

Les graduations obtenues n'étant pas assez fines, Pascal demande à son
gendre de préciser ses calculs. La suite de l'histoire ...plus tard.
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Problem with embedding code TikZ code

2014-08-29 Thread Fabrice Couvreur
In the code below, I do not understand why the label Arbre 2 does not
have the color you want, that is to say the same as the label Arbre 1.
Thank you.

\usemodule[tikz]
\usetikzlibrary[calc]

\definecolor[A2][c=0.60, m=0.00, y=0.00, k=0.10]
\definecolor[H1prime][c=0.50, m=0.00, y=1.00, k=0.00]

\starttext
\starttikzpicture[line width=0.3mm, =stealth, x=1cm, y=1cm,line cap=round,
line join=round]
\tikzstyle{epais}=[line width=0.5mm, line cap=butt]
\tikzstyle{tres epais}=[line width=0.8mm, line cap=butt]
\draw [tres epais] (6.02,3.63)-- (8.88,3.64);
\draw (6.02,3.63)-- (6.03,0.77);
\draw [tres epais] (6.03,0.77)-- (6.02,3.63);
\draw [tres epais] (8.88,3.64)-- (8.89,0.78);
\draw [dashed] (-3.38,3.6)-- (8.89,-0.09);
\draw [dashed] (8.89,-0.09)-- (8.89,0.78);
\draw [dashed] (-3.38,3.6)-- (6.02,3.63);
\draw [A2,epais,domain=-1:2] plot(\x,{(-8.9-4.4*\x)/-3});
\draw [A2,epais,domain=1.5:4.5] plot(\x,{(--1.58-5.12*\x)/-4.72});
\draw (8.84,4.4) node {\color[H1prime]{\bf Arbre 1}};
\draw (-2.96,4.4) node {\color[H1prime]{\bf Arbre 2}};
\node at (8.14,0.8)  {\small piquet 4};
\draw [A1](8.84,-0.3) node {\bf Georges};
\node[rotate=45] at (0.28,1.88)  {\color[A2]{\bf Ravin}};
\node[rotate=90] at (9.4,1.74)  {\color[B1prime]{\bf longueur mesurée}};
\draw (2.46,4) node {\color[B1prime]{\bf longueur inconnue à estimer}};
\draw[B1prime,-] (9.05,3.62)-- (9.05,-0.09);
\draw[B1prime,-] (-3.38,3.8)-- (8.9,3.8);
\node at (8.84,4.0)  {\small piquet 1};
\node[rotate=30] at (6.22,4)  {\small piquet 2};
\node[rotate=30] at (6.22,0.5)  {\small piquet 3};
\stoptikzpicture
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Strange behavior with Metapost

2014-05-27 Thread Fabrice Couvreur
Hello,
Why curve drawn is not that expected ?
Fabrice

\starttext
\startMPcode
 input hvdm;
 l:=2.8mm; r:=0.6; alfa:=45; beta:=0; gamma:=0;
 defineDefaultArrow (l, r, alfa, beta, gamma);
 numeric xmin, xmax, ymin, ymax;
 xmin :=-2; xmax := 4; ymax :=5 ;ymin:=-1; u := 1cm;
 pickup pencircle scaled 1pt ;
 drawarrow ((xmin,0) -- (xmax,0)) scaled u;
 drawarrow ((0,ymin) -- (0,ymax)) scaled u;
 draw tightfunction (x, 2*(x-1)*(x-1)+2, xmin, xmax,
(xmax-xmin)/10)
 scaled u;
 setbounds currentpicture to boundingbox (((xmin,ymin) --
 (xmax,ymax)) scaled u);
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Edit the arrows default Metapost

2014-05-22 Thread Fabrice Couvreur
Hello,
Is it possible to change the appearance Metafun arrows default to make them
resemble those of PSTricks that I find most beautiful.
Regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Metapost and Metafun

2014-05-21 Thread Fabrice Couvreur
Hi,
As PSTricks (which I prefer) is not yet well integrated, I decided to learn
Metapost starting with a simple code.

\starttext
\startMPcode
numeric xmin, xmax, ymin, ymax;
xmin := -2.5; xmax := 2.5; ymax :=2.5 ;ymin:=-2.5; u := 2cm;
vardef f(expr x) = -x*x+1 enddef;
xinc := 0.001;
path pts_f;
pts_f := (xmin,f(xmin))*u
for x=xmin+xinc step xinc until xmax+xinc:
.. (x,f(x))*u
endfor;
path axe_x,axe_y;
path screen;
screen=(xmin,ymin)*u--(xmax,ymin)*u--(xmax,ymax)*u--(xmin,ymax)*u--cycle;
axe_x = (xmin,0)*u -- (xmax,0)*u;
axe_y = (0,ymin)*u -- (0,ymax)*u;
drawarrow axe_x;
drawarrow axe_y;
draw pts_f withpen pencircle scaled 1;
clip currentpicture to screen;
\stopMPcode
\stoptext

Are there any routines with Metafun to improve this code?
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Define a new command from the command \periods[n]

2014-05-20 Thread Fabrice Couvreur
Hi,
Is it possible to redefine the command \periods[n] to have a line that goes
from the end of the word to the edge of the page without having to play on
the number n ?
Regards,
Fabrice

\starttext
\startitemize[a][stopper=),style=bold]
\item $x\mapsto -x^2+x+1$ : \periods[66]
\item $x\mapsto 2x^3+4x-7$ : \periods[65]
\item $x\mapsto x^2-3$ : \periods[70]
\item $x\mapsto \frac{x^2+x}2$ : \periods[72]
\item $x\mapsto (x-2)^2$ : \periods[69]
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Bug with TikZ module ?

2014-05-15 Thread Fabrice Couvreur
Hi,
Why the three words are not aligned on the baseline ?
Regards,
Fabrice

\usemodule[tikz]
\starttext
\starttikzpicture[level/.style={sibling distance=10mm}]
\node{}[grow=right]
child{node{J}}
child{node{R}}
child{node{B}
child{node{J}}
child{node{R}}
child{node{B}
child{node{J}}
child{node{R}}
child{node{B}}}
};
\node at (3,-0.75) {$\vdots$};
\node at (4.5,0.25) {$\vdots$};
\node at (1.5,-2.5) {toit};
\node at (3,-2.5) {fenêtre};
\node at (4.5,-2.5) {porte};
\stoptikzpicture
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Some problems with a new style for the sections

2014-05-04 Thread Fabrice Couvreur
Hi,
I encounter two problems :
- Section numbers are not red ;
- Calling the second section does not cause the creation of a new paragraph.
Regards,
Fabrice

\setupcolors[state=start]
\def\MySectionCommand#1#2%
  {\framed
 [frame=off,
  width=\textwidth,
  align={right},
  background=color,
  backgroundcolor=lightgray]
 {#1\quad#2}}

\setuphead[section][command=\MySectionCommand,numbercolor=red]

\setupbodyfont[palatino,12pt]

\starttext

\MySectionCommand{A.}{Définitions}
\input knuth
\MySectionCommand{1.}{Propriétés}
\input knuth
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Subsection number independant of section

2014-05-02 Thread Fabrice Couvreur
Hi,
I would get a dial like this :

A. Section one
1. Subsection one

With the code below, I get :

A. Section one
A. A. Subsection one

\setupsection
  [section]
  [conversion=Character]


\setuplabeltext
  [section={{},{.}},
   subsection={{},{.}}]


\setupsection
  [subsection]
  [previousnumber=no]

\setupbodyfont[pagella,11pt]

\starttext
\section{Définitions}
\subsection{Approche de la loi binomiale}
\stoptext

Why ?
Regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Numbering in a frame with a new environment

2014-04-27 Thread Fabrice Couvreur
Hello,
How to make the numbering is in the frame and red ?

\defineenumeration
  [ac]
  [text={
 \inframed[frame=off,
 width=fit,
 align={right},
 background=color,
 backgroundcolor=lightgray]{Activité}},
 headstyle={\bf\feature[+][f:smallcaps]},
 width=fit,
 stopper={.},
 alternative=left,
   ]
\starttext
\startac
Tirage dans une urne
\stopac
\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Text and figure side by side

2014-04-24 Thread Fabrice Couvreur
Hi,
Is it possible to put side by side text and a figure created in a TikZ
environment
?
Thank you,
Fabrice

\usemodule[tikz]
\usetikzlibrary[calc]
\starttext
\def\smiley{%
\starttikzpicture[baseline=-0.75ex,black]
\filldraw[fill=orange] circle (2mm);
\node[fill,circle,inner sep=0.5pt] (left eye) at (135:0.8mm) {};
\node[fill,circle,inner sep=0.5pt] (right eye) at (45:0.8mm) {};
\draw (-145:0.9mm) arc (-120:-60:1.5mm);
\stoptikzpicture}
\placefigure[right,none]{}{
\starttikzpicture
\coordinate (c1) at (0,0);
\draw[thick,fill=darkgreen] ($(c1) + (0:30mm)$) arc (0:360:30mm)
($(c1) + (360:35mm)$) arc (360:0:35mm);
\draw[thick,fill=gray] ($(c1) + (0:3mm)$) arc (0:360:3mm);
\foreach \x in {0,36,...,180}
\draw[fill=red, draw=black](c1)--(\x:30mm) arc (\x:\x+36:30mm)--(c1);
\foreach \x in {216,252,...,324}
\draw[fill=blue, draw=black](c1)--(\x:30mm) arc (\x:\x+36:30mm)--(c1);
\foreach \x in {3,12,...,360}
\draw[fill=lightgray] (\x:28mm) circle (2pt);
\draw[thick,fill=white!30] ($(c1) + (0:3mm)$) arc (0:360:3mm)
($(c1) + (360:4mm)$) arc (360:0:4mm);
\draw[thick,fill=darkgray] ($(c1) + (0:3mm)$) arc (0:360:3mm);
\foreach \x in {18,54,...,198}
\node [white,rotate=\x] at (\x:17.5mm){\small \bf PERDU};
\foreach \x in {234,270,306,342}
\node [] at (\x:17.5mm) {\smiley};
\draw[darkgray,-latex,line width=4pt, line cap=round] (90:37mm) --
(90:26mm);
\stoptikzpicture}
\input knuth
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] The spacing of the float interferes with the spacing of the itemgroup

2014-04-24 Thread Fabrice Couvreur
Why the vertical spacing is not observed between item 2 and item 3 ?
Thank you,
Fabrice

\starttext
\startitemize[n][stopper=),style=bold]
\item \input knuth
\item \input knuth
\placefigure[right,none]{}{%
\setupTABLE[c][1] [width=2.25cm]
\setupTABLE[row][1,2][width=1.5cm]
\bTABLE[align={middle,lohi}]
\bTR\bTD {\math{k}} \eTD \bTD {0} \eTD \bTD {1} \eTD \bTD {2} \eTD \bTD {3}
\eTD\eTR
\bTR\bTD {\math{P\left(X=k\right)}} \eTD \bTD {} \eTD \bTD {} \eTD \bTD {}
\eTD \bTD {} \eTD  \eTR
\eTABLE
}
\item \input knuth
\item \input knuth


\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Problem with \starthanging ...\ stophanging

2014-04-24 Thread Fabrice Couvreur
Hello,
I can not run text around the figure.
thank you,
Fabrice

\starttext
\starthanging[location=right]
{\externalfigure[image.pdf][width=8cm]}
\input knuth

\input knuth
\stophanging
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Two figures are side by side

2014-04-16 Thread Fabrice Couvreur
Hi,
How do the two figures are side by side ?

\setupTABLE[row][1,2][width=1.5cm,align={middle,lohi}]
\setupTABLE[c][1][width=3cm,align={middle,lohi}]
\starttext
\startcombination[2*1]
{%
\bTABLE[align={middle,lohi}]
\bTR\bTD{}\eTD\bTD{$A$}\eTD\bTD{$\overline{A}$}\eTD\bTD{Total}\eTD\eTR
\bTR\bTD{$B$}\eTD\bTD{}\eTD\bTD{}\eTD\bTD{}\eTD\eTR
\bTR\bTD{$\overline{B}$}\eTD\bTD{}\eTD\bTD{}\eTD\bTD{}\eTD\eTR
\bTR\bTD{Total}\eTD\bTD{}\eTD\bTD{}\eTD\bTD{1}\eTD\eTR
\eTABLE
}
{%
{\externalfigure[denombrement.pdf]}
}
\stopcombination
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Table next to a text in an environment of type list

2014-03-29 Thread Fabrice Couvreur
Hi,
How to improve this code to make the table to the right of the text in the
environment list ?

\midaligned{\tfb Cadres en entreprise}
\blank
On compte 67 femmes dans une entreprise de 160 personnes.

Parmi les personnes de cette entreprise, il y a 32 cadres dont 15 femmes.
\startitemize[n][stopper=),style=bold]
\item Recopier le tableau ci-contre.

\startitemize[n][stopper=),style=bold]
\setuphanging[location=right]
\starthanging{%
\bTABLE[align={middle,lohi}]
\bTR\bTD {} \eTD \bTD {\bf Femmes} \eTD \bTD {\bf Hommes} \eTD \bTD {\bf
Total} \eTD \eTR
\bTR \bTD {\bf Cadres} \eTD  \bTD {15} \eTD \bTD {} \eTD \bTD {32} \eTD
\bTR  \bTD {\bf Autres employés} \eTD \bTD {} \eTD \bTD {} \eTD \bTD {}
\eTD  \eTR
\bTR  \bTD {\bf Total} \eTD \bTD {67} \eTD \bTD {} \eTD \bTD 160{} \eTD
\eTR
\eTABLE}
\stophanging
\item Parmi les 160 personnes de cette entreprise, on en choisit une au
hasard.

On considère les événements suivants :
\startitemize[2]
\item F : \quotation{la personne choisie est une femme} ;
\item C : \quotation{la personne choisie est un cadre}.
\stopitemize
\startitemize[a][stopper=),style=bold]
\item Définir par une phrase les événements \math{\overline{C}}, \math{F
\cap C} et \math{F\cap\overline{C}}.
\item Calculer les probabilités \math{P(F)}, \math{P(C)},
\math{P(\overline{C})}, \math{P(F \cap C)} et \math{P(F \cap
\overline{C})}.
\stopitemize
\item \startitemize[a][stopper=),style=bold]
\item La personne choisie est un cadre de l'entreprise. Quelle est la
probabilité que ce soit une femme ?

{\it On note \math{P_{C}(F)} cette probabilité.}
\item Calculer \math{\dfrac{P(F \cap C)}{P(C)}}. Que constate-t-on ?
\stopitemize
\item \startitemize[a][stopper=),style=bold]
\item On choisit une femme parmi les personnes de l'entreprise. Quelle est
la probabilité qu'elle soit cadre ?

{\it On note \math{P_{F}(C)} cette probabilité.}
\item Exmpliquer pourquoi on obtient le résultat de la question précédente
en calculant  \math{\dfrac{P(C \cap F)}{P(F)}}.
\stopitemize
\item Que représentent en termes de probabilités les quotients
\math{\dfrac{52}{67}} et \math{\dfrac{52}{128}} ?
\stopitemize

\stoptext

Regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Index notation in math mode

2014-03-24 Thread Fabrice Couvreur
Hi,
I would like the  f  in \math{\cal C_f} is identical to that obtained
with \math{f}.
Regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] PSTricks with ConTeXT

2014-03-20 Thread Fabrice Couvreur
Hi,
After searching, it seems it is not possible to compile a file containing a
PSTricks environment ?
Is that correct ?
Regards,
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Problem with an environment

2014-03-06 Thread Fabrice Couvreur
I'm trying to built a template for evaluations of my students.
I have a problem with the head environment that does not take into account
the selected font and size.
Regards,
Fabrice


\environment environ-2

\environment environ-3

\environment header

\starttext

\MyOtherHeader{Seconde GTA}{20}{3}{2014}{{\ss \tfd \bf Correction du devoir
maison de Mathématiques} }{{\ss \bf \tfd 9}}

\startex
 \input knuth
 \stopex
\stoptext

##

\startenvironment environ-2

\loadtypescriptfile[mathdesign]

\definetypeface [mainface] [rm] [serif] [palatino] [default]

\definetypeface [mainface] [tt] [mono]  [modern] [default] [rscale=0.9]

\definetypeface [mainface] [mm] [math]  [xits] [default]

\setupbodyfont[mainface,11pt]

\setuppagenumbering[location=]

\setupexternalfigures[location={local,global,default}]

\setupexternalfigures[directory=/home/fab/Seconde/2013_2014/Figures/]

\mainlanguage[fr]

\stopenvironment


Thanks Hans for this header


% macros=mkvi

\startenvironment header

\environment environ-2

\starttexdefinition MyOtherHeader #where #day #month #year #title #number

\defineoverlay[whatever][\useMPgraphic{whatever}]

\startuseMPgraphic{whatever}
 path p;
 p:=fullsquare xyscaled (\overlaywidth,\overlayheight) squeezed 1pt;
 fill p withcolor white ;
 draw p withpen pencircle scaled 2pt withcolor 0.625white ;
 picture d ;
 d :=
textext(\quad#where\space\endash\space\date[d=#day,m=#month,y=#year]\quad)
 shifted .5[ulcorner p,urcorner p];
 fill boundingbox d withcolor white ; draw d ;
setbounds currentpicture to p ;
\stopuseMPgraphic

\framed [
width=\hsize,
height=5em,
foregroundstyle=\itxx,
background=whatever,
frame=off,
]
   {#title
\space
{\ss\tfc\bf n \high{\tfa \bf o}}
\space
#number
}

\stoptexdefinition

\stopenvironment


Thanks Wolfgang for this environment

#
\startenvironment environ-3

\defineenumeration
  [ex]
  [text={Exercice},
   headstyle={\bf\feature[+][f:smallcaps]},
   inbetween={\blank[small]},
   stopper={.}]



\stopenvironment

#
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

<    2   3   4   5   6   7   8   >