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

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

## hatching.tex #

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

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


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

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


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

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

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

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


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



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


Sorry, but I can't typeset math unless various parameters have been set.
This is
normally done by loading special math fonts into the math family slots.
Your font
set is lacking at least the parameter mentioned earlier.


mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Thu Dec 24 16:30:13
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Several lines under a limit

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

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

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

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


[NTG-context] Several lines under a limit

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

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

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


Re: [NTG-context] Import a metapost extension

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

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

> Taco Hoekwater schrieb am 01.09.2020 um 19:12:
>
> Hi,
>
>
> On 1 Sep 2020, at 16:46, Hans Hagen   
> wrote:
>
> On 9/1/2020 3:04 PM, Fabrice Couvreur wrote:
>
> Hi Taco,
> Thank you for your help. I specify that this extension works perfectly by 
> compiling the following file.
>
> A logfile of a failed run would have been more helpful in trying to track 
> down the problem. But I did notice that there is a LaTeX file loaded in your 
> succesful run. So perhaps the extension depends on LaTeX
>
>
> I looked for the file online [1] and it uses LaTeX commands (even
> begin/end blocks) for all text boxes.
>
> [1] https://melusine.eu.org/syracuse/poulecl/mp-scratch/
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Import a metapost extension

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

input mp-scratch;

Scratchversion:=3;

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


But what you are proposing unfortunately does not work.
Fabrice

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

> Hi,
>
> I think you need this:
>
> \startMPinclusions
>   input mp-scratch;
> \stopMPinclusions
>
> \startMPcode
>   Scratchversion:=3;
>   ….
>
> If that also doesn’t work, perhaps attach the log file / terminal output
> to a new message.
>
> Best wishes,
> Taco
>
> > On 1 Sep 2020, at 13:07, Fabrice Couvreur 
> wrote:
> >
> > Hello
> > Is it possible to import a metapost extension into a file compiled with
> the lmtx engine ?
> > I tried unsuccessfully with this example :
> >
> >  begin test.tex
> >
> > \starttext
> > \startMPcode
> >   input mp-scratch;
> >
> > Scratchversion:=3;
> >
> > draw Drapeau;
> > draw Repeter("4");
> > draw Avancer("50");
> > draw Tournerd("90");
> > draw FinBlocRepeter;
> >
> > \stopMPcode
> > \stoptext
> >
> >  end test.tex
> >
> > Thanks
> > Fabrice
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
>
> Taco Hoekwater
> Elvenkind BV
>
>
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
This is MetaPost, version 2.00 (TeX Live 2020) (kpathsea version 6.3.2)  1 SEP 2020 15:01
**scratch-1.mp
(/home/viserion/texlive/2020/texmf-dist/metapost/base/mpost.mp
(/home/viserion/texlive/2020/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) ) (./scratch-1.mp
(/home/viserion/texmf/metapost/mp-scratch.mp
(/home/viserion/texmf/metapost/LATEXScratch.mp)
(/home/viserion/texmf/metapost/Mouvement.mp)
(/home/viserion/texmf/metapost/Apparence.mp)
(/home/viserion/texmf/metapost/Sons.mp) (/home/viserion/texmf/metapost/Stylo.mp
) (/home/viserion/texmf/metapost/Controle.mp)
(/home/viserion/texmf/metapost/Evenements.mp)
(/home/viserion/texmf/metapost/Bloc.mp)
(/home/viserion/texmf/metapost/Divers.mp)
(/home/viserion/texmf/metapost/Capteurs.mp)
(/home/viserion/texmf/metapost/Variable.mp)) (./mptextmp.mp) (./mptextmp.mp)
>> 34.55159
>> 55.29037 (./mptextmp.mp) (./mptextmp.mp)
>> 105.50436 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp)
(./mptextmp.mp) (./mptextmp.mp)
>> 39.74248
>> 63.32898 (./mptextmp.mp) (./mptextmp.mp)
>> 84.05197 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp)
(./mptextmp.mp) (./mptextmp.mp)
>> 56.92798
>> 92.35968 (./mptextmp.mp) (./mptextmp.mp)
>> 112.43477 (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp) (./mptextmp.mp)
(./mptextmp.mp) (./mptextmp.mp)
>> 97.13678
>> 127.64769 (./mptextmp.mp) (./mptextmp.mp)
>> 171.08908 (./mptextmp.mp) [1{psfonts.map}{crlt_csjzgd.enc}] )
1 output file written: scratch-1.1

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

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


[NTG-context] Import a metapost extension

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

 begin test.tex

\starttext
\startMPcode
  input mp-scratch;

Scratchversion:=3;

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

\stopMPcode
\stoptext

 end test.tex

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

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


Re: [NTG-context] Mathematical symbol of non-inclusion

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

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

>
> > On 30 Aug 2020, at 11:40, Fabrice Couvreur 
> wrote:
> >
> > @Hans My ignorance is total : how to write symbols from the keyboard ?
>
> I use text substitutions on MacOS: a sequence of characters can be
> automatically translated into another. So for example, ".subset" might
> translate into "⊂" as you type along. To find the ⊂ the first time, there
> is a Unicode symbol table. Other platforms and editors have similar
> features. There are other ways, but I have found this easiest and fastest
> both to create and use.
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Mathematical symbol of non-inclusion

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

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

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

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


[NTG-context] Mathematical symbol of non-inclusion

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

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

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


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

2020-08-24 Thread Fabrice Couvreur
Thanks !!

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

> Fabrice Couvreur schrieb am 24.08.2020 um 15:32:
>
> Hi Wolfgang,
> Thank you for your reply. Probably my fault but now I get the number 0 on
> the word "Summary".
> Fabrice
> [image: contents.png]
>
>
> \setuphead
>   [title]
>   [command=,
>numbercommand=]
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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

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

> Fabrice Couvreur schrieb am 23.08.2020 um 16:02:
>
> Hello,
> For the title of the chapters I use the following command.
>
> \unexpanded\def\HeadTitle#1#2%
>{\framed
>   [frame=off,
>width=fit,
>align=flushleft]
>{\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
> \blank#1\blank#2}
>
> When I compile my project, I have the label "Chapitre" above the word
> "Sommaire" in the table of contents : how to delete it ?
>
>
> 1. Don't apply the command to \title
>
> \setuphead[title][command=]
>
>
> 2. Make the command local to bodypart of your document, this works only
> when you use section blocks (e.g. \startbodymatter)
>
> \startsectionblockenvironment[bodypart]
> \setuphead[chapter][command=\HeadTitle]
> \stopsectionblockenvironment
>
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Color specific cells in a table

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

\usecolors[X11]

\starttext
\startluacode

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

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

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

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

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

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

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


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

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

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

When I compile my project, I have the label "Chapitre" above the word
"Sommaire" in the table of contents : how to delete it ?
Thanks for your help
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Chapter number with Luametafun

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

%%% Begin example

\mainlanguage[fr]

\setcharacterspacing [frenchpunctuation]

\setuplabeltext[fr][chapter=Chapitre~]

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

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

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

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

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

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

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


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

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

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

> Fabrice Couvreur schrieb am 07.08.2020 um 16:30:
> > Hello,
> > I have a little problem with the numbering of theorems when there is no
> > subsection. I would like to know :
> >
> > Theorem 1.1
> > Theorem 1.2
> >
> > Theorem 2.3
> > Theorem 2.4
> >
> > Thank you
> > Fabrice
>
> Use a conversion set to set the number conversion for you sections and
> remove the conversion setting (\setuphead[...][conversion=...]) from the
> setups.
>
> \defineconversionset [fabrice] [n,n,R,n] [n]
>
> \setupheads
>[sectionconversionset=fabrice]
>
> Wolfgang
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] About the numbering of theorems

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

Theorem 1.1
Theorem 1.2

Theorem 2.3
Theorem 2.4

Thank you
Fabrice

 begin example

\setuplabeltext[chapter=Chapitre~]

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

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

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

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

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

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

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

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

\stoptext

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

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


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

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

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

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

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


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

> Hi Hans,
>
> Thanks for the hint which consists in adding an \ifmmode to the definition
> of \qed.
> However, as you suggest, one needs some other mechanism in math mode,
> since with your new definition of \qed the alignment of the formula changes
> when one adds this close symbol:
>
>  begin-example-qed.tex
> \definesymbol[Fin][\mathematics{\square}]
> \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi}
> \starttext
> \startformula
> a^2 + b^2 = c^2.
> \stopformula
> \startformula
> a^2 + b^2 = c^2. \qed
> \stopformula
> One sees that\type{\qed} in the formula changes the alignment of the
> formula. \qed
> \stoptext
>  end-example-qed.tex
>
> Thanks a lot for everything: Otared
>
> > On 4 Aug 2020, at 13:24, Hans Hagen  wrote:
> >
> > On 8/4/2020 11:17 AM, Otared Kavian wrote:
> >> Thanks Hans for your explanations.
> >> The problem I encountered is that, the command \qed is used dozens of
> time in my text without any issue because it was preceded by something on
> th eline, but the only place where it was alone after a formula resulted in
> the error and it was not easy for me to isolate the issue…
> >> By the way, in mkii it was possible to add \qed on the last line of a
> math formula, but that does not work anymore:
> >> \definesymbol[Fin][\mathematics{\square}]
> >> \def\qed{\strut\wordright{\symbol[Fin]}}
> >> \starttext
> >> \startformula
> >> a^2 + b^2 = c^2. \qed
> >> \stopformula
> >> The above formula does not show the close symbol.\qed
> >> \stoptext
> >> Is there a way to have something like \qed work in math formulas?
> > because that's now hwpo wordright works ...
> >
> > \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi}
> >
> > but we probably need something different, something that hooks into
> display math
> >
> > Hans
> >
> >
> > -
> >  Hans Hagen | PRAGMA ADE
> >  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> >   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> > -
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Notation of the first derivative in mathematical mode (lmtx)

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

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

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


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

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

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

\starttext

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

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

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


Re: [NTG-context] upload

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

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

This returns the error message

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

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

Thank you
Fabrice

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

> Hi,
>
> Normally we don't report on successive loe level improvements in the
> engine or the core of context (we do so in articles and wrapups), and
> much goes unnoticed anyway (which is good). But ... the last couple of
> weeks we have been playing with some adapted functionality in lmtx and
> some of the experimental low level code has now made it in core.
> Normally users will not notice this but who knows.
>
> There are already features in lmtx that are not (and are unlikely to be)
> in mkiv (most significant in the metapost related part). When possible
> new macros and additions to mechanism will be in both mkiv and lmtx, but
> lmtx users will be better off in the end. We're mostly talking of the
> more tricky mechanisms here, those that currently have limitations due
> to all kind of possible interferences. To summarize:
>
> mkii : frozen (seldom patches)
> lmtx : cutting edge
> mkiv : when possible following lmtx, otherwise frozen
>
> Because we develop lmtx and luametatex alongside it is no problem if we
> have experimental (and even temporary imperfect) code in the engine:
> context knows about it and especially with experiments, we try to make
> sure it doesn't hit users (who we don't expect to use those, often
> undocumented, new tricks anyway). It's sometimes the only way to go
> forward (stepwise testing).
>
> So, here is an example of where lmtx can do better than mkiv:
>
> \placefigure[left]{}{}  \input ward  \par
> \placefigure[left]{}{} {\bf \input ward} \par
>
> Another area is in using footnotes. As a first step to more robust
> handling of deeply nested notes, lmtx now defaults to (the more than a
> decade optional in mkiv) \automigrateinserts, but with less overhead
> (for performance reasons, it was never enabled in mkiv, apart from
> occasional side effects). It is features like these that will stepwise
> be improved, at least that is what we hope for.
>
> So, the current upload has some new stuff, hopefully without too many
> side effects, but if so, we'll deal with it as usual. As a result, the
> latest lmtx could be a little slower, but I wonder if someone will
> notice it in practice.
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Fill an area defined by a subpath (Metafun)

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

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

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

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


[NTG-context] Fill an area defined by a subpath (Metafun)

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

\starttext
\startMPcode

  path circle, p, q, b;

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

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

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

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

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

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


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

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

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

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

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


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

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

\usecolors[X11]

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

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

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

  draw leftcorner -- rightcorner;
\stopuseMPgraphic

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

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


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

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

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

> On 7/20/2020 2:40 PM, Jeong Dal wrote:
>
> > I also wonder where is the boundary of ConTeXt.
> The boundaries are set and shift by users (the mailing list) and
> curiosity (personal).
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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


that I have to make (by convention).
Fabrice

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

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

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


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

2020-07-18 Thread Fabrice Couvreur
Small correction :

\starttext

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

end

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

\stopluacode

\stoptext

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

> Hi Wolfgang,
>
> It works but why did you ask this question since I finally use context ?
>
>> Are you sure you want to use context(...) here?
>>
> How not to display the .0 ?
> Fabrice
>
> Le sam. 18 juil. 2020 à 22:22, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> a écrit :
>
>> Fabrice Couvreur schrieb am 18.07.2020 um 22:09:
>> > Hi,
>> > I improved the code to be able to display the grid but I cannot display
>> > the coefficients.
>> > Thank you
>> > Fabrice
>> >
>> > \starttext
>> >
>> > \startluacode
>> >   function Binom(n,k)
>> > if k > n then
>> >   return 0
>> > elseif (n == 0 or k == 0) then
>> >   return 1
>> > else
>> >   return (n*Binom(n-1,k-1))/k
>> > end
>> >
>> >  end
>> >
>> >  context.startxtable({"align={middle,lohi},
>> > width=1.2cm,offset=0.8ex,bodyfont=9pt"})
>> >  for i = 1, 10 do
>> >context.startxrow({"background=color,backgroundcolor=cyan"})
>> >  for j = 1, i do
>> >context.startxcell()
>> >   \ctxlua{context(Binom(i,j))}
>>
>> Remove \ctxlua:
>>
>> context(Binom(i,j))
>>
>> Wolfgang
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2020-07-18 Thread Fabrice Couvreur
Hi Wolfgang,

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

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

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

> Fabrice Couvreur schrieb am 18.07.2020 um 22:09:
> > Hi,
> > I improved the code to be able to display the grid but I cannot display
> > the coefficients.
> > Thank you
> > Fabrice
> >
> > \starttext
> >
> > \startluacode
> >   function Binom(n,k)
> > if k > n then
> >   return 0
> > elseif (n == 0 or k == 0) then
> >   return 1
> > else
> >   return (n*Binom(n-1,k-1))/k
> > end
> >
> >  end
> >
> >  context.startxtable({"align={middle,lohi},
> > width=1.2cm,offset=0.8ex,bodyfont=9pt"})
> >  for i = 1, 10 do
> >context.startxrow({"background=color,backgroundcolor=cyan"})
> >  for j = 1, i do
> >context.startxcell()
> >   \ctxlua{context(Binom(i,j))}
>
> Remove \ctxlua:
>
> context(Binom(i,j))
>
> Wolfgang
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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

\starttext

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

end

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

\stopluacode

\stoptext


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

> Fabrice Couvreur schrieb am 18.07.2020 um 20:05:
>
> Hello,
> I want to display the values of Pascal's triangle in a table.
> Unfortunately my knowledge of Lua is not sufficient to run this code.
> Thank you.
> Fabrice
>
> \starttext
>
> \startluacode
>  function Binom(n,k)
>if k > n then
>  return 0
>elseif (n == 0 or k == 0) then
>  return 1
>else
>  return (n*Binom(n-1,k-1))/k
>  end
>  context(Binom(n,k))
>
> Are you sure you want to use context(...) here?
>
> end
>
> context.startxtable({"align={middle,lohi},
> width=1.2cm,offset=0.8ex,bodyfont=9pt"})
> context.startxrow({"background=color,backgroundcolor=green"})
> for i = 0, 10 do
>   for j = 0, i do
>   context.startxcell()
> context(Binom(i,j))
>   context.stopxcell()
>   end
> end
> context.stopxrow()
>
> context.stopxtable()
>
> Wolfgang
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Code lua in a table

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

\starttext

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

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

\stopluacode

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

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


Re: [NTG-context] Text around a figure

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

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

\setupfloats[freeregion=no]

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

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

\stoptext

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

> Otared Kavian schrieb am 16.07.2020 um 11:58:
> > Hi Fabrice,
> >
> > Maybe you can play with different settings of your textbackground, as in
> >
> > \definetextbackground[fondpaille]
> >   [background=color,
> >   backgroundcolor=fondpaille,
> >   frame=off,
> >   location=paragraph, % or: text, always, paragraph
> >   backgroundoffset=4pt] % change the value here
>
> It's a float feature which can be disabled.
>
> \setupfloats[freeregion=no]
>
> Wolfgang
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Text around a figure

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

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

> Hi Fabrice,
>
> I think what Wolfgang suggests is something like the following:
>
> \useMPlibrary[dum]
> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
> \definetextbackground[fondpaille]
> [background=color,
> backgroundcolor=fondpaille,
> frame=off,
> location=always]
>
> \starttext
>
> \starttextbackground[fondpaille]
> \startplacefigure[number=no,location=right]
> \externalfigure[dummy]
> \stopplacefigure
> \startitemize[n]
> \dorecurse{3}{\startitem \input ward \stopitem}
> \stopitemize
> \stoptextbackground
>
> \stoptext
>
> Best regards: Otared K.
>
> > On 15 Jul 2020, at 22:13, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> wrote:
> >
> > Fabrice Couvreur schrieb am 15.07.2020 um 19:54:
> >> Hello,
> >> I always encounter difficulties with the placement of figures in such a
> way that the text envelops the figure.
> >> Thank you.
> >> Fabrice
> >> \useMPlibrary[dum]
> >> \definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
> >> \starttext
> >> \startframedtext[width=max,background=color,backgroundcolor=fondpaille]
> >>  \placefloat[][right,none]{}
> >>{\externalfigure[dummy]}
> >>  \startitemize[n]
> >>\dorecurse{3}{\startitem \input ward \stopitem}
> >>  \stopitemize
> >>\stopframedtext
> >>\stoptext
> >
> >
> > Side floats don't work in frames, use the textbackground environment to
> add a colored box behind the text.
> >
> > Wolfgang
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Text around a figure

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

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

\starttext

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

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

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


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

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

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

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

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


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

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

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

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

\starttext

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

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

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


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

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

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

Fabrice

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

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

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


[NTG-context] About the table of contents

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

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


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

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


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

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

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

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


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

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

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

>
>
> > Am 07.07.2020 um 19:27 schrieb Fabrice Couvreur <
> fabrice1.couvr...@gmail.com>:
> >
> > Hello,
> > I want a vertical space between the label and the chapter title: is this
> the right way to proceed ?
>
> Why not? It seems to work. What’s your problem?
>
> BTW I’d set \mainlanguage[fr]
>
> Hraban
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Vertical space between label and title

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

\setuplabeltext[chapter=Chapitre~]

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

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

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

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

\starttext


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

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

  \stopchapter

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

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


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

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

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

> Hi Fabrice,
>
> Like this maybe? It depends on what you want to achieve exactly, I think
>
> \useMPlibrary[dum]
>
> \setuppapersize[A4]
>
> \setuplayout
>   [width=12cm,
>rightmargin=5cm]
>
> \defineuserdata [margintext] [alternative=margintext]
>
> \defineuserdataalternative [margintext]
> [renderingsetup=userdata:margintext]
>
> \startsetups [userdata:margintext]
>   \margindata
> [inright]
> [style={\switchtobodyfont[9pt]},
>  width=\rightmarginwidth,
>  align={flushleft,broad},
>  stack=yes]
> {\startframedtext[before=,after=,offset=0pt,width=max,frame=off]
>  \getinlineuserdata
>  \stopframedtext}
> \stopsetups
>
> \showframe
> \starttext
> \startuserdata[margintext]
>  {\bf Remarque — }\input ward
> \stopuserdata
> \startuserdata[margintext]
>  \externalfigure[dummy][width=\rightmarginwidth]
> \stopuserdata
> \startchapter[title=First chapter]
> \dorecurse{2}{\input knuth}
> \stopchapter
> \stoptext
>
>
> > On 6 Jul 2020, at 16:18, Fabrice Couvreur 
> wrote:
> >
> >
> >
> > -- Forwarded message -
> > De : Fabrice Couvreur 
> > Date: lun. 6 juil. 2020 à 12:10
> > Subject: Re: [NTG-context] Store images and text in the right margin
> > To: Marco 
> >
> >
> > Hello,
> > What has been proposed by Wolfgang and Marco works correctly but is it
> possible to define a single environment margintext which would allow to
> include both text and figures ?
> > Thank you
> > Fabrice
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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


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

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

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

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


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

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

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

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

> On Thu, 2 Jul 2020 17:20:07 +0200
> Fabrice Couvreur  wrote:
>
> Try:
>
> > \useMPlibrary[dum]
> >
> > \setuppapersize[A4]
> >
> > \setuplayout
> >   [width=12cm,
> >rightmargin=5cm]
> >
> > \definemargindata[marginfigure][inright]
> > \setupmargindata [marginfigure][command=\vbox,align=middle]
>
> \setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]
>
> > \startsetups [userdata:margintext]
> >   \margindata
> > [inright]
> > [%style=\smallbodyfont,
> >  style={\switchtobodyfont[9pt]},
> >  width=\rightmarginwidth,
>
>   stack=yes,
>
> >  align={flushleft,broad}]
> > {{\bf Remarque — }\getinlineuserdata}
> > \stopsetups
>
> > \marginfigure{\externalfigure[dummy][width=\rightmarginwidth]}
>
>
> \marginfigure{\externalfigure[dummy][width=\rightmarginwidth,location=high]}
>
> Marco
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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

\useMPlibrary[dum]

\setuppapersize[A4]

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

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

\defineuserdata [margintext] [alternative=margintext]

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

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

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

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


Re: [NTG-context] Compile only one new component in a project

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

##chapter-4-seconde.tex##

\startcomponent chapter-4-seconde

\startchapter[title=]
...
\stopchapter

\stopcomponent


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

> On Thu, 7 May 2020, Fabrice Couvreur wrote:
>
> > Hi,
> > Here is part of a project that is starting to be heavy ; when i add a
> > chapter i do context seconde.tex
> > How do I compile only the chapter I just added ?
> > Thank you.
> > Fabrice
> >
> > \startproduct Seconde
> >
> > \environment modules
> > \environment specialite-style
> > \environment specialite-macros
> >
> >  \startfrontmatter
> >  \component specialite-titlepage
> >  \component specialite-contents
> >  \stopfrontmatter
> >
> >  \startbodymatter
> >\component chapter-1-seconde
> >\component chapter-2-seconde
> >\component chapter-3-seconde
> >\component chapter-4-seconde
> >  \stopbodymatter
> > \stopproduct
>
> context chapter-4-seconde
>
> There is a MyWay which shows how you can share cross-refs etc.
>
> Aditya
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Compile only one new component in a project

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

\startproduct Seconde

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

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

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


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

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


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

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

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

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

\stoptext

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

> On Mon, 4 May 2020, Fabrice Couvreur wrote:
>
> > Hi,
> > Sorry to insist but I cannot fix this problem.
> > Thanks for any help.
>
> I don't know the answer, but here is a simpler example without pgfplot
> which fails (different calligraphic C's):
>
>
>
> \define[1]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}}\stop}
>
> \starttext
> \startTEXpage[offset=2mm]
> \cscript{C}
> \start
>\switchtobodyfont[9pt]
>\cscript{C}
> \stop
> \stopTEXpage
> \stoptext
>
> And here is a version with a minor change that works (same calligraphic
> C's)!
>
> \usebodyfont[xitsbidi]
>
> \define[1]\cscript{\start\m{{\mathscript{#1}}}\stop}
>
> \starttext
> \startTEXpage[offset=2mm]
> \cscript{C}
> \start
>\switchtobodyfont[9pt]
>\cscript{C}
> \stop
> \stopTEXpage
> \stoptext
>
> Aditya
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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

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

> Hi,
> This macro was written by Otared and it works well unless I change the
> size of the font (see the second graph).
> How to correct this problem ?
> Thanks for your help.
> Fabrice
>
>  begin example
>
> \usemodule[pgfplots]
> \pgfplotsset{compat=newest}
>
> \define[2]\cscript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}_{#2}}\stop}
>
> \starttext
>
>  \startmidaligned
>  \starttikzpicture
>  \startaxis
>\addplot {x};
>\node[above left] at (2,2) {\cscript{C}{f}};
>\stopaxis
>  \stoptikzpicture
>  \stopmidaligned
>  \blank
>  \startmidaligned
>   \switchtobodyfont[9pt]
>   \starttikzpicture
>   \startaxis
>\addplot {x};
>\node[above left] at (2,2) {\cscript{C}{f}};
>\stopaxis
>  \stoptikzpicture
>  \stopmidaligned
>
> \stoptext
>
> end example
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] \setupinteraction [ ...] do not work

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

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

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


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

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

 begin example

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

\starttext

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

\stoptext

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

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


[NTG-context] Text size with lmt_text [ ]

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

\usecolors[xwi]

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

\starttext

\startMPcode

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

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

\stopMPcode

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

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


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

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

\startMPcode

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

\stopMPcode

Fabrice

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

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

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


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

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

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

\startMPcode

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

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

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

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

\stopMPcode

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

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


Re: [NTG-context] Text around an image

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

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



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

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

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


[NTG-context] Text around an image

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

  \useMPlibrary [dum]

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

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

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

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

  \starttext

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

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

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

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


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

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

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

> On Mon, 13 Apr 2020, Fabrice Couvreur wrote:
>
> > Hi,
> > Sorry to restart the discussion, but I have updated my entire system and
> > the problem remains. I used the example of Aditya.
> > Thank you.
> > Fabrice
> >
> > \usemodule[pgfplots]
> > \starttext
> > \starttikzpicture
> >   \startaxis
> > \addplot {x};
> >   \stopaxis
> > \stoptikzpicture
> > \stoptext
> >
> > tex error   > tex error on line 5 in file
> pgfplotsbinary.data.code.tex:
> > ! Undefined control sequence
> >
> > l.5 ...ode`\^0=11\expandafter\xdef\csname pgfp@bin@\the\counter
> > \endcsname{^0
> >
> >}\advance\counter by1
> > lua error:
>
> I have no clue what pgfplotsbinary.data.code.tex does, but simply
> bypassing that works for the simple example above.
>
> Simply create an empty file with the name pgfplotsbinary.data.code.tex in
> your current directory and compile your example.
>
> Note that if your code uses any of the features which are provided by this
> file (and I am not sure what they are), then it will fail. But at least
> this "fix" works for the simple example above.
>
> Aditya
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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

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

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

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

}\advance\counter by1
lua error:

?


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

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

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

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

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


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

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

}\advance\counter by1
lua error:

?


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

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

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

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

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


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

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

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

}\advance\counter by1
lua error:

?






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


mtx-context | fatal error: return code: 256

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


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

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

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

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

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

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

\stoptext

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

> On 4/8/20 10:19 AM, Fabrice Couvreur wrote:
> > Hi,
> > Is there a more elegant way to have a white background for the table?
>
> Hi Fabrice,
>
> I think not including the table in the framed text is the easiest way to
> avoid the colored background.
>
> Or why do you need the table inside the framed text, which only adds the
> background color (and disables the frame)?
>
> > In fact, my question is more general: if we insert an image, the
> > background color envelops this image: how to solve this problem?
>
> Unless you provide a sample that shows the issue you are facing, not
> including the image in the frame may be your best option.
>
> Just in case it helps,
>
> Pablo
> --
> http://www.ousia.tk
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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

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

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


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

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

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

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

   0}\advance\counter by1
lua error:

?






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


mtx-context | fatal error: return code: 256

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

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

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

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


[NTG-context] Lmtx + pgfplots compilation error

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

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

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

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

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

?






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


mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Mon Apr  6 22:19:01
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Compile a file embedding modules with the lmtx engine

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

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

> On 4/3/20 7:21 PM, Fabrice Couvreur wrote:
> >
> > I reinstalled context and lmtx, followed your instructions because I got
> > the same error message but now I get another error message; my editor is
> > Emacs.
> >
> > Running `LmtX' on `ESSAI' with
> > ``/home/viserion/LMTX/tex/texmf-linux-64/bin/mtxrun --autogenerate
> > --script context --autopdf ESSAI''
> > mtxrun  | unknown script 'context.lua' or 'mtx-context.lua'
>
> Hi Fabrice,
>
> from the shell, run "~/LMTX/tex/texmf-linux-64/bin/mtxrun --generate"
> before.
>
> After that, it should compile your document fine.
>
> Pablo
> --
> http://www.ousia.tk
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Compile a file embedding modules with the lmtx engine

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

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


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

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

> On 4/3/20 2:18 PM, Fabrice Couvreur wrote:
> > Hi,
> >
> > I did the installation then I copied the files and finally I did mtxrun
> > --generate
> > The file does not compile and I get a file where it says ERROR.
> >
> > viserion@archlinux ~]$ cd /home/viserion/data/context/tex/texmf-modules/
> > [viserion@archlinux texmf-modules]$ ls
> > doc  fonts  ls-R  metapost  scripts  source  tex  VERSION
>
> Hi Fabrice,
>
> I have just installed both LMTX and the ConTeXt Suite brand new. I moved
> the tex/texmf-modules contents form the Suite to LMTX tex/temxf-modules.
>
> Your file was compiled perfectly fine. I removed the contents of
> tex/texmf-modules and I got these errors:
>
> system  > jobfiles > unknown tex file
>
> '/home/ousia/64ctx/tex/texmf-modules/tex/context/pgf/frontendlayer/t-tikz.tex'
> modules > 'tikz' is loaded
>
> tex error   > tex error on line 2 in file ./a.tex: ! Undefined
> control sequence
>
>  \syst_helpers_triple_empty_two_nop  \usetikzlibrary
>
> l.2 \usetikzlibrary
>  [calc]
>
> If you get a similar error, I would do the following:
>
> 1. Remove tex/texmf-cache/luatex-cache.
> 2. Run "mtxrun --generate".
> 3. Compile the document.
>
> I hope this helps,
>
> Pablo
> --
> http://www.ousia.tk
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Compile a file embedding modules with the lmtx engine

2020-04-03 Thread Fabrice Couvreur
Hi,

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

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

Fabrice



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

> On 4/3/20 12:38 PM, Fabrice Couvreur wrote:
> > Hi,
> > I'm sorry but I didn't necessarily follow all the threads. I use to make
> > my graphics Metapost or Metafun, but I also sometimes use TiKz. This
> > file compiles with context but not with lmtx because the modules are not
> > recognized. I am willing to use only lmtx which seems to be the future
> > of ConteXt, but how do I do that?
>
> Hi Fabrice,
>
> do you have any modules installed in your LMTX distribution?
>
> As far as I know (sorry if I’ missing something), the user should
> install the modules manually for LMTX.
>
> Your sample compiles for me, but I copied the tex/texmf-modules
> directory from the ConTeXt Suite to the LMTX distribution.
>
> I hope this helps,
>
> Pablo
> --
> http://www.ousia.tk
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Compile a file embedding modules with the lmtx engine

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


\usemodule[tikz]
\usetikzlibrary[calc]

\starttext

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

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

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


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

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

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

> Il 19/03/20 11:20, Fabrice Couvreur ha scritto:
> > Hi,
> > this file did not pose any problems but today yes.
> > Thank you.
> > Fabrice
> >
> > \starttext
> > \startluacode
> > local letters_1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" }
> > local letters_2 = { "1", "Année", "1998", "1999", "2000", "2001", "2002",
> > "2003", "2004", "2005","2006" }
> > context.startxtable({"align={middle,lohi},
> > width=1.2cm,offset=0.8ex,bodyfont=9pt"})
> >
>
> context.startxtable( { align = "middle,lohi", width = "1.2cm", offset =
> "0.8ex", bodyfont = "9pt" } )
>
> The argument is a lua table. Values are usually strings.
>
> > context.startxrow({"background=color,backgroundcolor=green"})
>
> context.startxrow( { background = "color", backgroundcolor = "green" } )
>
> ... and so on.
>
> Best wishes,
> Massi
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Bug (Lua) ?

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

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

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

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

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

context.stopxtable()
\stopluacode
\stoptext


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

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

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

mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Thu Mar 19 11:15:49
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Exercise file with statements and correction

2020-03-17 Thread Fabrice Couvreur
Hi Otared,

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

Thanks
Fabrice

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

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

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


Re: [NTG-context] Exercise file with statements and correction

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

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

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

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


Re: [NTG-context] Exercise file with statements and correction

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

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

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

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

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

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

> Hi Pablo,
> Thank you very much, it's a great base to start with.
> Fabrice
>
> Le mar. 17 mars 2020 à 22:09, Pablo Rodriguez  a écrit :
>
>> On 3/17/20 9:14 PM, Fabrice Couvreur wrote:
>> > Hello,
>> > I would like to make files with statements of exercises and correction
>> > where it would be enough to click on "correction" to access the
>> > correction at the end of the file. I'm running out of time, does anyone
>> > have a model to share ?
>>
>> Hi Fabrice,
>>
>> I don’t have a model, but the following sample could give you a hint:
>>
>>   \setupinteraction[state=start, focus=standard]
>>   \starttext
>>   \startbodymatter
>>   \chapter[lesson-1]{Lesson 1}
>>   \section[exercises-1]{Exercises 1}
>>   These are the exercises.
>>
>>   Here you have their key (\about[key-1]).
>>   \stopbodymatter
>>   \startappendices
>>   \section[key-1]{Key to Lesson 1}
>>   This is the key
>>
>>   Back to exercises (\about[exercises-1])
>>   \stopappendices
>>   \stoptext
>>
>> I hope it helps,
>>
>> Pablo
>> --
>> http://www.ousia.tk
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>>
>> ___
>>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Exercise file with statements and correction

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

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

> On 3/17/20 9:14 PM, Fabrice Couvreur wrote:
> > Hello,
> > I would like to make files with statements of exercises and correction
> > where it would be enough to click on "correction" to access the
> > correction at the end of the file. I'm running out of time, does anyone
> > have a model to share ?
>
> Hi Fabrice,
>
> I don’t have a model, but the following sample could give you a hint:
>
>   \setupinteraction[state=start, focus=standard]
>   \starttext
>   \startbodymatter
>   \chapter[lesson-1]{Lesson 1}
>   \section[exercises-1]{Exercises 1}
>   These are the exercises.
>
>   Here you have their key (\about[key-1]).
>   \stopbodymatter
>   \startappendices
>   \section[key-1]{Key to Lesson 1}
>   This is the key
>
>   Back to exercises (\about[exercises-1])
>   \stopappendices
>   \stoptext
>
> I hope it helps,
>
> Pablo
> --
> http://www.ousia.tk
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Exercise file with statements and correction

2020-03-17 Thread Fabrice Couvreur
Hello,
I would like to make files with statements of exercises and correction
where it would be enough to click on "correction" to access the correction
at the end of the file. I'm running out of time, does anyone have a model
to share ?
Thank you so much.
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Quizz

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

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

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

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


[NTG-context] Quizz

2020-03-15 Thread Fabrice Couvreur
Hi,
With the Coronavirus pandemic, my school will close like all the others. We
chose to work with Microsoft Teams. I know how to file Math exercises
written with ConteXt and export to pdf format. Is it possible with ConteXt
to create interactive Quizz?
Thank you
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Hatch color in a table cell

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

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

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

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

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

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

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

\stopxcell
\startxcell

\stopxcell
\startxcell

\stopxcell
  \stopxrow
  \startxrow

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

\stopxcell
\startxcell

\stopxcell
\startxcell

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

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


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

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

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

> Hi,
> Sorry to come back with my match problem. In fact, I do not understand
> why a rotation of 90 influences the degraded color of the ends of the
> matches.
> Thank you.
> Fabrice
>
> \starttext
> \startMPcode
>
>   def match (expr alpha, pos) =
> numeric l;
> l = 4.6cm;
> picture pic;
> pic = image (
> fill unitsquare xscaled 4cm  yscaled 0.2cm  withcolor yellow ;
> fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) --
> cycle withcolor(.6yellow + black);
> draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
> -- (0.1cm,-0.05cm) -- cycle ;
> fill fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm) shaded
> withshademethod "circular"
> withshadefactor 0.75
> withshadecolors (white,red););
> draw (fullcircle xyscaled (0.5cm,0.44cm) shifted (4.125cm,0.1cm));
> draw pic rotated alpha shifted pos;
> enddef;
>
> picture house ;
> house = image (
> match(90,(0,0));
> match(0,(0,0));
> match(90,(l,0));
> match(120,(l,l));
> match(60,(0,l)););
>
> draw house;
>
> \stopMPcode
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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

\starttext
\startMPcode

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

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

draw house;

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

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


Re: [NTG-context] Shading

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


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


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

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

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

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


[NTG-context] Shading

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

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

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


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

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

\startMPcode

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

\stopMPcode


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

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

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


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

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

\stopMPcode



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

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

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


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

2020-02-14 Thread Fabrice Couvreur
i Henri,
Thank you for your answer. The idea is to make the graph as an attachment. I
converted to Metapost but the road is still long!
The code is from percusse on StackExchange. As you can see, there is a
problem with the ellipse. How do I fix this ?
Thank you
Fabrice

\usemodule[tikz]
\starttext
\startMPcode
  def match (expr pos) =
fill unitsquare xscaled 4cm  yscaled 0.2cm shifted pos withcolor yellow;
fill origin -- (4cm,0) -- (4.1cm,-0.05cm) --  (0.1cm,-0.05cm) -- cycle
 withcolor(.6yellow + black);
draw origin -- (0,0.2cm) -- (4cm,0.2cm) -- (4cm,0) -- (4.1cm,-0.05cm)
-- (0.1cm,-0.05cm) -- cycle;
fill fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm)
withcolor red;
draw fullcircle xscaled 0.25cm yscaled 0.22cm shifted (4.125cm,0.1cm)
 withshademethod "circular"
 withshadevector (0,1)
 withshadecolors (red,white)
  enddef;
  match((0,0));

\stopMPcode

\starttikzpicture
\define[2]\allumette{
\fill [yellow] (#1,#2) rectangle (#1+4,#2+0.2);
\fill [yellow!60!black] (#1,#2) -- ++(4,0)-- ++(0.1,-0.05) -- ++(-4,0)
-- ++(-0.1,0.05);
\draw (#1,#2) -- ++(0,0.2) -- ++(4,0) -- ++(0,-0.2) -- ++(0.1,-0.05) --
++(-4,0) -- ++(-0.1,0.05);
\shade[ball color=red] (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm);
\draw (#1+4,#2+0.1) ellipse (0.25cm and 0.22cm);
}
\allumette{0.1}{0.2}
\filldraw[orange,scale=0.5,shift={(8.2,1.2)}]  (0,0) .. controls
(-1.5,1.25) and (.5,2) .. (-.2,4) .. controls (1,2.5) and (1,.5) .. (0,0);
\stoptikzpicture
\stoptext

Le ven. 14 févr. 2020 à 02:49, Henri Menke  a écrit :

> On 2/14/20 10:45 AM, Fabrice Couvreur wrote:
> > Hi,
> > How to have the color defined by {yellow!60!black} with Metapost ?
>
> \usemodule[tikz]
> \starttext
> \startMPcode
> fill fullsquare scaled 1cm withcolor (.6yellow + black) ;
> \stopMPcode
>
> \starttikzpicture
> \fill[yellow!60!black] (0,0) rectangle (1,1);
> \stoptikzpicture
> \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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
> >
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Metapost and TikZ color code equivalent

2020-02-13 Thread Fabrice Couvreur
Hi,
How to have the color defined by {yellow!60!black} with Metapost ?
Thank you.
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] macro that does not work (Metapost)

2020-02-11 Thread Fabrice Couvreur
Hi Mikael,
Thanks.
Fabrice

Le mar. 11 févr. 2020 à 14:01, Mikael P. Sundqvist  a
écrit :

> On Tue, Feb 11, 2020 at 1:22 PM Fabrice Couvreur <
> fabrice1.couvr...@gmail.com> wrote:
>
>> Hi Hans,
>> I tried this but without success :
>>
>>  \startMPcode
>>  suite{1,0};
>>  suite{2,1};
>>  \stopMPcode
>>
>> Fabrice
>>
>> Le mar. 11 févr. 2020 à 13:08, Hans Hagen  a écrit :
>>
>>> On 2/11/2020 11:50 AM, Fabrice Couvreur wrote:
>>> > Hi,
>>> > I have some problems with the following macro :
>>> >
>>> > tex error   > mp error on line 23 in file /home/viserion/macro.tex:
>>> >
>>> > ! Missing argument to suite.
>>> > 
>>> > {
>>> > <*> suite{
>>> > 1,0}; suite(2,1); ;
>>> > That macro has more parameters than you thought.
>>> > I'll continue by pretending that each missing argument
>>> > is either zero or null.
>>> >
>>> > ! Missing argument to suite.
>>> > 
>>> > {
>>> > <*> suite{
>>> > 1,0}; suite(2,1); ;
>>> > That macro has more parameters than you thought.
>>> > I'll continue by pretending that each missing argument
>>> > is either zero or null.
>>>
>>>
>>> {} instead of ()
>>>
>>> > ! Extra tokens will be flushed.
>>> > 
>>> > {
>>> > <*> suite{
>>> > 1,0}; suite(2,1); ;
>>> > I've just read as much of that statement as I could fathom,
>>> > so a semicolon should have been next. It's very puzzling...
>>> > but I'll try to get myself back together, by ignoring
>>> > everything up to the next `;'. Please insert a semicolon
>>> > now in front of anything that you don't want me to delete.
>>> > (See Chapter 27 of The METAFONTbook for an example.)
>>> >
>>> > [1]
>>> >
>>> > 13   enddef;
>>> > 14 \stopMPcode
>>> > 15 \starttext
>>> > 16  On présente ci-dessous deux suites de dessins.
>>> > 17   \startlinecorrection[blank]
>>> > 18 \startmidaligned
>>> > 19   \startcombination[2*1]
>>> > 20 {\startMPcode
>>> > 21   suite{1,0};
>>> > 22   suite(2,1);
>>> > 23 >>   \stopMPcode}{\tfxx \bf Suite 2}
>>> > 24   \stopcombination
>>> > 25 \stopmidaligned
>>> > 26   \stoplinecorrection
>>> > 27 \stoptext
>>> >
>>> > mtx-context | fatal error: return code: 256
>>> >
>>> > TeX Output exited abnormally with code 1 at Tue Feb 11 11:45:53
>>> >
>>> > ##
>>> > macro.tex
>>> > ##
>>> >
>>> > \startMPcode
>>> >def suite (expr n, t) =
>>> >begingroup
>>> > numeric u;
>>> > u := 5mm;
>>> > pickup pencircle scaled 4pt;
>>> > for i=0 upto n:
>>> >   for j=0 upto n:
>>> >   drawdot (i*u,j*u) shifted(t*u,0) withcolor darkred;
>>> >   endfor
>>> > endfor
>>> >endgroup
>>> >enddef;
>>> > \stopMPcode
>>> > \starttext
>>> >   On présente ci-dessous deux suites de dessins.
>>> >\startlinecorrection[blank]
>>> >  \startmidaligned
>>> >\startcombination[2*1]
>>> >  {\startMPcode
>>> >suite{1,0};
>>> >suite(2,1);
>>> >   \stopMPcode}{\tfxx \bf Suite 2}
>>> >\stopcombination
>>> >  \stopmidaligned
>>> >\stoplinecorrection
>>> > \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 / h

Re: [NTG-context] macro that does not work (Metapost)

2020-02-11 Thread Fabrice Couvreur
Hi Hans,
I tried this but without success :

 \startMPcode
 suite{1,0};
 suite{2,1};
 \stopMPcode

Fabrice

Le mar. 11 févr. 2020 à 13:08, Hans Hagen  a écrit :

> On 2/11/2020 11:50 AM, Fabrice Couvreur wrote:
> > Hi,
> > I have some problems with the following macro :
> >
> > tex error   > mp error on line 23 in file /home/viserion/macro.tex:
> >
> > ! Missing argument to suite.
> > 
> > {
> > <*> suite{
> > 1,0}; suite(2,1); ;
> > That macro has more parameters than you thought.
> > I'll continue by pretending that each missing argument
> > is either zero or null.
> >
> > ! Missing argument to suite.
> > 
> > {
> > <*> suite{
> > 1,0}; suite(2,1); ;
> > That macro has more parameters than you thought.
> > I'll continue by pretending that each missing argument
> > is either zero or null.
>
>
> {} instead of ()
>
> > ! Extra tokens will be flushed.
> > 
> > {
> > <*> suite{
> > 1,0}; suite(2,1); ;
> > I've just read as much of that statement as I could fathom,
> > so a semicolon should have been next. It's very puzzling...
> > but I'll try to get myself back together, by ignoring
> > everything up to the next `;'. Please insert a semicolon
> > now in front of anything that you don't want me to delete.
> > (See Chapter 27 of The METAFONTbook for an example.)
> >
> > [1]
> >
> > 13   enddef;
> > 14 \stopMPcode
> > 15 \starttext
> > 16  On présente ci-dessous deux suites de dessins.
> > 17   \startlinecorrection[blank]
> > 18 \startmidaligned
> > 19   \startcombination[2*1]
> > 20 {\startMPcode
> > 21   suite{1,0};
> > 22   suite(2,1);
> > 23 >>   \stopMPcode}{\tfxx \bf Suite 2}
> > 24   \stopcombination
> > 25 \stopmidaligned
> > 26   \stoplinecorrection
> > 27 \stoptext
> >
> > mtx-context | fatal error: return code: 256
> >
> > TeX Output exited abnormally with code 1 at Tue Feb 11 11:45:53
> >
> > ##
> > macro.tex
> > ##
> >
> > \startMPcode
> >def suite (expr n, t) =
> >begingroup
> > numeric u;
> > u := 5mm;
> > pickup pencircle scaled 4pt;
> > for i=0 upto n:
> >   for j=0 upto n:
> >   drawdot (i*u,j*u) shifted(t*u,0) withcolor darkred;
> >   endfor
> > endfor
> >endgroup
> >enddef;
> > \stopMPcode
> > \starttext
> >   On présente ci-dessous deux suites de dessins.
> >\startlinecorrection[blank]
> >  \startmidaligned
> >\startcombination[2*1]
> >  {\startMPcode
> >suite{1,0};
> >suite(2,1);
> >   \stopMPcode}{\tfxx \bf Suite 2}
> >\stopcombination
> >  \stopmidaligned
> >\stoplinecorrection
> > \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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
> >
>
>
> --
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] macro that does not work (Metapost)

2020-02-11 Thread Fabrice Couvreur
Hi,
I have some problems with the following macro :

tex error   > mp error on line 23 in file /home/viserion/macro.tex:

! Missing argument to suite.

{
<*> suite{
1,0}; suite(2,1); ;
That macro has more parameters than you thought.
I'll continue by pretending that each missing argument
is either zero or null.

! Missing argument to suite.

{
<*> suite{
1,0}; suite(2,1); ;
That macro has more parameters than you thought.
I'll continue by pretending that each missing argument
is either zero or null.

! Extra tokens will be flushed.

{
<*> suite{
1,0}; suite(2,1); ;
I've just read as much of that statement as I could fathom,
so a semicolon should have been next. It's very puzzling...
but I'll try to get myself back together, by ignoring
everything up to the next `;'. Please insert a semicolon
now in front of anything that you don't want me to delete.
(See Chapter 27 of The METAFONTbook for an example.)

[1]

13   enddef;
14 \stopMPcode
15 \starttext
16  On présente ci-dessous deux suites de dessins.
17   \startlinecorrection[blank]
18 \startmidaligned
19   \startcombination[2*1]
20 {\startMPcode
21   suite{1,0};
22   suite(2,1);
23 >>   \stopMPcode}{\tfxx \bf Suite 2}
24   \stopcombination
25 \stopmidaligned
26   \stoplinecorrection
27 \stoptext

mtx-context | fatal error: return code: 256

TeX Output exited abnormally with code 1 at Tue Feb 11 11:45:53

##
macro.tex
##

\startMPcode
  def suite (expr n, t) =
  begingroup
   numeric u;
   u := 5mm;
   pickup pencircle scaled 4pt;
   for i=0 upto n:
 for j=0 upto n:
 drawdot (i*u,j*u) shifted(t*u,0) withcolor darkred;
 endfor
   endfor
  endgroup
  enddef;
\stopMPcode
\starttext
 On présente ci-dessous deux suites de dessins.
  \startlinecorrection[blank]
\startmidaligned
  \startcombination[2*1]
{\startMPcode
  suite{1,0};
  suite(2,1);
 \stopMPcode}{\tfxx \bf Suite 2}
  \stopcombination
\stopmidaligned
  \stoplinecorrection
\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] page break

2020-02-09 Thread Fabrice Couvreur
Hi,
Sorry if my minimal example is not, but I have to understand with your help
what is wrong. For example, why a page break after the second item when
there seems to be enough space to stay on this page ?
Thanks
Fabrice

\define\starttikzpicture
 {\hbox\bgroup\forcecolorhack\tikzpicture}

\define\stoptikzpicture
{\endtikzpicture\egroup}

\define[2]\CScript{\start\switchtobodyfont[xitsbidi]\m{{\mathscript{#1}}_{#2}}\stop}


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

  \unexpanded\def\R{\math{\mathbb{R}}\autoinsertnextspace}
  \unexpanded\def\intervalff#1#2{\math{\left[#1\nonscript\,;#2\right]}}
  \unexpanded\def\point#1#2#3{\math{#1\left(#2\,;#3\right)}}

  \switchtobodyfont[pagella,11pt]

 \definefloat
[recipe]
[figure]

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

  \setuppagenumbering
   [alternative=,
location=]

  \starttext

   \startitemize[n]
\startitem
   {\it Pour tout événement \m{E}, on note \m{\overline{E}}
l'évènement contraire de \m{E}.}
  \blank
  On considère l'arbre pondéré suivant :
  \startlinecorrection[blank]
\startmidaligned
   \starttikzpicture
[level 1/.style={level distance=40mm,sibling distance=25mm,very
thick},
 level 2/.style={level distance=35mm,sibling distance=20mm,very
thick}]
\node{}[grow=right]
  child {node{\m{\overline{R}}}
child{node{\m{\overline{S}}}edge from parent
node[below=2pt]{0,8}}
child{node{\m{S}}edge from parent node[above=2pt]{0,2}
} edge from parent node[below=2pt]{0,3}}
  child {node{\m{R}}
child{node{\m{\overline{S}}}edge from parent
node[below=2pt]{0,6}}
child{node{\m{S}}edge from parent node[above=2pt]{0,4}}
edge from parent node[above=2pt]{0,7}};
  \stoptikzpicture
\stopmidaligned
  \stoplinecorrection
  {\bi Affirmation 1 : }  La probabilité de \m{\overline{R}}
sachant \m{S} est 0,06.
\stopitem
\blank
\startitem
 Soit \m{f} une fonction dérivable sur l'intervalle
\intervalff{0}{15}. On suppose que sa fonction dérivée, notée \m{f'}, est
continue sur \intervalff{0}{15}. Les variations de \m{f'} sont représentées
dans le tableau ci-dessous.
  \startlinecorrection[blank]
\startmidaligned
  \externalfigure[tab_bacblanc.pdf]
\stopmidaligned
  \stoplinecorrection
  {\bi Affirmation 2 :}  La courbe représentative \CScript{C}{f} de
la fonction \m{f} admet une et une seule tangente parallèle à l'axe des
abscisses.
\stopitem
 \placerecipe{}{
   \hbox{
   \starttikzpicture
 [extended line/.style={shorten >=-#1,shorten <=-#1},
 scale=1, every node/.style={scale=0.8},
 /pgf/declare function={f(\x)=\x^2 +1 - \x^3;},
 /pgf/declare function={g(\x)=-5*\x - 2;}]
   \startaxis
[restrict x to domain=-2:3, xmax=3, xmin=-2,
 restrict y to domain=-3:4, ymax=4, ymin=-3,
 x=0.8cm,
 y=0.8cm,
 axis x line=middle,
 axis y line=middle,
 major tick style=black,
 axis line style = ultra thick,
 tick align=outside,
 tickwidth=0.14cm,
 tick style=thick,
 grid=both,
 xtick={-1,...,2},
 ytick={-2,...,3},
 extra x ticks={-2,3},
 extra x tick label={\null},
 extra y ticks={-3,4},
 extra y tick label={\null},
 extra tick style={tick style={draw=none}},
 xlabel=$x$,ylabel=$y$,
 every axis x label/.style={
 at={(ticklabel* cs:1.01)},anchor=west},
 every axis y label/.style={
 at={(ticklabel* cs:1.01)}, anchor=south},
 samples=2000,
 axis on top=false,
 >=stealth]


 \addplot [very thick,domain=-1.25:2] {g(x)};
 \addplot [darkred,very thick,domain=-1.25:2] {f(x)};

 \node[below left=1pt] at (0,0){\m{0}};
 \node[above right] at (-1,{f(-1)}) {\m{A}};
 \node[above right] at (0,{g(0)}) {\m{B}};
 \node[above right] at (1.2,0.5){\CScript{C}{h}};
 \node[left] at (-0.5,0.5){\m{T}};
 \node[fill=black,circle,scale=0.5] at (-1,{f(-1)}){};
 \node[fill=black,circle,scale=0.5] at (0,{g(0)}){};

   \stopaxis
   \stoptikzpicture
}
  }
 \startitem
 La courbe \CScript{C}{h} représentative d'une fonction \m{h}
définie et dérivable sur \R est représentée ci-contre.
  On a tracé la tangente \m{T} à \CScript{C}{h} au point
\point{A}{-1}{3}.

  \m{T} passe par le point \point{B}{0}{-2}.
  \blank
  {\bi Affirmation 3 : } le nombre 

[NTG-context] Side effects with \startformula \stopformula

2020-02-09 Thread Fabrice Couvreur
Hi,
I composed a large document and I often use \ startformula \ stopformula.
I have the impression that this creates untimely page breaks or white
spaces.
Fabrice
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] A question about whatever (Metapost)

2020-01-25 Thread Fabrice Couvreur
Hi,
The point M is such that the line (CM) is perpendicular to the line (NP).
I do not understand the error of this code.
Thank you
Fabrice

\usecolors[xwi]
\starttext
\startMPcode
  path carre, p;
  carre = unitsquare scaled 138;

  pair a, b, c, d, N, P, M;
  a = point 0 of carre;
  b = point 1 of carre;
  c = point 2 of carre;
  d = point 3 of carre;

  p = b -- d;
  N = whatever[a,d];
  P = whatever[a,b];
  M = whatever[b,d];
 (M - c) dotprod (P - N) = 0;

  draw M -- c;

  draw p  withcolor \MPcolor{navy};
  draw carre withcolor \MPcolor{firebrick};

  label.lft("$A$", point 0 of carre);
  label.lrt("$B$", point 1 of carre);
  label.urt("$C$", point 2 of carre);
  label.ulft("$D$", point 3 of carre);
\stopMPcode
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Eofill extension (Metafun)

2019-12-09 Thread Fabrice Couvreur
Hello,
Thank you for these explanations.
Fabrice

Le lun. 9 déc. 2019 à 03:21, Henri Menke  a écrit :

> On 12/9/19 10:02 AM, Fabrice Couvreur wrote:
> > Hello,
> > Is it possible to use the eofill extension in this code ? I tried without
> > success. Thank you.
>
> No, eofill is basically just a frontend for the PDF primitive eofill,
> which works on a single connected path that intersects itself.
>
> If that wasn't enough, the numberstriped instruction does not return a
> path but a picture and pictures are immutable.
>
> > Fabrice
> >
> > \starttext
> > \startMPcode
> > path carre, disque;
> >
> > carre = fullsquare scaled 200;
> > disque = fullcircle scaled 200;
> >
> > draw carre numberstriped (.25,15,5) withcolor \MPcolor{magenta};
> > fill disque withcolor white;
> >
> > draw carre  withcolor \MPcolor{orange};
> > draw disque  withcolor \MPcolor{orange};
> >
> > path a[];
> > a1 = origin -- point 3.5 of carre;
> >
> > interim ahangle := 30;
> > drawdblarrow a1 withpen pencircle scaled 1.5pt withcolor darkred;
> > label.top("$R$", point 1/2 of a1);
> > \stopMPcode
> > \stoptext
> >
> >
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
> >
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Eofill extension (Metafun)

2019-12-08 Thread Fabrice Couvreur
Hello,
Is it possible to use the eofill extension in this code ? I tried without
success. Thank you.
Fabrice

\starttext
\startMPcode
   path carre, disque;

   carre = fullsquare scaled 200;
   disque = fullcircle scaled 200;

   draw carre numberstriped (.25,15,5) withcolor \MPcolor{magenta};
   fill disque withcolor white;

   draw carre  withcolor \MPcolor{orange};
   draw disque  withcolor \MPcolor{orange};

   path a[];
   a1 = origin -- point 3.5 of carre;

   interim ahangle := 30;
   drawdblarrow a1 withpen pencircle scaled 1.5pt withcolor darkred;
   label.top("$R$", point 1/2 of a1);
\stopMPcode
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Transparency (Metapost)

2019-12-01 Thread Fabrice Couvreur
Hi Hans,
I updated lmtx, but your code does not compile except that the output is a
pdf file where it is written ERROR.
Fabrice

tex error   > tex error on line 1 in file ./blond.tex: ?


\font_helpers_low_level_define ...\scaledfontmode
  \relax \ifcase
\scaledfont...
\font_helpers_trigger_define ..._identifier_class
  \csname
\v_font_identifier...
\applyfontclassstrategies ...to_size \lastnamedcs
  \else \expandafter
\font_h...
\font_helpers_synchronize_font ...classstrategies
  \fi \setfalse
\c_font_auto...
\rm ->\ifmmode \mathrm \else \normalrm
   \fi
\font_basics_switch_style ...dcsname \lastnamedcs
  \edef \fontstyle
{#1}\ifmm...
...
l.1 \starttext


 1 >>  \starttext
 2
 3 \startMPcode
 4 defaultfont  := "texgyrepagella-regular*default" ;
 5 defaultscale := 0.8 ;
 6
 7 definecolor [ name = "mp:red",   b = 1 ] ;
 8 definecolor [ name = "mp:green", y = 1 ] ;
 9
10 path twos, threes ;
11 twos   := fullcircle xscaled 4cm yscaled 2cm rotated 180 shifted
42

mtx-context | fatal error: return code: 256

Le dim. 1 déc. 2019 à 13:09, Hans Hagen  a écrit :

> On 12/1/2019 11:32 AM, Fabrice Couvreur wrote:
> > Hello
> > Thank you for your suggestion. However, it works with context and not
> > with lmtx.
> > Fabrice
> >
> > \starttext
> > \startMPcode
> > defaultfont := "texgyrepagella-regular*default" ;
> > defaultscale :=0.8;
> >
> > color brown;
> > brown = (0.128,0.00,0.00);
> >
> > path twos, threes, sixes;
> > twos = fullcircle xscaled 4cm yscaled 2cm rotated 180
> >shifted 42 left;
> > threes = fullcircle xscaled 4cm yscaled 2cm shifted 42 right;
> > sixes = buildcycle(twos, threes);
> >
> > fill twos   withcolor brown withtransparency(1,0.75);
> > fill threes withcolor yellow withtransparency(1,0.75);
> > fill sixes withcolor yellow + brown withtransparency(1,0.75);
> >
> > draw twos;
> > draw threes;
> >
> > label("...",(1.5cm,0));
> > label("...",(0,0));
> > label("...",(-1.5cm,0));
> > label.top("yeux marron",(-1.5cm,1.25cm));
> > label.top("cheveux blonds",(1.5cm,1.25cm));
> > \stopMPcode
> > \stoptext
> >
> > tex error   > tex error on line 1 in file ./blond.tex: ?
> Looks ok here ... but isn't the transparacy used instead of the sizes?
> Anyway, you can use named colors
>
> \starttext
>
> \startMPcode
> defaultfont  := "texgyrepagella-regular*default" ;
> defaultscale := 0.8 ;
>
> definecolor [ name = "mp:red",   b = 1 ] ;
> definecolor [ name = "mp:green", y = 1 ] ;
>
> path twos, threes ;
> twos   := fullcircle xscaled 4cm yscaled 2cm rotated 180 shifted 42
> left ;
> threes := fullcircle xscaled 4cm yscaled 2cm shifted 42
> right ;
>
> fill twos   withcolor "mp:red"   withtransparency(1,0.5) ;
> fill threes withcolor "mp:green" withtransparency(1,0.5) ;
>
> draw twos ;
> draw threes ;
>
> label("...",( 1.5cm,0));
> label("...",( 0,0));
> label("...",(-1.5cm,0));
> label.top("\strut yeux marron",   (-1.5cm,1.25cm));
> label.top("\strut cheveux blonds",( 1.5cm,1.25cm));
> \stopMPcode
>
> \stoptext
>
> (you cannot overload colors at the tex level in mp but use them in order
> to be consistent)
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Transparency (Metapost)

2019-12-01 Thread Fabrice Couvreur
Hello
Thank you for your suggestion. However, it works with context and not with
lmtx.
Fabrice

\starttext
\startMPcode
   defaultfont := "texgyrepagella-regular*default" ;
   defaultscale :=0.8;

   color brown;
   brown = (0.128,0.00,0.00);

   path twos, threes, sixes;
   twos = fullcircle xscaled 4cm yscaled 2cm rotated 180
  shifted 42 left;
   threes = fullcircle xscaled 4cm yscaled 2cm shifted 42 right;
   sixes = buildcycle(twos, threes);

   fill twos   withcolor brown withtransparency(1,0.75);
   fill threes withcolor yellow withtransparency(1,0.75);
   fill sixes withcolor yellow + brown withtransparency(1,0.75);

   draw twos;
   draw threes;

   label("...",(1.5cm,0));
   label("...",(0,0));
   label("...",(-1.5cm,0));
   label.top("yeux marron",(-1.5cm,1.25cm));
   label.top("cheveux blonds",(1.5cm,1.25cm));
\stopMPcode
\stoptext

tex error   > tex error on line 1 in file ./blond.tex: ?


\font_helpers_low_level_define ...\scaledfontmode
  \relax \ifcase
\scaledfont...
\font_helpers_trigger_define ..._identifier_class
  \csname
\v_font_identifier...
\applyfontclassstrategies ...to_size \lastnamedcs
  \else \expandafter
\font_h...
\font_helpers_synchronize_font ...classstrategies
  \fi \setfalse
\c_font_auto...
\rm ->\ifmmode \mathrm \else \normalrm
   \fi
\font_basics_switch_style ...dcsname \lastnamedcs
  \edef \fontstyle
{#1}\ifmm...
...
l.1 \starttext


 1 >>  \starttext
 2 \startMPcode
 3defaultfont := "texgyrepagella-regular*default" ;
 4defaultscale :=0.8;
 5
 6color brown;
 7brown = (0.128,0.00,0.00);
 8
 9path twos, threes, sixes;
10twos = fullcircle xscaled 4cm yscaled 2cm rotated 180
11   shifted 42 left;

mtx-context | fatal error: return code: 256


Le dim. 1 déc. 2019 à 00:34, Jeong Dal  a écrit :

> \
>
>
> Dear Fabrice,
>
> I got color and transparency using the following command in LMTX(metafun).
>
> fill p withcolor yellow withtransparency(1, .75);
>
> I hope that it helps.
>
> Best regards,
>
> Dalyoung
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Transparency (Metapost)

2019-11-30 Thread Fabrice Couvreur
Hello,
I have a little trouble with the management of transparency : the colors
are not respected.
Thank you.
Fabrice

\starttext
\startMPcode
   defaultfont := "texgyrepagella-regular*default" ;
   defaultscale :=0.8;

   color brown;
   brown = (0.165,0.42,0.42);

   path twos, threes;
   twos = fullcircle xscaled 4cm yscaled 2cm rotated 180
  shifted 42 left;
   threes = fullcircle xscaled 4cm yscaled 2cm shifted 42 right;

   fill twos   withcolor transparent(1,0.4,brown);
   fill threes withcolor transparent(1,0.4,yellow);

   draw twos;
   draw threes;

   label("...",(1.5cm,0));
   label("...",(0,0));
   label("...",(-1.5cm,0));
   label.top("yeux marron",(-1.5cm,1.25cm));
   label.top("cheveux blonds",(1.5cm,1.25cm));
\stopMPcode
\stoptext

[image: blond.jpg]
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Text and tree side by side in a framedtext environment

2019-11-19 Thread Fabrice Couvreur
Hello,
Thank you for all your suggestions, but it does not work : it may have come
from the TiKz environment.
Fabrice

Le lun. 18 nov. 2019 à 16:14, Henning Hraban Ramm  a écrit :

> Salut,
>
> do maybe combinations fit your needs?
>
> https://wiki.contextgarden.net/Combinations
>
> Best, Hraban
>
> > Am 2019-11-17 um 11:01 schrieb Fabrice Couvreur <
> fabrice1.couvr...@gmail.com>:
> >
> > Hello,
> > I am looking but without success !
> > I tried \ starthanging [location = right] {tree} \ stophanging but that
> does not work either.
> > Fabrice
> >
> > Le sam. 16 nov. 2019 à 12:44, Fabrice Couvreur <
> fabrice1.couvr...@gmail.com> a écrit :
> > Hello,
> > I want to use a text frame to put text and a probability tree side by
> side, but it does not work.
> > Thanks for your help.
> > Fabrice
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Text and tree side by side in a framedtext environment

2019-11-17 Thread Fabrice Couvreur
Hello,
I am looking but without success !
I tried \ starthanging [location = right] {tree} \ stophanging but that
does not work either.
Fabrice

Le sam. 16 nov. 2019 à 12:44, Fabrice Couvreur 
a écrit :

> Hello,
> I want to use a text frame to put text and a probability tree side by
> side, but it does not work.
> Thanks for your help.
> Fabrice
>
> \usemodule[tikz]
> \usetikzlibrary[trees]
>
> \definefloat
> [recipe]
> [figure]
>
>   \setupfloat
> [recipe]
> [default={right,nonumber}]
> \starttext
> \startframedtext[width=\textwidth]
>   \placerecipe{}{
> \hbox{
>   \starttikzpicture
> [level 1/.style={level distance=20mm,sibling distance=15mm},
>  level 2/.style={level distance=20mm,sibling distance=10mm}]
> \node{}[grow=right]
>   child {node{\tfxx Réglisse}
> child{node{\tfxx Réglisse}edge from parent
> node[below=2pt]{\dots}}
> child{node{\tfxx Fraise}edge from parent
> node[above=2pt]{\dots}
> } edge from parent node[below=2pt]{\dots}}
>   child {node{\tfxx Fraise}
> child{node{\tfxx Réglisse}edge from parent
> node[below=2pt]{\dots}}
> child{node{\tfxx Fraise}edge from parent
> node[above=2pt]{\dots}} edge from parent node[above=2pt]{\dots}};
>   \stoptikzpicture
> }
>   }
>   \dorecurse{2}{\input knuth}
> \stopframedtext
> \blank
>   \placerecipe{}{
> \hbox{
>   \starttikzpicture
> [level 1/.style={level distance=20mm,sibling distance=15mm},
>  level 2/.style={level distance=20mm,sibling distance=10mm}]
> \node{}[grow=right]
>   child {node{\tfxx Réglisse}
> child{node{\tfxx Réglisse}edge from parent
> node[below=2pt]{\dots}}
> child{node{\tfxx Fraise}edge from parent
> node[above=2pt]{\dots}
> } edge from parent node[below=2pt]{\dots}}
>   child {node{\tfxx Fraise}
> child{node{\tfxx Réglisse}edge from parent
> node[below=2pt]{\dots}}
> child{node{\tfxx Fraise}edge from parent
> node[above=2pt]{\dots}} edge from parent node[above=2pt]{\dots}};
>   \stoptikzpicture
> }
>   }
>   \dorecurse{2}{\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Text and tree side by side in a framedtext environment

2019-11-16 Thread Fabrice Couvreur
Hello,
I want to use a text frame to put text and a probability tree side by side,
but it does not work.
Thanks for your help.
Fabrice

\usemodule[tikz]
\usetikzlibrary[trees]

\definefloat
[recipe]
[figure]

  \setupfloat
[recipe]
[default={right,nonumber}]
\starttext
\startframedtext[width=\textwidth]
  \placerecipe{}{
\hbox{
  \starttikzpicture
[level 1/.style={level distance=20mm,sibling distance=15mm},
 level 2/.style={level distance=20mm,sibling distance=10mm}]
\node{}[grow=right]
  child {node{\tfxx Réglisse}
child{node{\tfxx Réglisse}edge from parent
node[below=2pt]{\dots}}
child{node{\tfxx Fraise}edge from parent
node[above=2pt]{\dots}
} edge from parent node[below=2pt]{\dots}}
  child {node{\tfxx Fraise}
child{node{\tfxx Réglisse}edge from parent
node[below=2pt]{\dots}}
child{node{\tfxx Fraise}edge from parent
node[above=2pt]{\dots}} edge from parent node[above=2pt]{\dots}};
  \stoptikzpicture
}
  }
  \dorecurse{2}{\input knuth}
\stopframedtext
\blank
  \placerecipe{}{
\hbox{
  \starttikzpicture
[level 1/.style={level distance=20mm,sibling distance=15mm},
 level 2/.style={level distance=20mm,sibling distance=10mm}]
\node{}[grow=right]
  child {node{\tfxx Réglisse}
child{node{\tfxx Réglisse}edge from parent
node[below=2pt]{\dots}}
child{node{\tfxx Fraise}edge from parent
node[above=2pt]{\dots}
} edge from parent node[below=2pt]{\dots}}
  child {node{\tfxx Fraise}
child{node{\tfxx Réglisse}edge from parent
node[below=2pt]{\dots}}
child{node{\tfxx Fraise}edge from parent
node[above=2pt]{\dots}} edge from parent node[above=2pt]{\dots}};
  \stoptikzpicture
}
  }
  \dorecurse{2}{\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Number format with lua

2019-11-09 Thread Fabrice Couvreur
Hi Hans,
In fact, I was talking about functions that seemed to me "complicated" for
what I wanted to do.
Fabrice

Le sam. 9 nov. 2019 à 14:43, Hans Hagen  a écrit :

> On 11/9/2019 11:42 AM, Fabrice Couvreur wrote:
> > Hi,
> > Thank you for your suggestions, the problem is solved. I searched, but
> > the solutions seemed too complex. Is it specific to Context with Lua. If
> > so, which document should you read ?
>
> how do you mean complex ... anyway, if you refer to %g, one problem can
> be that the E notation kicks in
>
> Hans
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


  1   2   3   4   5   6   7   >