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] Label in externalfigures

2020-02-14 Thread Jan-Erik Hägglöf
Now finally after consulting the luametafun and the MetaFun manual I’ve found what I was looking for:The code:\startMPcode picture p; p := lmt_svg [ filename = "steguppgift.svg", width = 400 ] ;draw p;path linje ; linje := (15,-330) -- (280,-90); % adding a missing line in the .svg filedrawarrow linje withcolor black ;draw thelabel("37°",(160,-330));draw thelabel("$5,0$m",(150,-160));\stopMPcodeThis was a fun learning experience so thanks again13 feb. 2020 kl. 10:35 skrev Jan-Erik Hägglöf <janerik.hagg...@bahnhof.se>:I’ve tested this but it appears outside, not as an layer over the picture.\startMPcode draw lmt_svg [	filename = "steguppgift.svg",	height = 5cm,	width = 10cm,	] ;label(\sometxt{5,0m},(63.936298,129.563995));label(\sometxt{37°},(95.652702,27.367201));	\stopMPcodeThanks /Janne12 feb. 2020 kl. 20:10 skrev Hans Hagen <j.ha...@xs4all.nl>:On 2/12/2020 6:01 PM, Jan-Erik Hägglöf wrote:The expected output should be like this, see example in the link belowhttps://drive.google.com/file/d/13pCuUvNeL7T_Hs7-qrKZclkadcJ7_jVV/view?usp=sharingSo that I have a picture so I can change the label text inside according to different needs e.g change from 37° to 41° without reediting it in Inkscape.A similar properties like latex export picture.pdf_tex which is a function in InkscapeI investigate the details manual tip you provided, thanks a lot.you might want to peek into the luametafun manual as svg is discussed there, including label stuffwhat you can also try (with lmtx) is this (no real interface yet):\starttext\hbox\bgroup  \ctxlua{metapost.startsvghashing()}%  \includesvgfile[labels-004.svg]%  \ctxlua{metapost.stopsvghashing()}%\egroup\stoptextwhich should turn your labels into tex, so you can typeset them as tex (so $\\sin(x)$ comes out as math) it's no big deal to add a remap option there but then i'd rather go for symbolic namesHans-  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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/wiki : http://contextgarden.net__
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2020-02-14 Thread Fabrice L
Hi,

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

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

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

See metafun manual, section 1.13.

> Thank you.
> Fabrice

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

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

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


Re: [NTG-context] ConTeXt support for Atom or other text editors

2020-01-21 Thread Hans Hagen

On 1/21/2020 3:20 PM, Nicola wrote:

On 2020-01-21, Sébastien Wilmet  wrote:


I'm actually looking for a text editor on Linux that supports those
three features:
- syntax highlighting
- command completion
- spell-checking

Does it exist?


Well, Vim has pretty solid support for ConTeXt (disclaimer: I am
maintaining the ConTeXt plugin distributed with Vim), including the
features you mention and much more:

 https://wiki.contextgarden.net/Vim

But if you have never used Vim, it has a steeper learning curve that
a typical text editor.

On a side note: a difficulty with maintaining syntax highlighting for
ConTeXt is that I had to write my own script to extract ConTeXt-specific
and MetaFun-specific keywords from source code. Is there any way to do
it with ConTeXt?
there are ways to extract it from the interface specifications ... which 
is done for scite, vscode, ...


(btw, in scite/textadept there is support for syntax support, real time 
spell checking, nested lexing, etc)


Hans


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

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


Re: [NTG-context] ConTeXt support for Atom or other text editors

2020-01-21 Thread Nicola
On 2020-01-21, Sébastien Wilmet  wrote:

> I'm actually looking for a text editor on Linux that supports those
> three features:
> - syntax highlighting
> - command completion
> - spell-checking
>
> Does it exist?

Well, Vim has pretty solid support for ConTeXt (disclaimer: I am
maintaining the ConTeXt plugin distributed with Vim), including the
features you mention and much more:

https://wiki.contextgarden.net/Vim

But if you have never used Vim, it has a steeper learning curve that
a typical text editor.

On a side note: a difficulty with maintaining syntax highlighting for
ConTeXt is that I had to write my own script to extract ConTeXt-specific
and MetaFun-specific keywords from source code. Is there any way to do
it with ConTeXt?

Nicola


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Quotation dash issues with semantic markup

2019-12-30 Thread Hans Hagen

On 12/30/2019 5:03 AM, Sam May wrote:


\setuplanguage[en]
[leftquotation=\quotedash~,
rightquotation=~\quotedash,
leftsentence=\removeunwantedspaces~\endash\space,
midsentence=\removeunwantedspaces~\endash\space,
%   leftsentence=\endash~,
%   midsentence=~\endash,
rightsentence=~\endash]
\define\quotedash{\emdash\endash}

%\setupbackend[export=yes]

\starttext

\startsection[title=Introduction]
Any of you able to help me get my quotation dashes into line when 
automatically
inserted by the semantic commands?  I'm sure a number of you look at 
this style
and cringe, but \cap{A.} I'm not looking for grammatical input, and 
\cap{B.}
I'm intending this for a non-English language where the quotation dash 
(though

still not most common) isn't as out of place.
\stopsection

\startsection[title=Desired rendering]
\quotedash~Speech should always have a dash at the start, but none at 
the end

of a paragraph.

\quotedash~Dialog asides should not duplicate dashes,~\endash\ he
said.~\quotedash\ Also, this doesn't reflect the spacing mentioned in 
section

\in[extra].  \quotedash~nor, as above, add ones at the end of paragraphs.
\endash~he continued.
\stopsection

\startsection[title=Actual output]
\speech{Speech should always have a dash at the start, but none at the 
end of a

paragraph.}

\speech{Dialog asides should not duplicate dashes, \aside{he said.}} 
Also, note

the spacing isn't removed despite \type{\removeunwantedspaces}, but instead
duplicated.  \speech{nor, as above, add ones at the end of paragraphs.
\aside{he continued.}}
\stopsection

\startsection[title=Additional considerations and 
observations,reference=extra]
It would also be nice if a quote ending in a period carried the 
\quote{broad}

spacing to the other side of the (ending) quote dash |=| the dash before
\quote{Also} above would be packed on the left and broad on the right. 
I know

this might be a lot trickier to code, and only consider it a bonus.

The issue with \type{\removeunwantedspaces} only seems to affect the 
command
forms.  When inserted directly |<| as here |>| the spacing acts as 
desired in
the \cap{PDF} (as expected, the \cap{XML} doesn't understand the order). 
 Also,

the right \type{|>|} doesn't require either of the explicit spacing
instructions (beyond being non-breaking) while the others do; try 
switching the

commented lines and re-rendering.

The quotation dash itself only \emph{looks} as I want it; when I 
highlight and
copy the text or export it to the \cap{XML} backend, it's still two 
dashes next

to each other.  Instead, I'd like it to be the Unicode bar U+2015.  I'm not
sure if \TEX/\LUATEX\ allows that difference between appearance and 
interaction
(I do know \cap{PDF} does), so if there's some way of adding a new glyph 
to the
font |<| one that mimics the other dashes even if the font changes |>| 
I'd love
to actually use the proper codepoint.  As is, that doesn't work in the 
standard

font(s): [\char"2015].
\stopsection

\stoptext

I bet that Wolfgang has the answers to the speech setup so I'll do the 
font part. Assuming that you use context lmtx (the luametatex branch), 
you can use some of the new metafun magic.


\startMPcalculation{simplefun}

vardef QuotationDash =
draw image (
interim linecap := squared ;
save l ; l := 0.2 ;
draw (l/2,2) -- (15-l/2,2) withpen pencircle scaled l ;
)
enddef ;

lmt_registerglyphs [
name = "symbols",
units= 10,
usecolor = true,
width= 15,
height   = 2.1,
depth= 0,
] ;

lmt_registerglyph [ category = "symbols", unicode = "0x2015", code 
= "QuotationDash ;" ] ;


\stopMPcalculation

\definefontfeature[default][default][metapost=symbols]

% \showglyphs

\starttext

\startlines
xx\endashxx
xx\emdashxx
xx\endash\emdash xx
xx\char"2015 xx
\stoplines

\stoptext

Keep in mind that when you use for instance pagella, that there already 
that glyph.


Hans


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

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


Re: [NTG-context] How to use in Metafun, a function defined in Lua

2019-12-28 Thread Hans Hagen

On 12/28/2019 4:22 PM, Otared Kavian wrote:

Hi all,

I would like to use a math function defined in lua in Metafun in order to draw 
its graph, together with the graphs of some other functions.
As a simple example consider the following:

%%% begin lua-metafun-example.tex
\startluacode
function document.myfunction(n,x)
local S
S = math.sin(n*x)
return S
end
\stopluacode

\starttext

Here \type{document.myfunction(n,x)} is $\sin(nx)$. For instance when $n = 2$ 
and $x = 355/113$ we have:

\type{document.myfunction(2,355/113)} 
$=\cldcontext{document.myfunction(2,355/113)} \sim 0$.

\startplacefigure[title={Nothing works\dots}]
\startMPcode{GridAxis}
numeric gu ; gu = 5mm ; % gu = graph unit
draw image (
draw function (1,"x","document.myfunction(2,x)", % <-- this does not 
work
%   draw function (1,"x","sin(2*x)", % <-- this works
-355/113,355/113,.01)
scaled gu
withpen pencircle scaled .075pt
withcolor darkred ;
) xsized .7TextWidth ;
\stopMPcode
\stopplacefigure

\stoptext
%%% end lua-metafun-example.tex

Here one sees that the function « document.myfunction » is well defined in Lua 
and is known in ConTeXt, but I cannot use it in a Metapost code: how can one do 
that?

you confuse lua and mp functions

\startluacode
function MP.myfunction(n,x)
return math.sin(n*x)
end
\stopluacode

\starttext

\startMPcode
numeric gu ; gu = 5mm ;
vardef myfunction(expr n, x) = MP.myfunction(n,x) enddef ;
draw image (
draw function (1,"x","myfunction(2,x)",-355/113,355/113,.01)
scaled gu
withpen pencircle scaled .075pt
withcolor darkred ;
) xsized .7TextWidth ;
\stopMPcode

\stoptext



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

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


[NTG-context] How to use in Metafun, a function defined in Lua

2019-12-28 Thread Otared Kavian
Hi all,

I would like to use a math function defined in lua in Metafun in order to draw 
its graph, together with the graphs of some other functions.
As a simple example consider the following:

%%% begin lua-metafun-example.tex
\startluacode 
function document.myfunction(n,x)
local S
S = math.sin(n*x)
return S
end
\stopluacode

\starttext

Here \type{document.myfunction(n,x)} is $\sin(nx)$. For instance when $n = 2$ 
and $x = 355/113$ we have:

\type{document.myfunction(2,355/113)} 
$=\cldcontext{document.myfunction(2,355/113)} \sim 0$.

\startplacefigure[title={Nothing works\dots}]
\startMPcode{GridAxis}
numeric gu ; gu = 5mm ; % gu = graph unit
draw image (
draw function (1,"x","document.myfunction(2,x)", % <-- this does not 
work
%   draw function (1,"x","sin(2*x)", % <-- this works
-355/113,355/113,.01)
scaled gu 
withpen pencircle scaled .075pt
withcolor darkred ;
) xsized .7TextWidth ;
\stopMPcode
\stopplacefigure

\stoptext
%%% end lua-metafun-example.tex

Here one sees that the function « document.myfunction » is well defined in Lua 
and is known in ConTeXt, but I cannot use it in a Metapost code: how can one do 
that?

Thanks in advance for any help.
Best regards: Otared
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Using lmtx and new metafun

2019-12-12 Thread Otared Kavian
Hi Aditya,

Following your explanations in
https://adityam.github.io/context-blog/post/new-metafun-interface/
I wrote an environment in order to display the graph of a function on a grid 
which can be adapted to each case.

Assuming that I have an MPinstance named GridAxis (for example) which can 
dispaly a grid and axes, how can I call it and write a line such as
draw function (1,"x","x*x/4 - 2.5",xmin,xmax,.001) scaled sx  ;
without changing the part whichh is included in \startMPdefinitions, in oder to 
draw the above function on that grid ? 

Thanks for your help: Otared
PS: Here is my definition of GridAxis (I guess many parts of it could be better 
written…)

\defineMPinstance[GridAxis]  
[
        format=metafun,
extensions=yes,
initializations=yes,
method=double,
]

\startMPdefinitions{GridAxis}

def GridAxisPlot = applyparameters "GridAxisPlot" "do_GridAxisPlot" enddef ;

presetparameters "GridAxisPlot" [
xmin = -2.5,  xmax = 2.5,
ymin = -2.5,  ymax = 2.5,

dx   = 1, dy   = 1,
sx   = 5mm,   sy   = 5mm,
scale = 0.5,

grid = true,
xaxisnumbers = true,
yaxisnumbers = true,
showmyorigin = true,

style = "\switchtobodyfont[8pt]",
];

vardef do_GridAxisPlot =
image (
pushparameters "GridAxisPlot";

newnumeric xmin, xmax, ymin, ymax;
xmin := getparameter "xmin";
xmax := getparameter "xmax";
ymin := getparameter "ymin";
ymax := getparameter "ymax";

newnumeric sx, sy;
sx := getparameter "sx";
sy := getparameter "sy";

newnumeric dx, dy;
dx := getparameter "dx";
dy := getparameter "dy";

newpath xaxis, yaxis;

xaxis := (xmin*sx, 0) -- (xmax*sx, 0)  ;
yaxis := (0, ymin*sy) --  (0, ymax*sy) ;

newpath xtick, ytick;
xtick := (-0.1sx, 0) -- (0.1sx, 0);
ytick := (0, -0.1sy) -- (0, 0.1sy);

newstring style;
style := getparameter "style";

pickup pencircle scaled .1mm ;
newboolean grid;
grid  := getparameter "grid";

newboolean xaxisnumbers ;
xaxisnumbers := getparameter "xaxisnumbers" ;

newboolean yaxisnumbers ;
yaxisnumbers := getparameter "yaxisnumbers" ;

for x = dx step dx until xmax :
if grid :
draw yaxis shifted (x*sx, 0) withcolor 0.75white ;
fi
draw ytick shifted (x*sx, 0);
if xaxisnumbers :
label.bot(style & decimal x, (x*sx, 0));
fi
endfor

newboolean showmyorigin ;
showmyorigin := getparameter "showmyorigin" ;

if showmyorigin :
label.lrt(style & "0", origin) ;
fi

for x = -dx step -dx until xmin :
if grid :
draw yaxis shifted (x*sx, 0) withcolor 0.75white;
fi
draw ytick shifted (x*sx, 0);
if xaxisnumbers :
label.bot(style & decimal x, (x*sx, 0));
fi
endfor

for y = dy step dy until ymax :
if grid :
draw xaxis shifted (0, y*sy) withcolor 0.75white;
fi
draw xtick shifted (0, y*sy);
if yaxisnumbers :
label.lft(style & decimal y, (0, y*sy));
fi
endfor

for y = -dy step -dy until ymin :
if grid :
draw xaxis shifted (0, y*sy) withcolor 0.75white;
fi
draw xtick shifted (0, y*sy);
if yaxisnumbers :
label.lft(style & decimal y, (0, y*sy));
fi
endfor


drawarrow xaxis;
drawarrow yaxis;

label.rt( style & "$x$",  (xmax*sx, 0));
label.top(style & "$y$", (0, ymax*sy));

newpair p ;

newnumeric scale;
scale := getparameter "scale" ;

popparameters;

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


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

2019-12-08 Thread Henri Menke

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
___


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


Re: [NTG-context] Transparency (Metapost)

2019-11-30 Thread Jeong Dal
> \

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
___


[NTG-context] new beta

2019-10-11 Thread Hans Hagen

Hi,

I uploaded a new beta. Some might have noticed that stepwise some font 
support has been redone. We're talking of lmtx only here. For instance 
low level handling of color fonts as used for emoji but there are also 
other (often incomplete) fonts out there (overlay, png, svg) has become 
(on the average) a bit more efficient. It's somewhat tricky to satisfy 
viewers but at my end things work ok. It should also work in a cmyk only 
mode. As usual it's work in progress (and in this case very likely lmtx 
only).


Also some first (runtime) metafun (2) font creation support has been 
added (was always possible but it's a bit more convenient now). An 
example can be found in: meta-imp-gamesymbols.mkxl (the file can be 
processed with the 'context' command and will produce an example).


As usual imagination determines the limits of what context provides, so 
feel free to suggest more (examples). Again this is lmtx specific.


Hans

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

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


[NTG-context] howto create labels with multiple lines ?

2019-10-10 Thread Floris van Manen
List,

In the metafun-p document, there is the example creating a clock with
labels placed at the dots.

pair destination ;
for whereto = 0 step 30 until 330 :
destination := dir(whereto) * 1.5cm ;
freedotlabel(decimal whereto, destination, origin) ;
drawarrow origin -- destination
withpen pencircle scaled .25mm withcolor .625 red ;
endfor ;


I cannot find any example as how to have a label with multiple lines.
like:

. one
  two


  two
. three
  four


Can someone point me to an example as how to do that?

Thanks
.Floris


pEpkey.asc
Description: application/pgp-keys
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 inserting image within MP

2019-10-10 Thread context

Hello,

this is a probably basic question, but the following code doesn't 
compile:



\setupbackgrounds[page][background={Bkg}]

\defineoverlay[Bkg][\useMPgraphic{Bkg}]

\startuseMPgraphic{Bkg}
  externalfigure "hacker.png";
\stopuseMPgraphic

\starttext
  Ahoj
\stoptext


with:

"

picture

! Isolated expression.

;
<*>  externalfigure "hacker.png";
;
I couldn't find an `=' or `:=' after the
expression that is shown above this error message,
so I guess I'll just ignore it and carry on.
"

I just want to insert a picture from within MP code. What am I doing 
wrong?


Best regards,

Lukas
open source > level 1, order 1, name 
'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2019.04.16 08:54 MKIV beta  fmt: 2019.4.24  
int: english/english
system  > 
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name 
'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name 
'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'

system  > jobfiles > using path: d:\\Lukas\\ConTeXt\\Styles
system  > files > jobname 't', input 
'D:\\Lukas\\Jobs\\_Px\\Present\\Px-2019\\_\\t.mkiv', result 't'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name 
'D://Lukas/Jobs/_Px/Present/Px-2019/_/t.mkiv'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
metapost> initializing instance 'metafun:1' using format 'metafun' and 
method 'default'
metapost> loading 'metafun' as 
'd:/Ctx-Beta/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv' using 
method 'default'
metapost> initializing number mode 'scaled'

tex error   > mp error on line 1 in file 
D://Lukas/Jobs/_Px/Present/Px-2019/_/t.mkiv:

>> picture
! Isolated expression.

;
<*>  externalfigure "hacker.png";
;
I couldn't find an `=' or `:=' after the
expression that is shown above this error message,
so I guess I'll just ignore it and carry on.

[1]

 1 >>  \setupbackgrounds[page][background={Bkg}]
 2 
 3 \defineoverlay[Bkg][\useMPgraphic{Bkg}]
 4 
 5 \startuseMPgraphic{Bkg}
 6   externalfigure "hacker.png";
 7 \stopuseMPgraphic
 8 
 9 \starttext
10   Ahoj
11 \stoptext

\setupbackgrounds[page][background={Bkg}]

\defineoverlay[Bkg][\useMPgraphic{Bkg}]

\startuseMPgraphic{Bkg}
  externalfigure "hacker.png";
\stopuseMPgraphic

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

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


Re: [NTG-context] Printing catchword or kustode

2019-10-08 Thread Henning Hraban Ramm

> Am 2019-10-08 um 11:07 schrieb Hans Hagen :
> 
> On 10/7/2019 9:20 PM, Henning Hraban Ramm wrote:
>> It is already implemented, look for the catchword module.
>> Strangely I can’t find it ATM, but since I listed it in my book it was 
>> there, and we talked about it at the meeting.
> 
> maybe i sent it to you for testing but anwyay it was shown at the meeting 
> indeed (one of the things kept back till the meeting because it's a dangerous 
> bend as well as a dirty trick) .. i'll add it to the beta (had to make it 
> also work with mkiv as it was lmtx)

Ah, sorry. Then I added it at the meeting to my list of modules. I could have 
sworn I saw it before. But I had the same dèjá vu with the metafun xl manual…


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] After a long time I tried:

2019-10-07 Thread Hans Hagen

On 10/7/2019 2:04 PM, Ursula Hermann wrote:

Dear List!

I have tried:

\starttext

{This is me}

\startMPcode

input mptrees;

u:=0.4cm;

dirlabel:=90;

abscoord:=true;

endlabelspace:=0.5cm;

draw startlabel("$S$");

draw tree[1][1]((-5.5u,4u),(5.5u,8u))("NP","","VP","");

\stopMPcode

\stoptext

But there is a mistake, i dont know where, and whats wrong. After 
compiling (I have WinEdt as Editor), with Context, got wrong, I tried it 
with mp.exe, i get the following warning:


Command Line:   
C:\Users\Hermann\Downloads\context-mswin\tex\texmf-mswin\bin\context.exe 
--synctex=-1 "context-test.tex"


Startup Folder: C:\Users\Hermann\My Documents

mtx-context | run 1: luametatex 
--fmt="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en" 
--jobname="context-test" 
--lua="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui" 
--c:currentrun=1 --c:fulljobname="./context-test.tex" 
--c:input="./context-test.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:synctex="-1" 
--c:texmfbinpath="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-mswin/bin" 
"cont-yes.mkiv"


This is LuaMetaTeX, Version 2.00.0

open source > level 1, order 1, name 'cont-yes.mkiv'

system  >

system  > ConTeXt  ver: 2019.10.04 17:53 MKIV beta  fmt: 
2019.10.7  int: english/english


system  >

system  > 'cont-new.mkiv' loaded

open source > level 2, order 2, name 
'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'


system  > beware: some patches loaded from cont-new.mkiv

close source    > level 2, order 2, name 
'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'


system  > files > jobname 'context-test', input 
'./context-test', result 'context-test'


fonts   > latin modern fonts are not preloaded

languages   > language 'en' is active

system  > synctex functionality is enabled, expect 5-10 pct 
runtime overhead!


open source > level 2, order 3, name './context-test.tex'

fonts   > preloading latin modern fonts (second stage)

fonts       > 'fallback modern-designsize rm 12pt' is loaded

metapost    > initializing instance 'metafun:1' using format 
'metafun' and method 'default'


metapost    > loading 'metafun' as 
'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/metapost/context/base/mpiv/metafun.mpxl' 
using method 'default'


metapost    > initializing number mode 'scaled'

metapost log    >

metapost log    > loading metafun, including plain.mp version 1.004 for 
metafun iv and xl


metapost log    >

mplib warning: table expected from 'open_file'

mtx-context | fatal error: return code: -1073741819

Best regards

Uschi Hermann

PS: I have done the beta version of cont-tmf today , and have installed 
wipe the texmf-cache path and remake the formats (you ran into the 
bytecode incompatibility issues)


Hans

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

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


[NTG-context] After a long time I tried:

2019-10-07 Thread Ursula Hermann
Dear List!
I have tried:
\starttext
{This is me}
\startMPcode
input mptrees;
u:=0.4cm;
dirlabel:=90;
abscoord:=true;
endlabelspace:=0.5cm;
draw startlabel("$S$");
draw tree[1][1]((-5.5u,4u),(5.5u,8u))("NP","","VP","");
\stopMPcode
\stoptext

But there is a mistake, i dont know where, and whats wrong. After compiling (I 
have WinEdt as Editor), with Context, got wrong, I tried it with mp.exe, i get 
the following warning:

Command Line:   
C:\Users\Hermann\Downloads\context-mswin\tex\texmf-mswin\bin\context.exe 
--synctex=-1 "context-test.tex"
Startup Folder: C:\Users\Hermann\My Documents

mtx-context | run 1: luametatex 
--fmt="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en"
 --jobname="context-test" 
--lua="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui"
 --c:currentrun=1 --c:fulljobname="./context-test.tex" 
--c:input="./context-test.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:synctex="-1" 
--c:texmfbinpath="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-mswin/bin" 
"cont-yes.mkiv"

This is LuaMetaTeX, Version 2.00.0
open source > level 1, order 1, name 'cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2019.10.04 17:53 MKIV beta  fmt: 2019.10.7  
int: english/english
system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name 
'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name 
'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'context-test', input './context-test', 
result 'context-test'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
system  > synctex functionality is enabled, expect 5-10 pct runtime 
overhead!
open source > level 2, order 3, name './context-test.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
metapost> initializing instance 'metafun:1' using format 'metafun' and 
method 'default'
metapost> loading 'metafun' as 
'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/metapost/context/base/mpiv/metafun.mpxl'
 using method 'default'
metapost> initializing number mode 'scaled'
metapost log>
metapost log> loading metafun, including plain.mp version 1.004 for metafun 
iv and xl
metapost log>
mplib warning: table expected from 'open_file'
mtx-context | fatal error: return code: -1073741819
Best regards
Uschi Hermann
PS: I have done the beta version of cont-tmf today , and have installed 
context-mswin, what I do every week.
_

ConTeXt Compilation Report (Pages: 0)

Errors: 0   Warnings: 0   Bad Boxes: 0
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] new (lmtx) beta

2019-10-05 Thread Fabrice Couvreur
Hi Hans,
Where is this documentation ?
Thank you.
Fabrice



Le ven. 4 oct. 2019 à 21:34, Mikael P. Sundqvist  a
écrit :

> On Fri, Oct 4, 2019 at 6:11 PM Hans Hagen  wrote:
>
>> Hi,
>>
>> I uploaded a new lmtx beta. Again some more metafun trickery (see
>> luametafun manual). I attached an (lmtx only) example of some experiment
>> code, dedicated to Alan Braslau (teacher among other things).
>>
>> 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
>>
>> _______
>>
>
>
> Hi,
>
> I read the new manual with a great joy! This is really nice improvements
> of MetaFun! I also like the 3D plots!
>
> I had the possibility to try out some contour graphics on a freshly
> updated system. I have two questions:
>
> 1) I think the first (blue) plot looks fine and it looks like it could be
> the same curve as the blue one in the Mathematica plot (page 3). Why does
> my second example (orange) not match with the result from Mathematica
> (orange)? (I think I do something wrong)
> 2) Is there a way to combine the two contour plots in one MetaFun drawing?
> If I add them both to the same, only the last one shows. If I try
> functions={"-4+x^2+x^5+15*y-y^2-10*x^3*y^2+5*x*y^4","-15*x+2*x*y+5*x^4*y-10*x^2*y^3+y^5"}
> it does not show both either.
>
> /Mikael
>
> Test document (output was too big to attach (sorry if it came through to
> someone), so I put it at http://www.maths.lth.se/~mickep/polynomnoll.pdf )
>
> \starttext
> \startMPpage[offset=3bp,instance=doublefun]
> draw lmt_contour [
> xmin=-5,
> xmax=5,
> ymin=-5,
> ymax=5,
> xstep=0.01,
> ystep=0.01,
> range={0},
> levels=1,
> function="-4+x^2+x^5+15*y-y^2-10*x^3*y^2+5*x*y^4",
> linecolor="darkblue",
> linewidth=1,
> legend=false,
> cache=true,
> ]  xsized 10cm ;
> \stopMPpage
>
> \startMPpage[offset=3bp,instance=doublefun]
> draw lmt_contour [
> xmin=-5,
> xmax=5,
> ymin=-5,
> ymax=5,
> xstep=0.01,
> ystep=0.01,
> range={0},
> levels=1,
> function="-15*x+2*x*y+5*x^4*y-10*x^2*y^3+y^5",
> linecolor="orange",
> linewidth=1,
> legend=false,
> cache=true,
> ]  xsized 10cm ;
> \stopMPpage
>
> \startbuffer[mmainput]
> ContourPlot[
>  {-4+x^2+x^5+15y-y^2-10x^3y^2+5x*y^4 == 0,
>   -15x+2x*y+5*x^4*y-10x^2*y^3+y^5 == 0},
>   {x, -5, 5}, {y, -5, 5}, Frame -> False]
> \stopbuffer
> \startTEXpage[offset=2bp]
> \typebuffer[mmainput]
>
> \externalfigure[mathematicaplot][width=10cm]
> \stopTEXpage
> \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
___


Re: [NTG-context] new (lmtx) beta

2019-10-04 Thread Mikael P. Sundqvist
On Fri, Oct 4, 2019 at 6:11 PM Hans Hagen  wrote:

> Hi,
>
> I uploaded a new lmtx beta. Again some more metafun trickery (see
> luametafun manual). I attached an (lmtx only) example of some experiment
> code, dedicated to Alan Braslau (teacher among other things).
>
> 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
>
> ___
>


Hi,

I read the new manual with a great joy! This is really nice improvements of
MetaFun! I also like the 3D plots!

I had the possibility to try out some contour graphics on a freshly updated
system. I have two questions:

1) I think the first (blue) plot looks fine and it looks like it could be
the same curve as the blue one in the Mathematica plot (page 3). Why does
my second example (orange) not match with the result from Mathematica
(orange)? (I think I do something wrong)
2) Is there a way to combine the two contour plots in one MetaFun drawing?
If I add them both to the same, only the last one shows. If I try
functions={"-4+x^2+x^5+15*y-y^2-10*x^3*y^2+5*x*y^4","-15*x+2*x*y+5*x^4*y-10*x^2*y^3+y^5"}
it does not show both either.

/Mikael

Test document (output was too big to attach (sorry if it came through to
someone), so I put it at http://www.maths.lth.se/~mickep/polynomnoll.pdf )

\starttext
\startMPpage[offset=3bp,instance=doublefun]
draw lmt_contour [
xmin=-5,
xmax=5,
ymin=-5,
ymax=5,
xstep=0.01,
ystep=0.01,
range={0},
levels=1,
function="-4+x^2+x^5+15*y-y^2-10*x^3*y^2+5*x*y^4",
linecolor="darkblue",
linewidth=1,
legend=false,
cache=true,
]  xsized 10cm ;
\stopMPpage

\startMPpage[offset=3bp,instance=doublefun]
draw lmt_contour [
xmin=-5,
xmax=5,
ymin=-5,
ymax=5,
xstep=0.01,
ystep=0.01,
range={0},
levels=1,
function="-15*x+2*x*y+5*x^4*y-10*x^2*y^3+y^5",
linecolor="orange",
linewidth=1,
legend=false,
cache=true,
]  xsized 10cm ;
\stopMPpage

\startbuffer[mmainput]
ContourPlot[
 {-4+x^2+x^5+15y-y^2-10x^3y^2+5x*y^4 == 0,
  -15x+2x*y+5*x^4*y-10x^2*y^3+y^5 == 0},
  {x, -5, 5}, {y, -5, 5}, Frame -> False]
\stopbuffer
\startTEXpage[offset=2bp]
\typebuffer[mmainput]

\externalfigure[mathematicaplot][width=10cm]
\stopTEXpage
\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] new (lmtx) beta

2019-10-04 Thread Hans Hagen

Hi,

I uploaded a new lmtx beta. Again some more metafun trickery (see 
luametafun manual). I attached an (lmtx only) example of some experiment 
code, dedicated to Alan Braslau (teacher among other things).


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
-


kindergarten.pdf
Description: Adobe PDF document
\startMPcalculation{simplefun}

pen KindergartenPen ; KindergartenPen := pencircle scaled 1 ;

% 10 x 10 grid

vardef KindergartenEqual =
draw image
(
draw (2,6) -- (9,5) ;
draw (2,4) -- (8,3) ;
)
shifted (0,-2)
withpen KindergartenPen
withcolor "KindergartenEqual"
enddef ;
vardef KindergartenPlus =
draw image
(
draw (1,4) -- (9,5) ;
draw (4,1) -- (5,8) ;
)
shifted (0,-2)
withpen KindergartenPen
withcolor "KindergartenPlus"
enddef ;
vardef KindergartenMinus =
draw image
(
draw (1,5) -- (9,4) ;
)
shifted (0,-2)
withpen KindergartenPen
withcolor "KindergartenMinus"
enddef ;
vardef KindergartenTimes =
draw image
(
draw (2,1) -- (9,8) ;
draw (8,1) -- (2,8) ;
)
shifted (0,-2)
withpen KindergartenPen
withcolor "KindergartenTimes"
enddef ;
vardef KindergartenDivided =
draw image
(
draw (2,1) -- (8,9) ;
)
shifted (0,-2)
withpen KindergartenPen
withcolor "KindergartenDivided"
enddef ;

lmt_registerglyphs [
name = "kindergarten",
units= 10,
  % usecolor = true,
width= 10,
height   = 8,
depth= 2,
] ;

lmt_registerglyph [ category = "kindergarten", unicode = "0x003D",
code = "KindergartenEqual"
] ;
lmt_registerglyph [ category = "kindergarten", unicode = "0x002B",
code = "KindergartenPlus"
] ;
lmt_registerglyph [ category = "kindergarten", unicode = "0x2212",
code = "KindergartenMinus"
] ;
lmt_registerglyph [ category = "kindergarten", unicode = "0x00D7",
code = "KindergartenTimes"
] ;
lmt_registerglyph [ category = "kindergarten", unicode = "0x002F",
code = "KindergartenDivided"
] ;

\stopMPcalculation

\definecolor[KindergartenEqual]  [darkgreen]
\definecolor[KindergartenPlus]   [darkred]
\definecolor[KindergartenMinus]  [darkred]
\definecolor[KindergartenTimes]  [darkblue]
\definecolor[KindergartenDivided][darkblue]

\definefontfeature
  [mathextra]
  [metapost=kindergarten]

\setupbodyfont[dejavu]

\startTEXpage[offset=10pt]
$ y = 2 \times x + a - b / 3 $ \par
\hfill \infofont{kindergarten math}
\stopTEXpage
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] beta

2019-10-02 Thread Hans van der Meer
You can add to the end of the install script:

echo "Removing luatex-cache/context"
rm -r tex/texmf-cache/luatex-cache/context

dr. Hans van der Meer


> On 2 Oct 2019, at 15:32, Alan Bowen  wrote:
> 
> Hi, Hans—
> 
> The latest lmtx now processes my docs as it should when texmf-cache was 
> deleted before installation. So, where is this zip that has the revised 
> install.sh script?
> 
> Alan
> 
> On Wed, Oct 2, 2019 at 7:06 AM Hans Hagen  <mailto:j.ha...@xs4all.nl>> wrote:
> On 9/30/2019 2:11 PM, Thomas A. Schmitz wrote:
> > On 29.09.19 16:31, Hans Hagen wrote:
> >> Hi,
> >>
> >> A week ago we had the (nice and pleasant) annual context meeting and 
> >> as usual some new stuff has been presented there which was not yet in 
> >> the distribution at that moment. Some pending code is now being moved 
> >> into the distribution. Part is font related (lmtx only, not relevant 
> >> for most users), most is metafun (luametafun or metafun xl or whatever 
> >> name suits) related (including a new preliminary manual) which uses 
> >> some new interfaces and therefore (currently) is lmtx only.
> > 
> > Hi Hans,
> > 
> > I just updated. I had to delete the cache for context to work again, got 
> > weird errors compiling a file that works normally. So my question: since 
> > creating a new cache and format takes only a few seconds, wouldn't it 
> > make sense to include it in install.sh ?
> I've added that feature but one needs the new install.sh script then 
> (from the zip).
> 
> (We also added openbsd installers.)
> 
> Hans
> 
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl <http://www.pragma-ade.nl/> | 
> www.pragma-pod.nl <http://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 <mailto:ntg-context@ntg.nl> / 
> http://www.ntg.nl/mailman/listinfo/ntg-context 
> <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
> http://context.aanhet.net <http://context.aanhet.net/>
> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
> <https://bitbucket.org/phg/context-mirror/commits/>
> wiki : http://contextgarden.net <http://contextgarden.net/>
> ___
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] beta

2019-10-02 Thread Alan Bowen
Hi, Hans—

The latest lmtx now processes my docs as it should when texmf-cache was
deleted before installation. So, where is this zip that has the revised
install.sh script?

Alan

On Wed, Oct 2, 2019 at 7:06 AM Hans Hagen  wrote:

> On 9/30/2019 2:11 PM, Thomas A. Schmitz wrote:
> > On 29.09.19 16:31, Hans Hagen wrote:
> >> Hi,
> >>
> >> A week ago we had the (nice and pleasant) annual context meeting and
> >> as usual some new stuff has been presented there which was not yet in
> >> the distribution at that moment. Some pending code is now being moved
> >> into the distribution. Part is font related (lmtx only, not relevant
> >> for most users), most is metafun (luametafun or metafun xl or whatever
> >> name suits) related (including a new preliminary manual) which uses
> >> some new interfaces and therefore (currently) is lmtx only.
> >
> > Hi Hans,
> >
> > I just updated. I had to delete the cache for context to work again, got
> > weird errors compiling a file that works normally. So my question: since
> > creating a new cache and format takes only a few seconds, wouldn't it
> > make sense to include it in install.sh ?
> I've added that feature but one needs the new install.sh script then
> (from the zip).
>
> (We also added openbsd installers.)
>
> 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] beta

2019-10-02 Thread Hans Hagen

On 9/30/2019 2:11 PM, Thomas A. Schmitz wrote:

On 29.09.19 16:31, Hans Hagen wrote:

Hi,

A week ago we had the (nice and pleasant) annual context meeting and 
as usual some new stuff has been presented there which was not yet in 
the distribution at that moment. Some pending code is now being moved 
into the distribution. Part is font related (lmtx only, not relevant 
for most users), most is metafun (luametafun or metafun xl or whatever 
name suits) related (including a new preliminary manual) which uses 
some new interfaces and therefore (currently) is lmtx only.


Hi Hans,

I just updated. I had to delete the cache for context to work again, got 
weird errors compiling a file that works normally. So my question: since 
creating a new cache and format takes only a few seconds, wouldn't it 
make sense to include it in install.sh ?
I've added that feature but one needs the new install.sh script then 
(from the zip).


(We also added openbsd installers.)

Hans

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

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


Re: [NTG-context] beta

2019-09-30 Thread Thomas A. Schmitz

On 29.09.19 16:31, Hans Hagen wrote:

Hi,

A week ago we had the (nice and pleasant) annual context meeting and as 
usual some new stuff has been presented there which was not yet in the 
distribution at that moment. Some pending code is now being moved into 
the distribution. Part is font related (lmtx only, not relevant for most 
users), most is metafun (luametafun or metafun xl or whatever name 
suits) related (including a new preliminary manual) which uses some new 
interfaces and therefore (currently) is lmtx only.


Hi Hans,

I just updated. I had to delete the cache for context to work again, got 
weird errors compiling a file that works normally. So my question: since 
creating a new cache and format takes only a few seconds, wouldn't it 
make sense to include it in install.sh ?


All best, thanks for the new version

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] beta

2019-09-29 Thread Hans Hagen

Hi,

A week ago we had the (nice and pleasant) annual context meeting and as 
usual some new stuff has been presented there which was not yet in the 
distribution at that moment. Some pending code is now being moved into 
the distribution. Part is font related (lmtx only, not relevant for most 
users), most is metafun (luametafun or metafun xl or whatever name 
suits) related (including a new preliminary manual) which uses some new 
interfaces and therefore (currently) is lmtx only.


At the meeting Mojca and Harald did some experiments with the whole 
range of raspberry pi's (as part of upgrading the compile farm with a pi 
4). The outcomes can be found at


https://meeting.contextgarden.net/2019/talks/2019-09-20-harald-pi/to_pi_or_not_to_pi.pdf

(There are some more slides there.)

Because running tex on a 4 (with plenty of memory and an external ssd) 
is more reasonable than on the older models, I've added an lmtx 
installer for the pi. Some measurements with (really) simple runs show 
that performance is 3-4 times less than my laptop, which is not that bad 
(it helps that the 4 has a decent ethernet and usb3 bus); I don't know 
about more complex tests.


Hans

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

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


Re: [NTG-context] colors in MetaPost

2019-09-11 Thread Hans Hagen

On 9/11/2019 2:18 PM, Henning Hraban Ramm wrote:

Am 2019-09-11 um 13:46 schrieb Henning Hraban Ramm :

\definecolor[VerlaufVon][c=75,m=5,y=95,k=60]
\definecolor[VerlaufNach][c=88,m=95,y=5,k=60]


Of course I need values between 0 and 1.
Sorry for the noise.
I think I’m too tired...

there is an alternative interface on top of the existing one (coming) ...

% maybe handy:

definecolor [ name = "MyColor3", r = 0.22, g = 0.44, b = 0.66 ] ;
definecolor [ name = "MyColor4", r = 0.66, g = 0.44, b = 0.22 ] ;

% parameter driven:

draw lmt_shade [
path  = fullcircle scaled 4cm,
direction = "right",
domain= { 0, 2 },
colors= { "MyColor3", "MyColor4" },
] ;

but tweaking shades will never be easy

Hans

(working in the metafun xl manual, more soon)

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

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


[NTG-context] colors in MetaPost

2019-09-11 Thread Henning Hraban Ramm
Hi,
I’m trying to get a linear shade in the background of my presentation.
But it seems like MetaPost can’t handle my self-defined colors:


\definecolor[VerlaufVon][c=75,m=5,y=95,k=60]
\definecolor[VerlaufNach][c=88,m=95,y=5,k=60]

\startuniqueMPgraphic{Verlauf}
% old method, also doesn’t work
%  path p ;
%  p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
%  linear_shade(p,6,\MPcolor{VerlaufVon},\MPcolor{VerlaufNach}) ;

fill fullsquare xyscaled (\overlaywidth,\overlayheight)
  withshademethod "linear"
  withshadevector (0.5,2.5)
  %withshadedirection shadedup
  withshadecolors ("VerlaufVon", "VerlaufNach")
;
\stopuniqueMPgraphic

\defineoverlay[verlaufen][\useMPgraphic{Verlauf}]

\setupbackgrounds[paper][background={verlaufen}]

\starttext
\strut
\stoptext


The background consists of a blue and a green area instead of a shade. While 
testing I sometimes got a few more stripes in the top and bottom area, can’t 
reproduce any more.

I also tried RGB and hex (HTML) definitions. Predefined colors work.
According to the MetaFun manual, either \MPcolor{name} or just "name" should 
work.
What’s wrong?


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] typo in metafun manual

2019-09-10 Thread Michael Hallgren

Le 2019-09-10 07:36, Damien Thiriet a écrit :

Hi,


There may be a typo in metafun manual, page 104

Hopefully the next explains a bit how it works (you can find
explanations zon the internet).

Sounds too Dutch for me…


Looks like :). And 'the Internet' usually uppercase.

mh


Regards,

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

maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/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] typo in metafun manual

2019-09-09 Thread Damien Thiriet
Hi,


There may be a typo in metafun manual, page 104

Hopefully the next explains a bit how it works (you can find
explanations zon the internet).

Sounds too Dutch for me…
Regards,

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

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


Re: [NTG-context] metafun 2

2019-09-08 Thread Aditya Mahajan

On Sun, 8 Sep 2019, Otared Kavian wrote:


Hi Aditya,

I wanted also to point out a typo on that page (two occurrences), namely 
"ploles" instead of "poles", in the explanations before the actual code.


Thanks. Fixed.

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

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


Re: [NTG-context] Arithmetic overflow on placing an external figure in MP

2019-09-08 Thread Hans Hagen

On 9/7/2019 10:47 PM, Henning Hraban Ramm wrote:

Bear with me, I still got no experience in MetaPost…

I’m trying to place a pixel image on a MP page.

According to the MetaFun manual this should work:

\startMPpage
draw externalfigure "mill.png" scaled 5cm shifted (-6cm,0) ;
\stopMPpage

And it works with mill.png (copied into my test dir), but with none of my other 
PNGs, I always get

! Arithmetic overflow.
<*> ...xternalfigure "dodo.png" scaled 5cm shifted
(-6cm,0) ; ;
Uh, oh. A little while ago one of the quantities that I was
computing got too large, so I'm afraid your answers will be
somewhat askew. You'll probably have to adopt different
tactics next time. But I shall try to carry on anyway.

[1]

1 \startMPpage


[instance=doublefun]

will bump metapost into doublemode


2 draw externalfigure "dodo.png" scaled 5cm shifted (-6cm,0) ;
3 >>  \stopMPpage
4


The same image file works with

\starttext
\externalfigure[dodo][height=8cm]
\stoptext

What’s wrong?

The image is here:
https://github.com/fiee/ConTeXt/raw/master/tshirts/img/dodo.png


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

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

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




--

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

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


Re: [NTG-context] metafun 2

2019-09-08 Thread Otared Kavian
Hi Aditya,

As usual you show us a very nice and very clear example to taech nice features 
of ConTeXt: thank you so much!

I wanted also to point out a typo on that page (two occurrences), namely 
"ploles" instead of "poles", in the explanations before the actual code.

Best regard: 

> On 8 Sep 2019, at 10:42, Aditya Mahajan  wrote:
> 
> On Wed, 14 Aug 2019, Hans Hagen wrote:
> 
>> Hi,
>> 
>> In the process of providing an additional (more abstract) interface to some 
>> of the old and also new MetaFun code we wonder what kind of features users 
>> would like to see.
>> 
>> http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf
> 
> Finally got around to playing around with the new interface. Here is an 
> example of how to define new key-value driven macros in metapost:
> 
> https://adityam.github.io/context-blog/post/new-metafun-interface/
> 
> 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] metafun 2

2019-09-08 Thread Aditya Mahajan

On Wed, 14 Aug 2019, Hans Hagen wrote:


Hi,

In the process of providing an additional (more abstract) interface to 
some of the old and also new MetaFun code we wonder what kind of 
features users would like to see.


http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf


Finally got around to playing around with the new interface. Here is an 
example of how to define new key-value driven macros in metapost:


https://adityam.github.io/context-blog/post/new-metafun-interface/

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

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


Re: [NTG-context] Arithmetic overflow on placing an external figure in MP

2019-09-07 Thread Fabrice L
Hi,

> Le 7 sept. 2019 à 16:47, Henning Hraban Ramm  a écrit :
> 
> Bear with me, I still got no experience in MetaPost…
> 
> I’m trying to place a pixel image on a MP page.
> 
> According to the MetaFun manual this should work:
> 
> \startMPpage
> draw externalfigure "mill.png" scaled 5cm shifted (-6cm,0) ;
> \stopMPpage
> 
> And it works with mill.png (copied into my test dir), but with none of my 
> other PNGs, I always get
> 
> ! Arithmetic overflow.
> <*> ...xternalfigure "dodo.png" scaled 5cm shifted
> (-6cm,0) ; ;
> Uh, oh. A little while ago one of the quantities that I was
> computing got too large, so I'm afraid your answers will be
> somewhat askew. You'll probably have to adopt different
> tactics next time. But I shall try to carry on anyway.
> 
> [1]
> 
> 1 \startMPpage
> 2 draw externalfigure "dodo.png" scaled 5cm shifted (-6cm,0) ;
> 3 >>  \stopMPpage
> 4
> 

I can reproduce your error with MKIV, but this world with lmtx; I think this is 
just too big for MKIV (I’m not sure why !).
Be aware of the difference between « scaled » and « sized ». You can try:

\starttext
\startMPpage
draw externalfigure "dodo.png" sized  5cm shifted (-6cm,0) ;
\stopMPpage
\stoptext

and try:

\starttext
\startMPpage
draw externalfigure "dodo.png" scaled 0.018cm shifted (0,0) ;
draw ((0,0) -- (5cm,0) -- (5cm,5cm) -- (0,5cm) -- cycle ) withcolor red ;
\stopMPpage
\stoptext

In the second case, your image fits (approximately) in a 5cm square. 
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] Arithmetic overflow on placing an external figure in MP

2019-09-07 Thread Henning Hraban Ramm
Bear with me, I still got no experience in MetaPost…

I’m trying to place a pixel image on a MP page.

According to the MetaFun manual this should work:

\startMPpage
draw externalfigure "mill.png" scaled 5cm shifted (-6cm,0) ;
\stopMPpage

And it works with mill.png (copied into my test dir), but with none of my other 
PNGs, I always get

! Arithmetic overflow.
<*> ...xternalfigure "dodo.png" scaled 5cm shifted
(-6cm,0) ; ;
Uh, oh. A little while ago one of the quantities that I was
computing got too large, so I'm afraid your answers will be
somewhat askew. You'll probably have to adopt different
tactics next time. But I shall try to carry on anyway.

[1]

1 \startMPpage
2 draw externalfigure "dodo.png" scaled 5cm shifted (-6cm,0) ;
3 >>  \stopMPpage
4


The same image file works with

\starttext
\externalfigure[dodo][height=8cm]
\stoptext

What’s wrong?

The image is here:
https://github.com/fiee/ConTeXt/raw/master/tshirts/img/dodo.png


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] startnarrower and framed?

2019-08-21 Thread Jon Wong
Hi all,

I’m so so sorry for yet another message in this thread. I’ve solved it, but 
still don’t quite understand why it works. I post the solution here so that 
nobody has to spend any time crafting the solution. But I still have 1 key 
question.

Key question: Why does \setwhitespace[line] prevent \blank[-0.5em] from working 
after a \framed?

(Ok. I better sleep before I pollute the mailing list further.)

Apparent Solution:

\usecolors[xwi]
\setupwhitespace[line]

\starttext
\definetextbackground[secondary][
  location=always,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]

\input knuth

{

\blank[line]

\setupwhitespace[none]

\startnarrower
  \dontleavehmode\framed[
width=local, corner=03, background=color, backgroundcolor=cyan,
frame=off
  ]{My header!}

  \blank[-0.5em]

  \startsecondary
  {

  \setupwhitespace[line]

\input knuth

  }
  \stopsecondary
\stopnarrower

}

\input knuth
\stoptext


> On Aug 21, 2019, at 10:21 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> Ok, last message in this topic, I promise. I’ve crafted a MWE.
> 
> If I \setupwhitespace[line], the \blank[-0.5em] stops working. I’m sure I 
> need to revise my TeX notes. For now, can somebody give me a little 
> encouragement and tell me the answer? :-P
> 
> \usecolors[xwi]
> % \setupwhitespace[line]
> 
> \starttext
> \definetextbackground[secondary][
>   location=always,
>   background=color,
>   backgroundcolor=lightgray,
>   leftoffset=.5\bodyfontsize,
>   rightoffset=.5\bodyfontsize,
>   topoffset=.5\bodyfontsize,
>   bottomoffset=.5\bodyfontsize,
>   frame=off,]
> 
> \input knuth
> 
> \startnarrower
>   \dontleavehmode\framed[
> width=local, corner=03, background=color, backgroundcolor=cyan,
> frame=off
>   ]{My header!}
> 
>   \blank[-0.5em]
> 
>   \startsecondary
> \input knuth
>   \stopsecondary
> \stopnarrower
> 
> \input knuth
> \stoptext
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 9:37 PM, Jon Wong > <mailto:jhannw...@gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> Ah, found the solution in TextBackground. At here: 
>> https://www.contextgarden.net/TextBackground 
>> <https://www.contextgarden.net/TextBackground>
>> 
>> Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 
>> TextBackgrounds, zero vspace between them)?
>> 
>> For the top segment, I want rounded corners only for top corners (corner=03 
>> with \framed).
>> 
>> Seems I really should dig into MetaFun and TextBackground. Looks really fun 
>> and useful.
>> 
>> Sorry for the noise. Am a little carried away exploring the Garden. :-P
>> 
>> Regards
>> Jon
>> 
>> 
>>> On Aug 21, 2019, at 9:25 PM, Jon Wong >> <mailto:jhannw...@gmail.com>> wrote:
>>> 
>>> Hi all,
>>> 
>>> Sorry, my solution didn’t work.
>>> 
>>> My purpose of using \startnarrower is to have some paragraphs of text 
>>> inside the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
>>> 
>>> \startframedtext doesn’t have as many border options as \framed.
>>> 
>>> Should I use overlays? Or layers? It seems layers require absolutely 
>>> positioning, and can’t be logically contained inside a \startnarrower?
>>> 
>>> Regards
>>> Jon
>>> 
>>> 
>>>> On Aug 21, 2019, at 8:53 PM, Jon Wong >>> <mailto:jhannw...@gmail.com>> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> I got some progress!
>>>> 
>>>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>>>> \startnarrower
>>>> \dontleavehmode\framed[width=local]{testing}
>>>> 
>>>> Since this works for left offset: \framed[width=local]{testing}
>>>> \endnarrower
>>>> 
>>>> So, how do I do a gradient background? Yeah, I know I have to dive into 
>>>> MetaPost and MetaFun some time. Is that where the solution is?
>>>> 
>>>> Regards
>>>> Jon
>>>> 
>>>>> On Aug 21, 2019, at 8:14 PM, Jon Wong >>>> <mailto:jhannw...@gmail.com>> wrote:
>>>>> 
>>>>> Hi all,
>>>>> 
>>>>> I want to have a \startnarrower effect. But I also want that segment to 
>>>>> have a border (hopefully a gradient background color too!).
>>>>> 
>>>>> I tried:
>>>>> 
>>>>> \startnarrower
>>>>> \framed{testing}
>>>>> 
>>>>> Seems framed doesn’t observe startnarrower commands.
>>>>> \endnarrower
>>>>> 
>>>>> How do I achieve that?
>>>>> 
>>>>> Regards
>>>>> Jon
>>>> 
>>> 
>> 
> 

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] startnarrower and framed?

2019-08-21 Thread Jon Wong
Hi all,

Ok, last message in this topic, I promise. I’ve crafted a MWE.

If I \setupwhitespace[line], the \blank[-0.5em] stops working. I’m sure I need 
to revise my TeX notes. For now, can somebody give me a little encouragement 
and tell me the answer? :-P

\usecolors[xwi]
% \setupwhitespace[line]

\starttext
\definetextbackground[secondary][
  location=always,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]

\input knuth

\startnarrower
  \dontleavehmode\framed[
width=local, corner=03, background=color, backgroundcolor=cyan,
frame=off
  ]{My header!}

  \blank[-0.5em]

  \startsecondary
\input knuth
  \stopsecondary
\stopnarrower

\input knuth
\stoptext

Regards
Jon


> On Aug 21, 2019, at 9:37 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> Ah, found the solution in TextBackground. At here: 
> https://www.contextgarden.net/TextBackground 
> <https://www.contextgarden.net/TextBackground>
> 
> Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 
> TextBackgrounds, zero vspace between them)?
> 
> For the top segment, I want rounded corners only for top corners (corner=03 
> with \framed).
> 
> Seems I really should dig into MetaFun and TextBackground. Looks really fun 
> and useful.
> 
> Sorry for the noise. Am a little carried away exploring the Garden. :-P
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 9:25 PM, Jon Wong > <mailto:jhannw...@gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> Sorry, my solution didn’t work.
>> 
>> My purpose of using \startnarrower is to have some paragraphs of text inside 
>> the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
>> 
>> \startframedtext doesn’t have as many border options as \framed.
>> 
>> Should I use overlays? Or layers? It seems layers require absolutely 
>> positioning, and can’t be logically contained inside a \startnarrower?
>> 
>> Regards
>> Jon
>> 
>> 
>>> On Aug 21, 2019, at 8:53 PM, Jon Wong >> <mailto:jhannw...@gmail.com>> wrote:
>>> 
>>> Hi all,
>>> 
>>> I got some progress!
>>> 
>>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>>> \startnarrower
>>> \dontleavehmode\framed[width=local]{testing}
>>> 
>>> Since this works for left offset: \framed[width=local]{testing}
>>> \endnarrower
>>> 
>>> So, how do I do a gradient background? Yeah, I know I have to dive into 
>>> MetaPost and MetaFun some time. Is that where the solution is?
>>> 
>>> Regards
>>> Jon
>>> 
>>>> On Aug 21, 2019, at 8:14 PM, Jon Wong >>> <mailto:jhannw...@gmail.com>> wrote:
>>>> 
>>>> Hi all,
>>>> 
>>>> I want to have a \startnarrower effect. But I also want that segment to 
>>>> have a border (hopefully a gradient background color too!).
>>>> 
>>>> I tried:
>>>> 
>>>> \startnarrower
>>>> \framed{testing}
>>>> 
>>>> Seems framed doesn’t observe startnarrower commands.
>>>> \endnarrower
>>>> 
>>>> How do I achieve that?
>>>> 
>>>> Regards
>>>> Jon
>>> 
>> 
> 

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] startnarrower and framed?

2019-08-21 Thread Jon Wong
Hi all,

Ah, found the solution in TextBackground. At here: 
https://www.contextgarden.net/TextBackground 
<https://www.contextgarden.net/TextBackground>

Can I have a 2-segment (2 vboxes) TextBackground (presumably with 2 
TextBackgrounds, zero vspace between them)?

For the top segment, I want rounded corners only for top corners (corner=03 
with \framed).

Seems I really should dig into MetaFun and TextBackground. Looks really fun and 
useful.

Sorry for the noise. Am a little carried away exploring the Garden. :-P

Regards
Jon


> On Aug 21, 2019, at 9:25 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> Sorry, my solution didn’t work.
> 
> My purpose of using \startnarrower is to have some paragraphs of text inside 
> the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.
> 
> \startframedtext doesn’t have as many border options as \framed.
> 
> Should I use overlays? Or layers? It seems layers require absolutely 
> positioning, and can’t be logically contained inside a \startnarrower?
> 
> Regards
> Jon
> 
> 
>> On Aug 21, 2019, at 8:53 PM, Jon Wong  wrote:
>> 
>> Hi all,
>> 
>> I got some progress!
>> 
>> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
>> \startnarrower
>> \dontleavehmode\framed[width=local]{testing}
>> 
>> Since this works for left offset: \framed[width=local]{testing}
>> \endnarrower
>> 
>> So, how do I do a gradient background? Yeah, I know I have to dive into 
>> MetaPost and MetaFun some time. Is that where the solution is?
>> 
>> Regards
>> Jon
>> 
>>> On Aug 21, 2019, at 8:14 PM, Jon Wong  wrote:
>>> 
>>> Hi all,
>>> 
>>> I want to have a \startnarrower effect. But I also want that segment to 
>>> have a border (hopefully a gradient background color too!).
>>> 
>>> I tried:
>>> 
>>> \startnarrower
>>> \framed{testing}
>>> 
>>> Seems framed doesn’t observe startnarrower commands.
>>> \endnarrower
>>> 
>>> How do I achieve that?
>>> 
>>> Regards
>>> Jon
>> 
> 

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] startnarrower and framed?

2019-08-21 Thread Jon Wong
Hi all,

Sorry, my solution didn’t work.

My purpose of using \startnarrower is to have some paragraphs of text inside 
the \framed. Unfortunately, it seems \framed doesn’t take paragraphs.

\startframedtext doesn’t have as many border options as \framed.

Should I use overlays? Or layers? It seems layers require absolutely 
positioning, and can’t be logically contained inside a \startnarrower?

Regards
Jon


> On Aug 21, 2019, at 8:53 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> I got some progress!
> 
> \setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
> \startnarrower
>  \dontleavehmode\framed[width=local]{testing}
> 
>  Since this works for left offset: \framed[width=local]{testing}
> \endnarrower
> 
> So, how do I do a gradient background? Yeah, I know I have to dive into 
> MetaPost and MetaFun some time. Is that where the solution is?
> 
> Regards
> Jon
> 
>> On Aug 21, 2019, at 8:14 PM, Jon Wong  wrote:
>> 
>> Hi all,
>> 
>> I want to have a \startnarrower effect. But I also want that segment to have 
>> a border (hopefully a gradient background color too!).
>> 
>> I tried:
>> 
>> \startnarrower
>> \framed{testing}
>> 
>> Seems framed doesn’t observe startnarrower commands.
>> \endnarrower
>> 
>> How do I achieve that?
>> 
>> Regards
>> Jon
> 

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] startnarrower and framed?

2019-08-21 Thread Jon Wong
Hi all,

I got some progress!

\setupnarrower[left=2cm, right=2cm] % what does middle do, actually?
\startnarrower
  \dontleavehmode\framed[width=local]{testing}

  Since this works for left offset: \framed[width=local]{testing}
\endnarrower

So, how do I do a gradient background? Yeah, I know I have to dive into 
MetaPost and MetaFun some time. Is that where the solution is?

Regards
Jon

> On Aug 21, 2019, at 8:14 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> I want to have a \startnarrower effect. But I also want that segment to have 
> a border (hopefully a gradient background color too!).
> 
> I tried:
> 
> \startnarrower
>  \framed{testing}
> 
>  Seems framed doesn’t observe startnarrower commands.
> \endnarrower
> 
> How do I achieve that?
> 
> Regards
> Jon

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] startnarrower and framed?

2019-08-21 Thread Hans Hagen

On 8/21/2019 2:14 PM, Jon Wong wrote:

\startnarrower
   \framed{testing}

   Seems framed doesn’t observe startnarrower commands.
\endnarrower

\starttext

Seems framed doesn’t observe startnarrower commands.

\startnarrower
\dontleavehmode \framed{testing}

Seems framed doesn’t observe startnarrower commands.

\startlinecorrection
\dontleavehmode \framed{testing}
\stoplinecorrection
\stopnarrower

\stoptext

for gradients, see metafun and example sin test suite

--

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

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


[NTG-context] Fwd: metafun 2

2019-08-19 Thread Mikael P. Sundqvist
On Wed, Aug 14, 2019 at 5:37 PM Hans Hagen  wrote:

> On 8/14/2019 4:58 PM, Mikael P. Sundqvist wrote:
>
> > 1) 3d support. This is of course a very big request, but it would also
> > be useful for many people.
>
> yes ... Alan and I are thinking of some (not that we came far yet)
>

Please keep us updated! :)


> > 2) About graphing, it would be nice to be able to do contour polots and
> > density plots. I know I asked for contour plots some time ago, and there
> > were some examples, but I don't think there was ever some built in
> > support for it. Maybe that can be done "easy" with help of lua? I guess
> > there exist good algorithms.
>
> spec needed ... as 'code' can be any function it's mostly a matter of
> what to pipe back to mp
>

I'm not sure what kind of spec you need. What I have in mind (others could
complete) is in particular a way to plot the set of (x,y) such that
f(x,y)=0 for some given function f and some rectangle in x and y. I made
some plots with Mathematica

http://www.maths.lth.se/matematiklth/personal/mickep/Contour.pdf (too big
for the list)

The first plot shows a difficulty with a contour plot, namely
intersections.
In the second one I added points, and it looks better.
In the third plot I have not specified that the expression should be equal
to 0. Then Mathematica plots the curves f(x,y)=C for various values of C.
In the background it adds a density plot (i.e. a mesh with different
colours for different values of the function.
In the fourth plot, the regionplot, the pairs (x,y) for which f(x,y)<0 are
marked. This is also very useful.
In the fifth plot there is only the densityplot, with different colors for
different values of f.

I don't know how difficult it is to implement this kind of graphics. Also,
it could be useful to be able to input the equation f(x,y)=0 and to receive
the curves as MetaPost paths. It seems that one can do contour plots with
the help of lua if that is something that helps (
http://franko.github.io/graph-toolkit/contour.html).

Anything would be better than nothing, and I'm more than happy to test.


>
> > 3) (small) The possibility to have arrows in coordinate axes. I have not
> > had the possibility to test the new features today, and maybe this is
> > already built in (drawarrow?), but I mention it since I did not see it
> > in the pdf.
>
> no, but that is rather trivial to add
>

Good!


>
> > Again, it is very nice that you work on extending MetaPost/MetaFun
> further!!
> wel, mp is ... fun (and these extension are somewhat challenging)
>
> Hans
>

Fun, indeed!

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

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


Re: [NTG-context] metafun 2

2019-08-19 Thread Jorge Manuel

Thanks a lot for the new features.


In my system this code don’t work.

macOS Mojave

This is LuaMetaTeX, Version 2.00.0
open source > level 1, order 1, name 'cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2019.08.17 12:16 MKIV beta  fmt: 2019.8.19  
int: English/English




\startMPcode{doublefun}
draw lmt_function [

xmin =  0, xmax = 10, xstep = .05,
ymin = -2, ymax =  2,

xticks = "bottom", xsmall = 80, xlarge = 20,
yticks = "left",   ysmall = 40, ylarge =  4,

code = "1.5 * math.cosd(240 * math.sqrt(x))",

xlabels = "yes",
ylabels = "yes",

ycaption = "\strut\tfd \rotate[rotation=90]{vertical}",
xcaption = "\strut\tfd horizontal",

pointsymbol = "dot", pointsize = 4, pointcolor = "orange",

sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm,
]
xsized 8cm
;
\stopMPcode

The output error:

loading metafun, including plain.mp version 1.004 for metafun iv and xl


pages   > flushing realpage 9, userpage 8, subpage 9
metapost log> ! Missing ':' has been inserted.
metapost log> 
metapost log>addto
metapost log> draw->addto
metapost log>
.currentpicture.if.picture(EXPR0):also(EXPR0)else:doublepath(EXPR…









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

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


Re: [NTG-context] metafun 2

2019-08-17 Thread Adam Reviczky
Hi Hans, Alan,

This is really cool! Not sure how I missed this feature, works exactly for
my use-case.

Thanks a lot for pointing this out, I was able to find it in the MAPS as
well.

Cheers,
Adam

On Sat, Aug 17, 2019 at 9:52 AM Hans Hagen  wrote:

> On 8/17/2019 3:27 AM, Alan Braslau wrote:
> > We have eofill in MP (in pdf/ps in fact) and that likely will do what
> you need.
> You forgot the MWD (Minimal Working Demo):
>
> \starttext
>
> \startMPpage
> path p ; p := fullcircle scaled 1cm ;
> path q ; q := fullcircle scaled .5cm ;
>
> nofill p ;
> eofill q ;
> \stopMPpage
>
> \stoptext
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] metafun 2

2019-08-17 Thread Hans Hagen

On 8/17/2019 3:27 AM, Alan Braslau wrote:

We have eofill in MP (in pdf/ps in fact) and that likely will do what you need.

You forgot the MWD (Minimal Working Demo):

\starttext

\startMPpage
path p ; p := fullcircle scaled 1cm ;
path q ; q := fullcircle scaled .5cm ;

nofill p ;
eofill q ;
\stopMPpage

\stoptext

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

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


Re: [NTG-context] metafun 2

2019-08-16 Thread Alan Braslau
We have eofill in MP (in pdf/ps in fact) and that likely will do what you need.

Alan


On Sat, 17 Aug 2019 00:31:38 +0100
Adam Reviczky  wrote:

> Hi Hans,
> 
> One MetaPost feature that I was looking forward to is the ability to create
> a fill between two shapes.
> Something like a difference function of two path's.
> 
> For logos I use the workaround with creating a path alongside the excluded
> areas but it is always cumbersome.
> 
> I have briefly mentioned it back here:
> https://mailman.ntg.nl/pipermail/ntg-context/2011/056910.html
> 
> Just for illustration purposes, if I wanted to fill the area in between two
> circles:
> 
> *path p ;
> **p := fullcircle scaled 1cm ;
> **path q ;
> **q := fullcircle scaled .5cm ;
> *
> 
> Instead of creating a new path along both circles with:
> 
> 
> *r := p -- reverse q -- cycle ;*
> 
> It would be nice to have something like:
> 
> *fill p excluding q ;*
> 
> or something like that.
> 
> I mainly have use-cases for differences in shapes, but filling the
> intersection of two shapes would be the same idea.
> 
> Thanks,
> Adam
> 
> 
> On Wed, Aug 14, 2019 at 10:57 AM Hans Hagen  wrote:
> 
> > Hi,
> >
> > In the process of providing an additional (more abstract) interface to
> > some of the old and also new MetaFun code we wonder what kind of
> > features users would like to see.
> >
> > http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf
> >
> > As a teaser I uploaded a MyWay document that shows some of what is
> > coming. All is experimental but it shows the direction. We're talking
> > ConTeXt LMTX here. For instance,
> >
> >  draw lmt_outline [
> >  content   = "hello",
> >  kind  = "reverse",
> >  fillcolor = "darkred",
> >  drawcolor = "darkblue",
> >  rulethickness = 1/2,
> >  ] ysized h shifted (3.75h,-1.25h) ;
> >
> > Wraps all the outline drawing in one macro with a set of options (there
> > will be xml interface definitions for that). Or take:
> >
> >  draw lmt_followtext [
> >  content = "How well does it work {\bf 1}! ",
> >  path= (fullcircle scaled 4cm),
> >  trace   = true,
> >  spread  = true,
> >  ] ysized 5cm ;
> >
> > which is an easier interface to text along a curve. Arrows can be drawn
> > with
> >
> >  draw lmt_arrow [
> >  kind= "draw",
> >  location= "middle",
> >  alternative = "curved",
> >  path= fullcircle
> >  scaled  3cm
> >  shifted (3.5cm,0cm),
> >  ] withcolor "darkblue" ;
> >
> > but of course the low level interface with its many variables for
> > tweaking stays around. Other examples are shown in the mentioned document.
> >
> > So the question is: What do you miss in metapost support? Of course it
> > should fit within the concept, so 'artistic freehand drawings' is not
> > something that is likely to get interfaced. We are particularly
> > interested in educational applications, if only because ConTeXt started
> > out that way.
> >
> > 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] metafun 2

2019-08-16 Thread Adam Reviczky
Hi Hans,

One MetaPost feature that I was looking forward to is the ability to create
a fill between two shapes.
Something like a difference function of two path's.

For logos I use the workaround with creating a path alongside the excluded
areas but it is always cumbersome.

I have briefly mentioned it back here:
https://mailman.ntg.nl/pipermail/ntg-context/2011/056910.html

Just for illustration purposes, if I wanted to fill the area in between two
circles:

*path p ;
**p := fullcircle scaled 1cm ;
**path q ;
**q := fullcircle scaled .5cm ;
*

Instead of creating a new path along both circles with:


*r := p -- reverse q -- cycle ;*

It would be nice to have something like:

*fill p excluding q ;*

or something like that.

I mainly have use-cases for differences in shapes, but filling the
intersection of two shapes would be the same idea.

Thanks,
Adam


On Wed, Aug 14, 2019 at 10:57 AM Hans Hagen  wrote:

> Hi,
>
> In the process of providing an additional (more abstract) interface to
> some of the old and also new MetaFun code we wonder what kind of
> features users would like to see.
>
> http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf
>
> As a teaser I uploaded a MyWay document that shows some of what is
> coming. All is experimental but it shows the direction. We're talking
> ConTeXt LMTX here. For instance,
>
>  draw lmt_outline [
>  content   = "hello",
>  kind  = "reverse",
>  fillcolor = "darkred",
>  drawcolor = "darkblue",
>  rulethickness = 1/2,
>  ] ysized h shifted (3.75h,-1.25h) ;
>
> Wraps all the outline drawing in one macro with a set of options (there
> will be xml interface definitions for that). Or take:
>
>  draw lmt_followtext [
>  content = "How well does it work {\bf 1}! ",
>  path= (fullcircle scaled 4cm),
>  trace   = true,
>  spread  = true,
>  ] ysized 5cm ;
>
> which is an easier interface to text along a curve. Arrows can be drawn
> with
>
>  draw lmt_arrow [
>  kind= "draw",
>  location= "middle",
>  alternative = "curved",
>  path= fullcircle
>  scaled  3cm
>  shifted (3.5cm,0cm),
>  ] withcolor "darkblue" ;
>
> but of course the low level interface with its many variables for
> tweaking stays around. Other examples are shown in the mentioned document.
>
> So the question is: What do you miss in metapost support? Of course it
> should fit within the concept, so 'artistic freehand drawings' is not
> something that is likely to get interfaced. We are particularly
> interested in educational applications, if only because ConTeXt started
> out that way.
>
> 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] metafun 2

2019-08-15 Thread Arthur Reutenauer
On Wed, Aug 14, 2019 at 10:18:19PM +1200, Henri Menke wrote:
> I just wanted to ask, will LMTX and MetaFun remain valid implementations
> of TeX and MetaPost or do we have to expect incompatibilities?

  If you mean “will luametatex pass the trip test”, the answer is
probably no: LuaTeX already diverged from Knuth’s TeX in small ways, for
example by allowing the first word of a paragraph to be hyphenated.

Best,

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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Hans Hagen

On 8/14/2019 4:58 PM, Mikael P. Sundqvist wrote:

1) 3d support. This is of course a very big request, but it would also 
be useful for many people.


yes ... Alan and I are thinking of some (not that we came far yet)

2) About graphing, it would be nice to be able to do contour polots and 
density plots. I know I asked for contour plots some time ago, and there 
were some examples, but I don't think there was ever some built in 
support for it. Maybe that can be done "easy" with help of lua? I guess 
there exist good algorithms.


spec needed ... as 'code' can be any function it's mostly a matter of 
what to pipe back to mp


3) (small) The possibility to have arrows in coordinate axes. I have not 
had the possibility to test the new features today, and maybe this is 
already built in (drawarrow?), but I mention it since I did not see it 
in the pdf.


no, but that is rather trivial to add


Again, it is very nice that you work on extending MetaPost/MetaFun further!!

wel, mp is ... fun (and these extension are somewhat challenging)

Hans

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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Hans Hagen

On 8/14/2019 4:58 PM, Otared Kavian wrote:



On 14 Aug 2019, at 16:53, Aditya Mahajan  wrote:

[…]
This looks like a typical .. vs -- issue. I think there is a way to change how 
the points are connected, but I'll have to look at the code again.

Aditya



Indeed, this seems the right explanation.
@ Hans: would it be possible to change the connecting mechanism from .. to -- ? 
(Possibly by adding an option?)


shape = "line"


Thanks for your attention,
Best regards: OK
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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




--

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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Wolfgang Schuster

Otared Kavian schrieb am 14.08.2019 um 16:58:

On 14 Aug 2019, at 16:53, Aditya Mahajan  wrote:

[…]
This looks like a typical .. vs -- issue. I think there is a way to change how 
the points are connected, but I'll have to look at the code again.

Aditya

Indeed, this seems the right explanation.
@ Hans: would it be possible to change the connecting mechanism from .. to -- ? 
(Possibly by adding an option?)

draw lmt_function [ shape = "line", ... ] ;

The argument for shape doesn't matter because only 'shape = "contour"' 
is checked to use .. as connector.


Wolfgang

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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Mikael P. Sundqvist
On Wed, Aug 14, 2019 at 11:55 AM Hans Hagen  wrote:

> Hi,
>
> In the process of providing an additional (more abstract) interface to
> some of the old and also new MetaFun code we wonder what kind of
> features users would like to see.
>
> http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf
>
> As a teaser I uploaded a MyWay document that shows some of what is
> coming. All is experimental but it shows the direction. We're talking
> ConTeXt LMTX here. For instance,
>
>  draw lmt_outline [
>  content   = "hello",
>  kind  = "reverse",
>  fillcolor = "darkred",
>  drawcolor = "darkblue",
>  rulethickness = 1/2,
>  ] ysized h shifted (3.75h,-1.25h) ;
>
> Wraps all the outline drawing in one macro with a set of options (there
> will be xml interface definitions for that). Or take:
>
>  draw lmt_followtext [
>  content = "How well does it work {\bf 1}! ",
>  path= (fullcircle scaled 4cm),
>  trace   = true,
>  spread  = true,
>  ] ysized 5cm ;
>
> which is an easier interface to text along a curve. Arrows can be drawn
> with
>
>  draw lmt_arrow [
>  kind= "draw",
>  location= "middle",
>  alternative = "curved",
>  path= fullcircle
>  scaled  3cm
>  shifted (3.5cm,0cm),
>  ] withcolor "darkblue" ;
>
> but of course the low level interface with its many variables for
> tweaking stays around. Other examples are shown in the mentioned document.
>
> So the question is: What do you miss in metapost support? Of course it
> should fit within the concept, so 'artistic freehand drawings' is not
> something that is likely to get interfaced. We are particularly
> interested in educational applications, if only because ConTeXt started
> out that way.
>
> 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
>
> ___
>

Hi,

this looks very promising!!

Since you ask for feature requests:

1) 3d support. This is of course a very big request, but it would also be
useful for many people.
2) About graphing, it would be nice to be able to do contour polots and
density plots. I know I asked for contour plots some time ago, and there
were some examples, but I don't think there was ever some built in support
for it. Maybe that can be done "easy" with help of lua? I guess there exist
good algorithms.
3) (small) The possibility to have arrows in coordinate axes. I have not
had the possibility to test the new features today, and maybe this is
already built in (drawarrow?), but I mention it since I did not see it in
the pdf.

Again, it is very nice that you work on extending MetaPost/MetaFun further!!

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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Otared Kavian

> On 14 Aug 2019, at 16:53, Aditya Mahajan  wrote:
> 
> […]
> This looks like a typical .. vs -- issue. I think there is a way to change 
> how the points are connected, but I'll have to look at the code again.
> 
> Aditya


Indeed, this seems the right explanation.
@ Hans: would it be possible to change the connecting mechanism from .. to -- ? 
(Possibly by adding an option?)

Thanks for your attention, 
Best regards: OK
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Aditya Mahajan

On Wed, 14 Aug 2019, Otared Kavian wrote:


Hi Hans,

Thank you very much for the new features! I haven't yet read all the 
mag-1104-mkiv.pdf where you explain some of them, but after modifying one of 
your examples, I noticed that some funtions get a strange graph, which is 
probably due to the fact that metafun2 is interpolating between points in a way 
which is not correct.
For instance, in the following example (which is a slight modification of 
yours), the curve drawn is not a graph, in the sense that for some values of x 
it seems to be two or more values of y.

How does metafun 2 traces the curve between two discretization points?

Best regards: OK

%%% begin draw-2.tex

\starttext
\startMPcode{doublefun}
draw lmt_function [
xmin =  1.0, xmax = 2.5066283, xstep = .1,
ymin = -2, ymax =  2,
%   xticks = "bottom", xsmall = 80, xlarge = 20,
%   yticks = "left", ysmall = 40, ylarge = 4,
code = "1.5 * math.sin(2*x^2)",
xlabels = "yes",
ylabels = "yes",
ycaption = "\strut\tfd \rotate[rotation=90]{vertical}",
xcaption = "\strut\tfd horizontal",
pointsymbol = "dot", pointsize = 4, pointcolor = "orange",
sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm,
]
xsized 8cm ;
\stopMPcode

\stoptext


This looks like a typical .. vs -- issue. I think there is a way to change 
how the points are connected, but I'll have to look at the code again.


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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Hans Hagen

On 8/14/2019 4:22 PM, Otared Kavian wrote:

Hi Hans,

Thank you very much for the new features! I haven't yet read all the 
mag-1104-mkiv.pdf where you explain some of them, but after modifying one of 
your examples, I noticed that some funtions get a strange graph, which is 
probably due to the fact that metafun2 is interpolating between points in a way 
which is not correct.
For instance, in the following example (which is a slight modification of 
yours), the curve drawn is not a graph, in the sense that for some values of x 
it seems to be two or more values of y.

How does metafun 2 traces the curve between two discretization points?


it doesn't, it just connects the dots, so, just use a smaller step, like

xstep = .01

(The upcoming luagraph module will provide some interpolators so at some 
point we can hook these in.)


(btw, there are a lot of extra math functions, also or complex numbers)


Best regards: OK

%%% begin draw-2.tex

\starttext
\startMPcode{doublefun}
draw lmt_function [
xmin =  1.0, xmax = 2.5066283, xstep = .1,
ymin = -2, ymax =  2,
%   xticks = "bottom", xsmall = 80, xlarge = 20,
%   yticks = "left", ysmall = 40, ylarge = 4,
code = "1.5 * math.sin(2*x^2)",
xlabels = "yes",
ylabels = "yes",
ycaption = "\strut\tfd \rotate[rotation=90]{vertical}",
xcaption = "\strut\tfd horizontal",
pointsymbol = "dot", pointsize = 4, pointcolor = "orange",
sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm,
]
xsized 8cm ;
\stopMPcode

\stoptext

%%% end draw-2.tex


Hans

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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Otared Kavian
Hi Hans,

Thank you very much for the new features! I haven't yet read all the 
mag-1104-mkiv.pdf where you explain some of them, but after modifying one of 
your examples, I noticed that some funtions get a strange graph, which is 
probably due to the fact that metafun2 is interpolating between points in a way 
which is not correct.
For instance, in the following example (which is a slight modification of 
yours), the curve drawn is not a graph, in the sense that for some values of x 
it seems to be two or more values of y.

How does metafun 2 traces the curve between two discretization points?

Best regards: OK

%%% begin draw-2.tex

\starttext
\startMPcode{doublefun} 
draw lmt_function [
xmin =  1.0, xmax = 2.5066283, xstep = .1,
ymin = -2, ymax =  2,
%   xticks = "bottom", xsmall = 80, xlarge = 20, 
%   yticks = "left", ysmall = 40, ylarge = 4,
code = "1.5 * math.sin(2*x^2)", 
xlabels = "yes",
ylabels = "yes",
ycaption = "\strut\tfd \rotate[rotation=90]{vertical}",
xcaption = "\strut\tfd horizontal",
pointsymbol = "dot", pointsize = 4, pointcolor = "orange",
sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm, 
]
xsized 8cm ;
\stopMPcode

\stoptext

%%% end draw-2.tex



draw-2.pdf
Description: Adobe PDF document


> On 14 Aug 2019, at 11:54, Hans Hagen  wrote:
> 
> Hi,
> 
> In the process of providing an additional (more abstract) interface to some 
> of the old and also new MetaFun code we wonder what kind of features users 
> would like to see.
> 
> http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf
> 
> As a teaser I uploaded a MyWay document that shows some of what is coming. 
> All is experimental but it shows the direction. We're talking ConTeXt LMTX 
> here. For instance,
> 
>draw lmt_outline [
>content   = "hello",
>kind  = "reverse",
>fillcolor = "darkred",
>drawcolor = "darkblue",
>rulethickness = 1/2,
>] ysized h shifted (3.75h,-1.25h) ;
> 
> Wraps all the outline drawing in one macro with a set of options (there will 
> be xml interface definitions for that). Or take:
> 
>draw lmt_followtext [
>content = "How well does it work {\bf 1}! ",
>path= (fullcircle scaled 4cm),
>trace   = true,
>spread  = true,
>] ysized 5cm ;
> 
> which is an easier interface to text along a curve. Arrows can be drawn with
> 
>draw lmt_arrow [
>kind= "draw",
>location= "middle",
>alternative = "curved",
>path= fullcircle
>scaled  3cm
>shifted (3.5cm,0cm),
>] withcolor "darkblue" ;
> 
> but of course the low level interface with its many variables for tweaking 
> stays around. Other examples are shown in the mentioned document.
> 
> So the question is: What do you miss in metapost support? Of course it should 
> fit within the concept, so 'artistic freehand drawings' is not something that 
> is likely to get interfaced. We are particularly interested in educational 
> applications, if only because ConTeXt started out that way.
> 
> 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] metafun 2

2019-08-14 Thread Hans Hagen

On 8/14/2019 1:31 PM, Floris van Manen wrote:

where can i find the steps to install lmtx next to my current context
luatex ?

http://pragma-ade.nl/install.htm

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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Floris van Manen
where can i find the steps to install lmtx next to my current context
luatex ?

.F


pEpkey.asc
Description: application/pgp-keys
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Hans Hagen

On 8/14/2019 12:18 PM, Henri Menke wrote:

Dear Hans,

I just wanted to ask, will LMTX and MetaFun remain valid implementations
of TeX and MetaPost or do we have to expect incompatibilities?
It depends on how you define 'valid' ... we're downward compatible ... 
but LMTX will use features available in luametatex, so when that is the 
case some code will only be available in LMTX (unless i decide to 
backport some). Wrr the TeX part: LMTX is mostly MKIV but it might 
provide extra things (or different implementations). Wrr metapost: lmtx 
can do more advanced things. There is a split context code base.


I expect most users to move on to lmtx anyway at some point. Maybe at 
some point the existing mkiv will be like mkii: frozen.


Hans

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

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


Re: [NTG-context] metafun 2

2019-08-14 Thread Henri Menke
Dear Hans,

I just wanted to ask, will LMTX and MetaFun remain valid implementations
of TeX and MetaPost or do we have to expect incompatibilities?

Cheers, Henri

On 14/08/19 9:54 PM, Hans Hagen wrote:
> Hi,
> 
> In the process of providing an additional (more abstract) interface to 
> some of the old and also new MetaFun code we wonder what kind of 
> features users would like to see.
> 
> http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf
> 
> As a teaser I uploaded a MyWay document that shows some of what is 
> coming. All is experimental but it shows the direction. We're talking 
> ConTeXt LMTX here. For instance,
> 
>  draw lmt_outline [
>  content   = "hello",
>  kind  = "reverse",
>  fillcolor = "darkred",
>  drawcolor = "darkblue",
>  rulethickness = 1/2,
>  ] ysized h shifted (3.75h,-1.25h) ;
> 
> Wraps all the outline drawing in one macro with a set of options (there 
> will be xml interface definitions for that). Or take:
> 
>  draw lmt_followtext [
>  content = "How well does it work {\bf 1}! ",
>  path= (fullcircle scaled 4cm),
>  trace   = true,
>  spread  = true,
>  ] ysized 5cm ;
> 
> which is an easier interface to text along a curve. Arrows can be drawn 
> with
> 
>  draw lmt_arrow [
>  kind= "draw",
>  location= "middle",
>  alternative = "curved",
>  path= fullcircle
>  scaled  3cm
>  shifted (3.5cm,0cm),
>  ] withcolor "darkblue" ;
> 
> but of course the low level interface with its many variables for 
> tweaking stays around. Other examples are shown in the mentioned document.
> 
> So the question is: What do you miss in metapost support? Of course it 
> should fit within the concept, so 'artistic freehand drawings' is not 
> something that is likely to get interfaced. We are particularly 
> interested in educational applications, if only because ConTeXt started 
> out that way.
> 
> 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] metafun 2

2019-08-14 Thread Hans Hagen

Hi,

In the process of providing an additional (more abstract) interface to 
some of the old and also new MetaFun code we wonder what kind of 
features users would like to see.


http://www.pragma-ade.com/general/magazines/mag-1104-mkiv.pdf

As a teaser I uploaded a MyWay document that shows some of what is 
coming. All is experimental but it shows the direction. We're talking 
ConTeXt LMTX here. For instance,


draw lmt_outline [
content   = "hello",
kind  = "reverse",
fillcolor = "darkred",
drawcolor = "darkblue",
rulethickness = 1/2,
] ysized h shifted (3.75h,-1.25h) ;

Wraps all the outline drawing in one macro with a set of options (there 
will be xml interface definitions for that). Or take:


draw lmt_followtext [
content = "How well does it work {\bf 1}! ",
path= (fullcircle scaled 4cm),
trace   = true,
spread  = true,
] ysized 5cm ;

which is an easier interface to text along a curve. Arrows can be drawn 
with


draw lmt_arrow [
kind= "draw",
location= "middle",
alternative = "curved",
path= fullcircle
scaled  3cm
shifted (3.5cm,0cm),
] withcolor "darkblue" ;

but of course the low level interface with its many variables for 
tweaking stays around. Other examples are shown in the mentioned document.


So the question is: What do you miss in metapost support? Of course it 
should fit within the concept, so 'artistic freehand drawings' is not 
something that is likely to get interfaced. We are particularly 
interested in educational applications, if only because ConTeXt started 
out that way.


Hans



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

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


Re: [NTG-context] Some macros (Metafun)

2019-08-11 Thread Hans Hagen

On 8/12/2019 12:40 AM, Fabrice Couvreur wrote:

Hi Hans,
Sorry but I did not see your email.
What is the default color used to draw the path p ?


drawlineoptions   (withpen pencircle scaled 1.0 drawoptionsfactor 
withcolor .5white) ;
drawpointoptions  (withpen pencircle scaled 4.0 drawoptionsfactor 
withcolor   black) ;
drawcontroloptions(withpen pencircle scaled 2.5 drawoptionsfactor 
withcolor   black) ;
drawpathoptions   (withpen pencircle scaled 5.0 drawoptionsfactor 
withcolor .8white) ;



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

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


Re: [NTG-context] Some macros (Metafun)

2019-08-11 Thread Fabrice Couvreur
Hi Hans,
Sorry but I did not see your email.
What is the default color used to draw the path p ?
Thank you.

Le ven. 9 août 2019 à 13:12, Hans Hagen  a écrit :

> On 8/9/2019 10:57 AM, Fabrice Couvreur wrote:
> > Hello,
> > In the Metafun manual, Hans uses macros like drawpath p ;
> > drawcontrollines p ; drawpoints p ; drawcontrolpoints p ...
> > How to use them in a document ?
> > Where to find source codes ?
> > For example, the following code does not work :
> >
> > \starttext
> > \startuseMPgraphic{path}
> > path p ; p := (1cm,1cm)--(1.5cm,1.5cm)..(2cm,0cm)..cycle ;
> > \stopuseMPgraphic
> >
> > \startMPcode
> >p := p .. cycle ; swappointlabels := true ;
> >drawpath p ;
> > \stopMPcode
> > \stoptext
> \starttext
>
> \startMPcode
>  path p ; p := (1cm,1cm)--(1.5cm,1.5cm)..(2cm,0cm)..cycle ;
>  drawpath p ;
>  drawpoints p ;
>  drawpointlabels p ;
>  drawcontrolpoints p ;
>  drawcontrollines p ;
> \stopMPcode
>
> \stoptext
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Wrong MetaPost text output

2019-08-11 Thread Alan Braslau
On Sun, 11 Aug 2019 11:12:55 -0700
Henri Menke  wrote:

> Thank you for the quick repsonse.  This looks good to me.  However,
> could you tell me a way to get the correct baseline with textext?  When
> I use
> 
> \startMPpage
> draw btex dummy etex shifted (0,0);
> draw btex foo   etex shifted (1.5cm,0);
> \stopMPpage
> 
> the baseline is the one that I would expect from TeX, i.e. at the depth
> of the “y” is removed or otherwise correctly accounted for.  In contrast
> when I use
> 
> \startMPpage
> draw textext("dummy") shifted (0,0);
> draw textext("foo")   shifted (1.5cm,0);
> \stopMPpage
> 
> the baseline will be below the depth of the “y” which is sometimes
> unwanted.

textext() is actually textext@#()
so you can use textext.top() for example
to put the *bottom* of the text bounding box at y=0.
Without any @# suffix, the text bounding box gets centered at y=0.

Metafun has a few *new* suffixes defined, so you can use
textext.d(), textext.dlft(), textext.drt(), I BELIEVE,
to position with respect to the tex baseline.
(you need to check this).

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

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


Re: [NTG-context] Some macros (Metafun)

2019-08-09 Thread Hans Hagen

On 8/9/2019 10:57 AM, Fabrice Couvreur wrote:

Hello,
In the Metafun manual, Hans uses macros like drawpath p ; 
drawcontrollines p ; drawpoints p ; drawcontrolpoints p ...

How to use them in a document ?
Where to find source codes ?
For example, the following code does not work :

\starttext
\startuseMPgraphic{path}
    path p ; p := (1cm,1cm)--(1.5cm,1.5cm)..(2cm,0cm)..cycle ;
\stopuseMPgraphic

\startMPcode
   p := p .. cycle ; swappointlabels := true ;
   drawpath p ;
\stopMPcode
\stoptext

\starttext

\startMPcode
path p ; p := (1cm,1cm)--(1.5cm,1.5cm)..(2cm,0cm)..cycle ;
drawpath p ;
drawpoints p ;
drawpointlabels p ;
drawcontrolpoints p ;
drawcontrollines p ;
\stopMPcode

\stoptext


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

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


[NTG-context] Some macros (Metafun)

2019-08-09 Thread Fabrice Couvreur
Hello,
In the Metafun manual, Hans uses macros like drawpath p ; drawcontrollines
p ; drawpoints p ; drawcontrolpoints p ...
How to use them in a document ?
Where to find source codes ?
For example, the following code does not work :

\starttext
\startuseMPgraphic{path}
   path p ; p := (1cm,1cm)--(1.5cm,1.5cm)..(2cm,0cm)..cycle ;
\stopuseMPgraphic

\startMPcode
  p := p .. cycle ; swappointlabels := true ;
  drawpath p ;
\stopMPcode
\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] lmtx

2019-08-05 Thread Hans Hagen

Hi,

As we're progressing with the lmtx project (aka luametatex + context) 
the codebase gets adapted a bit. There are a few things that you need to 
keep an eye on:


- As we test with lua 5.4 it can be that you need to wipe the
  cache after an update due to differences in byte code. This
  is only needed when you run into issues. At some point there
  might be a split in lua code (for luatex and luametatex) as
  5.2 (luajittex, not evolving), 5.3 (luatex, stable frozen)
  and 5.4 (luametatex, experimental progressing) have a couple
  of different properties that we might want to benefit from.

- The code base gets split in "Mark Four" and "Mark Fourty"
  files. Some of these are permanent, some can be temporary. It
  can for instance relate to features in and experiments with
  the engine. The only convenient way to test things is in
  'real situations' and often issues can be solved fast.

- As we're experimenting with metafun (and luagraph and ...) we
  also explore new interfaces. This results in a different
  codebase but should go unnoticed for existing code. Of course
  metafun 2.0 (hip and modern internet version speak) can bring
  interesting new things in the end.

As usual, happy testing.

Hans

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

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


Re: [NTG-context] suggestion for LMTX

2019-04-27 Thread Pablo Rodriguez
On 4/27/19 1:15 PM, Hans Hagen wrote:
> On 4/27/2019 12:22 PM, Pablo Rodriguez wrote:
>> Hi Hans,
>>
>> compiling the following sample with LMTX
>> [...]
>>   \contextmark
>> [...]
>> outputs MKIV.
>>
>> Wouldn’t LMTX be a better option than LMTX?
>
> Why? Although there are some fundamental differences deep down, the LMTX
> version has the MKIV functionality. There might be a point where we bind
> a frozen version of MKIV to LuaTeX, but only when the code base becomes
> too hybrid to my taste. Of course there will be functionality only
> available when you use LMTX, but that is something Wolfgang and I need
> to figure out wrr the interface specification. Also, Alan and I need to
> deal with in the MetaFun code and documentation. At some point Taco and
> Mojca might want granularity in the Wiki. We'll see. I have no clue when
> users will have switched to lmtx for production anyway, as it's not
> something we want to enforce. (fwfw: I run lmtx by default.)

Well, it was only an idea... which seems to be wrong.

Many thanks for your help,

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

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


Re: [NTG-context] suggestion for LMTX

2019-04-27 Thread Hans Hagen

On 4/27/2019 12:22 PM, Pablo Rodriguez wrote:

Hi Hans,

compiling the following sample with LMTX

 \starttext
 \contextmark

 \contextbanner
 \stoptext

outputs MKIV.

Wouldn’t LMTX be a better option than LMTX?


Why? Although there are some fundamental differences deep down, the LMTX 
version has the MKIV functionality. There might be a point where we bind 
a frozen version of MKIV to LuaTeX, but only when the code base becomes 
too hybrid to my taste. Of course there will be functionality only 
available when you use LMTX, but that is something Wolfgang and I need 
to figure out wrr the interface specification. Also, Alan and I need to 
deal with in the MetaFun code and documentation. At some point Taco and 
Mojca might want granularity in the Wiki. We'll see. I have no clue when 
users will have switched to lmtx for production anyway, as it's not 
something we want to enforce. (fwfw: I run lmtx by default.)


Hans

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

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


Re: [NTG-context] tikz is not found

2019-04-24 Thread Gour
On Wed, 24 Apr 2019 09:29:26 -0600
Alan Braslau  wrote:

> Hans explained that third party modules are not automatically
> distributed or installed (yet) by the lmtx install.sh script. 

Ahh...I apologize for creating extra noise then. :-(

> All that you need to do is to copy the texmf-modules directory from a
> standard context distribution to the lmtx tree.

OK. Will try to do it.

> If you are intending on preparing math exams, I may suggest that
> native MetaPost IS better adapted for many reasons AND easier to use
> in ConTeXt.

I believe it is, but it seems that learning curve is steeper, while
GeoGebra is quite easy to easy...However, I downloaded MetaPost manual
and will test how it goes.

> Because your (or someone's) mail application replaced -- with
> emdashes.

That I spotted and corrected, but I'm getting another error, I suppose:

$ cat  mp.tex
\starttext
Lorem Ipsum…

\startMPcode
draw ( (0,0)--(1,0)--(0,1)) with color red ;
\stopMPcode

\stoptext

gives:

$ context mp.tex 
mtx-context | run 1: luatex
--fmt="/var/lib/texmf/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/formats/luatex/cont-en"
--jobname="mp"
--lua="/var/lib/texmf/luatex-cache/context/b47c3d3cee7cb6c86268d0595268c442/formats/luatex/cont-en.lui"
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./mp.tex"
--c:input="./mp.tex" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"

This is LuaTeX, Version 1.07.0 (TeX Live 2019/dev/Debian) 
 system commands enabled.
open source > level 1, order 1, name
'/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv' system
> system  > ConTeXt  ver: 2018.04.04 00:51 MKIV beta  fmt:
> 2019.4.24  int: english/english
system  > 
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name
'/usr/share/texmf/tex/context/base/mkiv/cont-new.mkiv' close source
> level 2, order 2, name
> '/usr/share/texmf/tex/context/base/mkiv/cont-new.mkiv'
> system  > files > jobname 'mp', input './mp', result 'mp'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/gour/prj/tex/mp.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
metapost> initializing instance 'metafun' using format 'metafun'
metapost> loading 'metafun' as
'/usr/share/texmf/metapost/context/base/mpiv/metafun.mpiv' using method
'default' metapost> initializing number mode 'scaled'

tex error   > mp error on line 6 in file /home/gour/prj/tex/mp.tex:

>> currentpen.with
! Improper type.

color
<*> draw ( (0,0)--(1,0)--(0,1)) with color
red ; ;
Next time say `withpen ';
I'll ignore the bad `with' clause and look for another.

! Extra tokens will be flushed.

color
<*> draw ( (0,0)--(1,0)--(0,1)) with color
red ; ;
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]

1 \starttext
2 Lorem Ipsum…
3 
4 \startMPcode
5 draw ( (0,0)--(1,0)--(0,1)) with color red ;
6 >>  \stopMPcode
7 
8 \stoptext
9 


? 


Any hint?


Sincerely,
Gour

-- 
An intelligent person does not take part in the sources of misery,
which are due to contact with the material senses. O son of Kuntī,
such pleasures have a beginning and an end, and so the wise man does
not delight in them.

-- 
One must deliver himself with the help of his mind, and not
degrade himself. The mind is the friend of the conditioned soul,
and his enemy as well.


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] preparing math exams

2019-04-24 Thread Marcin Borkowski

On 2019-04-23, at 17:57, Fabrice L  wrote:

> Metapost (Metafun) is your best friend here. You can insert directly in

Also, TikZ, which is more LaTeX-centric, but works with ConTeXt, too (at
least it did when I last tried ConTeXt a few years ago).

Hth,

-- 
Marcin Borkowski
http://mbork.pl
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] preparing math exams

2019-04-24 Thread Gour
On Tue, 23 Apr 2019 11:57:34 -0400
Fabrice L  wrote:

> Metapost (Metafun) is your best friend here. You can insert directly
> in context some MetaFun code, like this:
> 
> \starttext
> Lorem Ipsum…
> 
> \startMPcode
> draw ( (0,0) — (1,0) — (0,1)) with color red ;
> \stopMPcode
> 
> \stoptext
> 

That example does not work for me, but I've got a clue.

However, someone in other forum suggested me to use GeoGebra - that's
what even math textboooks use here which is interactive and can, amongst
several other formats, export to TikZ, and in the beginning it seems as
quicker/easier start.


Sincerely,
Gour

-- 
In this endeavor there is no loss or diminution,
and a little advancement on this path can protect
one from the most dangerous type of fear.


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 on curves

2019-04-23 Thread Keith McKay
I have been trying to typeset text onto curves and have been successful 
with the help of the MetaFun manual, and the followtext command which I 
saw in some correspondence between dr Hans van der Meer and Hans Hagen 
on the mailing list in January this year ( the subject was Double Follow 
Tokens).


The followtext command seems to used for a simple line of text and if I 
increase the number of words in the line the font size is reduced to 
make it fit to the length of the curve (see MWE below). I would like to 
typeset complete paragraphs on the curve(s) and the only way I see of 
doing this without the font size changing is to manually create each 
line separately.


Is their a way where this can be done by MetaFun automatically rather 
than manually? It would be really nice if I could create a number of 
curves and then MetaFun typsets a paragraph of text on to them. Also, 
can other options be used with followtext e.g. \input file?


I'm a complete novice with MetaFun so any advice appreciated.

Best Wishes

Keith McKay

Minimum Working Example

\starttext

Two different lengths of text on the same curve showing font size being 
reduced.


\blank

\startMPcode

path q; q := function (1, "x", "sin(2x)" , 1, 10, .01) scaled 1.5cm ;

draw followtext(q, "some text but not that long. But here and there and 
everywhere the text can become longer");


draw followtext (q shifted (0cm,-2cm), "some text but not that long. But 
here and there and everywhere the text can become longer and longer and 
longer finally ending here.");


\stopMPcode

Some other examples of text on a curve

\blank

\startMPcode

path p; p := reverse halfcircle xyscaled 55mm ;

draw followtext(p, "some text but not that long");

\stopMPcode

nice spiral shape with text

\startMPcode

z0 = (0,0); z1 = (60,40);

z2 = (40,90); z3 = (10,70);

z4 = (30,50);

path p; p = (z0..z1..z2..z3..z4) ;

draw followtext(p scaled 1mm, "some text but not that long. But here and 
there and everywhere the text can become longer");


\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] preparing math exams

2019-04-23 Thread Fabrice L
Hi,

Le 23 avril 2019 à 11:10:11, Gour (g...@atmarama.com) a écrit:

Hello,

For regular formulas involving e.g. rational numbers, I'm sure that
input language for math is quite sufficient, but wonder about drawing
part?


Metapost (Metafun) is your best friend here. You can insert directly in
context some MetaFun code, like this:

\starttext
Lorem Ipsum…

\startMPcode
draw ( (0,0) — (1,0) — (0,1)) with color red ;
\stopMPcode

\stoptext

Look at this entry in the wiki:
https://wiki.contextgarden.net/MetaPost_in_ConTeXt

Also, you will find a link to the meta fun manual in this page, this a good
place to start !
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] using metapost library makecirc with context.

2019-04-20 Thread Hans Hagen

On 4/20/2019 11:16 PM, Alan Braslau wrote:

On Sat, 20 Apr 2019 23:00:09 +0200
Hans Hagen  wrote:


On 4/20/2019 10:09 PM, Andrea De Michele wrote:


I didn't understand the magic behind that  but it's works.


mp has no real text typesetting options so this hack provides it


Why not
let latex=textext ;


That crashed here.


Another question: there is a library to draw electrics circuit
alternative to makecirc but more context/metafun friendly?

the node library but it lacks things for drawing resistors ... i'll
discuss this whith alan


I played with makecirc a while back (and I even used it to make simple circuit 
diagrams that I used in a patent application). A real electronic circuit 
drawing program these days will do circuit board layouts and automatic routing, 
etc. I'm not sure that we want to get into this with MP.

I assume only for some simple educational drawings.

Hans


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

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


Re: [NTG-context] using metapost library makecirc with context.

2019-04-20 Thread Alan Braslau
On Sat, 20 Apr 2019 23:00:09 +0200
Hans Hagen  wrote:

> On 4/20/2019 10:09 PM, Andrea De Michele wrote:
> 
> > I didn't understand the magic behind that  but it's works.  
> 
> mp has no real text typesetting options so this hack provides it

Why not
let latex=textext ;

> > Another question: there is a library to draw electrics circuit
> > alternative to makecirc but more context/metafun friendly?  
> the node library but it lacks things for drawing resistors ... i'll 
> discuss this whith alan

I played with makecirc a while back (and I even used it to make simple circuit 
diagrams that I used in a patent application). A real electronic circuit 
drawing program these days will do circuit board layouts and automatic routing, 
etc. I'm not sure that we want to get into this with MP.

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

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


Re: [NTG-context] using metapost library makecirc with context.

2019-04-20 Thread Hans Hagen

On 4/20/2019 10:09 PM, Andrea De Michele wrote:


I didn't understand the magic behind that  but it's works.


mp has no real text typesetting options so this hack provides it


Another question: there is a library to draw electrics circuit
alternative to makecirc but more context/metafun friendly?
the node library but it lacks things for drawing resistors ... i'll 
discuss this whith alan


Hans

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

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


Re: [NTG-context] using metapost library makecirc with context.

2019-04-20 Thread Andrea De Michele
Hans Hagen  writes:

> On 4/19/2019 5:48 PM, Andrea De Michele wrote:
>>
>> I'm trying to use with Context  makecirc a metapost library to draw
>> electric circuits, but I have problems with the labels of the circuits
>> element that are not displayed correctly.
>>
>> FIRST EXAMPLE (No labels are displayed)
>> -
>> \starttext
>>
>> \startMPinclusions
>>input makecirc;
>> \stopMPinclusions
>>
>>
>> \startstaticMPfigure{circ1}
>>  u:= 1cm ;
>>  source.e((0,0u),DC,90,"\Delta V","2V") ;
>>  resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
>>  resistor.b((2u,-1u),normal,90,"R_2","2$\Omega$") ;
>>  wire(S.e.p,R.a.r,udsq) ;
>>  wire(S.e.n,R.b.l,udsq) ;
>>  wire(R.a.l,R.b.r,udsq) ;
>> \stopstaticMPfigure
>> \usestaticMPfigure[circ1]
>>
>> \stoptext
> I searched ctab for that library and it has soem hard wired latex
> stuff in it. You can make latex.mp empty (to play safe),
>
> Load the file with:
>
> \startMPinclusions
> string LaTeXsetup ; LaTeXsetup := "";
> input "makecirc.mp";
> vardef latex(expr t) = textext(t) enddef ;
> \stopMPinclusions
>
> I didn't look into the details but yoru example runs then.
>
>
> 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
> ___
>
Thank you,

I didn't understand the magic behind that  but it's works.

Another question: there is a library to draw electrics circuit
alternative to makecirc but more context/metafun friendly?



-- 
Andrea De Michele

-- 
Andrea De Michele

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] gnuplot-module broken under lmtx

2019-04-10 Thread Hans Hagen

On 4/10/2019 4:34 PM, Christian Prim wrote:

Hi

It's little off-topic as there are officially no modules included in 
lmtx. But when I used the modules from a mkiv-installation, there was 
little to no problem. But with the gnuplot-module I can't fix the error 
myself.


not off-topic .. as modules should also work ok in lmtx

fixed in next beta (probably tommorrow an upload)

Hans


MWE:
\usemodule[gnuplot]
\startGNUPLOTscript[sin]
    plot sin(x)
\stopGNUPLOTscript

\starttext
\placefigure[here]{Sine Test}{\useGNUPLOTgraphic[sin]}
\stoptext

Under mkiv everything is fine. mkiv creates a 
file gnuplot-gnuplot-1.plt, sends this file to gnuplot and uses the 
output gnuplot-gnuplot-1-ctx.tex.


Under lmtx only the files gnuplot-gnuplot-1.tmp 
and gnuplot-gnuplot-inclusions.tmp are created. When I copy the correct 
.plt file from a mkiv-run, no gnuplot-gnuplot-1-ctx.tex is generated. If 
I copy the correct -ctx.tex file from a mkiv-run, I still get an error.


Relevant part from the logfile of a working mkiv-run:
modules         > 'gnuplot' is loaded
open source     > level 3, order 4, name 
'/home/user/context/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

loading         > Gnuplot module
open source     > level 4, order 5, name 
'/home/user/context/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 4, order 5, name 
'/home/user/context/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 3, order 5, name 
'/home/user/context/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
open source     > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
close source    > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
metapost        > initializing instance 'metafun:1' using format 
'metafun' and method 'default'
metapost        > loading 'metafun' as 
'/home/user/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv' 
using method 'default'

metapost        > initializing number mode 'scaled'
floatblocks     > '1' placed (here)

from a lmtx-run (no .plt-file and -ctx.tex given):

modules         > 'gnuplot' is loaded
open source     > level 3, order 4, name 
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

loading         > Gnuplot module
open source     > level 4, order 5, name 
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 4, order 5, name 
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 3, order 5, name 
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
mtxrun          |
mtxrun          | executing: gnuplot gnuplot-gnuplot-1.plt
mtxrun          |
mtxrun          |
/home/user/lmtx/tex/texmf-linux-64/bin/mtxrun.lua:26166: attempt to call 
a nil value (field 'exec')

aaa             > mtxrun --direct gnuplot gnuplot-gnuplot-1.plt
floatblocks     > no block given
floatblocks     > '1' placed (here)

lmtx with given .plt and -ctx.tex-file:

modules         > 'gnuplot' is loaded
open source     > level 3, order 4, name 
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

loading         > Gnuplot module
open source     > level 4, order 5, name 
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 4, order 5, name 
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 3, order 5, name 
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
mtxrun          |
mtxrun          | executing: gnuplot gnuplot-gnuplot-1.plt
mtxrun          |
mtxrun          |
/home/user/lmtx/tex/texmf-linux-64/bin/mtxrun.lua:26166: attempt to call 
a nil value (field 'exec')

aaa             > mtxrun --direct gnuplot gnuplot-gnuplot-1.plt
open source     > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
close source    > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
metapost        > initializing instance 'metafun:1' using format 
'metafun' and method 'default'
metapost        > loading 'metafun' as 
'/home/user/lmtx/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv' 
using method 'default'

metapost        > initializing number mode 'scaled'
floatblocks     > '1' placed (here)

tex error       > tex error on line 1 in file gnuplot-gnuplot-1-ctx.tex: 
! Undefined c

[NTG-context] gnuplot-module broken under lmtx

2019-04-10 Thread Christian Prim
Hi

It's little off-topic as there are officially no modules included in lmtx.
But when I used the modules from a mkiv-installation, there was little to
no problem. But with the gnuplot-module I can't fix the error myself.

MWE:
\usemodule[gnuplot]
\startGNUPLOTscript[sin]
   plot sin(x)
\stopGNUPLOTscript

\starttext
\placefigure[here]{Sine Test}{\useGNUPLOTgraphic[sin]}
\stoptext

Under mkiv everything is fine. mkiv creates a file gnuplot-gnuplot-1.plt,
sends this file to gnuplot and uses the output gnuplot-gnuplot-1-ctx.tex.

Under lmtx only the files gnuplot-gnuplot-1.tmp
and gnuplot-gnuplot-inclusions.tmp are created. When I copy the correct
.plt file from a mkiv-run, no gnuplot-gnuplot-1-ctx.tex is generated. If I
copy the correct -ctx.tex file from a mkiv-run, I still get an error.

Relevant part from the logfile of a working mkiv-run:
modules > 'gnuplot' is loaded
open source > level 3, order 4, name
'/home/user/context/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'
loading > Gnuplot module
open source > level 4, order 5, name
'/home/user/context/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 4, order 5, name
'/home/user/context/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 3, order 5, name
'/home/user/context/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
open source > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
close source> level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
metapost    > initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/home/user/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
using method 'default'
metapost> initializing number mode 'scaled'
floatblocks > '1' placed (here)

from a lmtx-run (no .plt-file and -ctx.tex given):

modules > 'gnuplot' is loaded
open source > level 3, order 4, name
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'
loading > Gnuplot module
open source > level 4, order 5, name
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 4, order 5, name
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 3, order 5, name
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
mtxrun  |
mtxrun  | executing: gnuplot gnuplot-gnuplot-1.plt
mtxrun  |
mtxrun  |
/home/user/lmtx/tex/texmf-linux-64/bin/mtxrun.lua:26166: attempt to call a
nil value (field 'exec')
aaa > mtxrun --direct gnuplot gnuplot-gnuplot-1.plt
floatblocks > no block given
floatblocks > '1' placed (here)

lmtx with given .plt and -ctx.tex-file:

modules > 'gnuplot' is loaded
open source > level 3, order 4, name
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'
loading > Gnuplot module
open source > level 4, order 5, name
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 4, order 5, name
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source> level 3, order 5, name
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
mtxrun  |
mtxrun  | executing: gnuplot gnuplot-gnuplot-1.plt
mtxrun  |
mtxrun  |
/home/user/lmtx/tex/texmf-linux-64/bin/mtxrun.lua:26166: attempt to call a
nil value (field 'exec')
aaa > mtxrun --direct gnuplot gnuplot-gnuplot-1.plt
open source > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
close source> level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
metapost    > initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/home/user/lmtx/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
using method 'default'
metapost> initializing number mode 'scaled'
floatblocks > '1' placed (here)

tex error   > tex error on line 1 in file gnuplot-gnuplot-1-ctx.tex: !
Undefined control sequence

 \GNUPLOTfile
 -ctx.tex
\fourthoffivearguments #1#2#3#4#5->#4

 set output "\@@GNUPLOTresult
 "

}\endwrite
 \shipoutscratchbox

\page_shipout_box #1->\clf_shipoutpage

Re: [NTG-context] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Romain Diss
Le 18/03/2019, Aditya Mahajan a �crit
> On Mon, 18 Mar 2019, Romain Diss wrote:
> 
> > Le 13/03/2019, Aditya Mahajan a �crit
> > > > Is there a simple way to split a large \startframedtext environment over
> > > > multiple pages. It doesn't work out of the box and I didn't find any
> > > > option make it work in the wiki nor in the documentation I read.
> > > 
> > > Use backgrounds or textbackgrounds.
> > Thank you but I still can't achieve what I want to do whith this
> > command.
> > 
> > I try to make something similar to the frames in the
> > "mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
> > examples).
> > I suppose Hans Hagen made use of metafun to do it but I encounter some
> > problems with 'textbackgrounds'.
> > 
> > In this minimal example, the frame doesn't appear (or if i set
> > [frame=on,leftframe=off] all the frame is rendered) and the left and
> > right offsets are not took into account.
> 
> textbackground uses metapost for ALL backgrounds and the default metapost
> code to draw the background (draw_multi_pars, defined in mp-abck.mkiv)
> doesn't handle individual frames. So, you have to write your own metapost
> code to draw the side bar.
> 
> Another option for simple backgrounds is to use `\definebackground` instead
> of `definetextbackground`. The background mechanism doesn't have too many
> options, but does honor leftframe and rightframe by default.

It will take some time to understand everything in "mp-abck.mpiv" but it
will sure be very interesting.

Thank you.

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Romain Diss
Le 18/03/2019, Alan Braslau a �crit
> On Mon, 18 Mar 2019 14:15:10 -0400 (EDT)
> Aditya Mahajan  wrote:
> 
> > On Mon, 18 Mar 2019, Romain Diss wrote:
> > 
> > > Le 13/03/2019, Aditya Mahajan a �crit  
> > >> > Is there a simple way to split a large \startframedtext environment 
> > >> > over
> > >> > multiple pages. It doesn't work out of the box and I didn't find any
> > >> > option make it work in the wiki nor in the documentation I read.  
> > >> 
> > >> Use backgrounds or textbackgrounds.  
> > > Thank you but I still can't achieve what I want to do whith this
> > > command.
> > >
> > > I try to make something similar to the frames in the
> > > "mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
> > > examples).
> > > I suppose Hans Hagen made use of metafun to do it but I encounter some
> > > problems with 'textbackgrounds'.
> > >
> > > In this minimal example, the frame doesn't appear (or if i set
> > > [frame=on,leftframe=off] all the frame is rendered) and the left and
> > > right offsets are not took into account.  
> > 
> > textbackground uses metapost for ALL backgrounds and the default metapost 
> > code to draw the background (draw_multi_pars, defined in mp-abck.mkiv) 
> > doesn't handle individual frames. So, you have to write your own metapost 
> > code to draw the side bar.
> > 
> > Another option for simple backgrounds is to use `\definebackground` 
> > instead of `definetextbackground`. The background mechanism doesn't have 
> > too many options, but does honor leftframe and rightframe by default.
> > 
> > Aditya
> 
> You can look under
> doc/context/sources/general/manuals/publications/publications-style.tex
> to see how it is done.
All these source files where here, next to me, all this time and I didn't
know... Thank you very much!

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Alan Braslau
On Mon, 18 Mar 2019 14:15:10 -0400 (EDT)
Aditya Mahajan  wrote:

> On Mon, 18 Mar 2019, Romain Diss wrote:
> 
> > Le 13/03/2019, Aditya Mahajan a �crit  
> >> > Is there a simple way to split a large \startframedtext environment over
> >> > multiple pages. It doesn't work out of the box and I didn't find any
> >> > option make it work in the wiki nor in the documentation I read.  
> >> 
> >> Use backgrounds or textbackgrounds.  
> > Thank you but I still can't achieve what I want to do whith this
> > command.
> >
> > I try to make something similar to the frames in the
> > "mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
> > examples).
> > I suppose Hans Hagen made use of metafun to do it but I encounter some
> > problems with 'textbackgrounds'.
> >
> > In this minimal example, the frame doesn't appear (or if i set
> > [frame=on,leftframe=off] all the frame is rendered) and the left and
> > right offsets are not took into account.  
> 
> textbackground uses metapost for ALL backgrounds and the default metapost 
> code to draw the background (draw_multi_pars, defined in mp-abck.mkiv) 
> doesn't handle individual frames. So, you have to write your own metapost 
> code to draw the side bar.
> 
> Another option for simple backgrounds is to use `\definebackground` 
> instead of `definetextbackground`. The background mechanism doesn't have 
> too many options, but does honor leftframe and rightframe by default.
> 
> Aditya

You can look under
doc/context/sources/general/manuals/publications/publications-style.tex
to see how it is done.

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

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


Re: [NTG-context] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Aditya Mahajan

On Mon, 18 Mar 2019, Romain Diss wrote:


Le 13/03/2019, Aditya Mahajan a �crit

> Is there a simple way to split a large \startframedtext environment over
> multiple pages. It doesn't work out of the box and I didn't find any
> option make it work in the wiki nor in the documentation I read.

Use backgrounds or textbackgrounds.

Thank you but I still can't achieve what I want to do whith this
command.

I try to make something similar to the frames in the
"mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
examples).
I suppose Hans Hagen made use of metafun to do it but I encounter some
problems with 'textbackgrounds'.

In this minimal example, the frame doesn't appear (or if i set
[frame=on,leftframe=off] all the frame is rendered) and the left and
right offsets are not took into account.


textbackground uses metapost for ALL backgrounds and the default metapost 
code to draw the background (draw_multi_pars, defined in mp-abck.mkiv) 
doesn't handle individual frames. So, you have to write your own metapost 
code to draw the side bar.


Another option for simple backgrounds is to use `\definebackground` 
instead of `definetextbackground`. The background mechanism doesn't have 
too many options, but does honor leftframe and rightframe by default.


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

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


Re: [NTG-context] Background under bibliography (like in mkiv-publications.pdf)

2019-03-18 Thread Romain Diss
Le 13/03/2019, Aditya Mahajan a �crit
> > Is there a simple way to split a large \startframedtext environment over
> > multiple pages. It doesn't work out of the box and I didn't find any
> > option make it work in the wiki nor in the documentation I read.
> 
> Use backgrounds or textbackgrounds.
Thank you but I still can't achieve what I want to do whith this
command.

I try to make something similar to the frames in the
"mkiv-publications.pdf" manual (page 6 or 22 for a bibliography for
examples).
I suppose Hans Hagen made use of metafun to do it but I encounter some
problems with 'textbackgrounds'.

In this minimal example, the frame doesn't appear (or if i set
[frame=on,leftframe=off] all the frame is rendered) and the left and
right offsets are not took into account.

% test-bcknd.tex
\usebtxdataset[biblio.bib]

\setupbtxrendering
[before={\startbiblio},
after={\stopbiblio}]

% Arri�re-plan biblio
\definetextbackground[biblio]
[location=paragraph,
background=color,
backgroundcolor=green,
%backgroundoffset=2em,
leftoffset=1em,
rightoffset=1em,
topoffset=1.5em,
bottomoffset=1em,
frame=off,
leftframe=on,
rulethickness=.1em,
framecolor=red]

\startdocument
\startchapter[title=A chapter]
\input knuth \cite[knuth]\blank
\input ward \cite[ward]\blank
\placelistofpublications[criterium=chapter]
\stopchapter

\stopdocument
% end


% biblio.bib
@book{knuth,
title = "Title",
author = "Knuth",
publisher = "Publisher",
year = "2019",
}
@book{ward,
title = "Title",
author = "Ward",
publisher = "Publisher",
year = "2019",
}
% end

Any suggestions?

Thank you.


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Can't use MetaFun with mplib anymore

2019-03-14 Thread luigi scarso
On Thu, Mar 14, 2019 at 10:52 AM Hans Hagen  wrote:

> as currently the variable is isn't used we can also comment it
>
>
>
seems so
I have commented the line, and all formats and the plain test run.


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


Re: [NTG-context] Can't use MetaFun with mplib anymore

2019-03-14 Thread Hans Hagen

On 3/14/2019 10:00 AM, Henri Menke wrote:

On 3/14/19 8:49 PM, Hans Hagen wrote:

On 3/14/2019 5:56 AM, Henri Menke wrote:


Dear list,

Something has changed in MetaFun and it can no longer be used in plain
LuaTeX,
with neither of

  luatex test.tex
  mtxrun --script plain test.tex

This is the error:

  >> LUATEXFUNCTIONALITY
  >> "mp.print(LUATEXFUNCTIONALITY)"
  ! Equation cannot be performed (numeric=string).


hm, that can be

mp.print(LUATEXFUNCTIONALITY or 0)

but ... i'm surprised you can use metafun in plain at all ... i never
test that and to be honest am not too motivated to support mpiv code in
generic either .. better use


Until TeX Live 2018, MetaFun worked in plain (at least the subset I'm
using).  It would be a shame if the support would end.  I also think
that there are quite a number of users.  The number of posts on TeX
Stack Exchange mentioning luamplib with metafun is not negligible.
https://tex.stackexchange.com/search?q=mplibsetformat


ok, as long as no one expects me to check functionality in plain usage

things like special colors and shading and some font related options 
won't work, so in that case the stand alone graphics are better


(there are quite some metafun macros that assume the lua extensions that 
context provides and some upcoming extra modules, for sure will not work 
in plain ... no problem as long as these macros are not used ...)



I (and probably a lot of other people) would really appreciate if you
could apply Luigi's fix, so we can continue do enjoy MetaFun, even
outside ConTeXt.

i'll comment the line

Hans

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

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


Re: [NTG-context] Can't use MetaFun with mplib anymore

2019-03-14 Thread Hans Hagen

On 3/14/2019 8:51 AM, luigi scarso wrote:



On Thu, Mar 14, 2019 at 5:56 AM Henri Menke <mailto:henrime...@gmail.com>> wrote:



Dear list,

Something has changed in MetaFun and it can no longer be used in
plain LuaTeX,
with neither of

     luatex test.tex
     mtxrun --script plain test.tex

This is the error:

     >> LUATEXFUNCTIONALITY
     >> "mp.print(LUATEXFUNCTIONALITY)"
     ! Equation cannot be performed (numeric=string).

MWE is below, as always.

Cheers, Henri

---

\directlua{
local mpkpse = kpse.new(arg[0], "mpost")

local function finder(name, mode, ftype)
     if mode == "w" then
         return name
     else
         return mpkpse:find_file(name,ftype)
     end
end

local mpx = mplib.new {
     find_file = finder
}
local ret = mpx:execute[[
boolean mplib ; mplib := true ;
input metafun.mp <http://metafun.mp> ;
]]

print(ret.log)
}
\bye


in mp-mlib.mpiv it seems that we should have
string  LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY := 
runscript("mp.print(LUATEXFUNCTIONALITY)") ;

instead of
numeric LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY := 
runscript("mp.print(LUATEXFUNCTIONALITY)") ;

Now I have
tex/texmf-context/metapost/context/base/mpiv$ grep -r LUATEXFUNCTIONALITY
mp-mlib.mpiv:%numeric LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY := 
runscript("mp.print(LUATEXFUNCTIONALITY)") ;
mp-mlib.mpiv:string  LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY := 
runscript("mp.print(LUATEXFUNCTIONALITY)") ;


and your example looks ok.

as currently the variable is isn't used we can also comment it

Hans

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

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


Re: [NTG-context] Can't use MetaFun with mplib anymore

2019-03-14 Thread Henri Menke
On 3/14/19 8:49 PM, Hans Hagen wrote:
> On 3/14/2019 5:56 AM, Henri Menke wrote:
>>
>> Dear list,
>>
>> Something has changed in MetaFun and it can no longer be used in plain
>> LuaTeX,
>> with neither of
>>
>>  luatex test.tex
>>  mtxrun --script plain test.tex
>>
>> This is the error:
>>
>>  >> LUATEXFUNCTIONALITY
>>  >> "mp.print(LUATEXFUNCTIONALITY)"
>>  ! Equation cannot be performed (numeric=string).
> 
> hm, that can be
> 
> mp.print(LUATEXFUNCTIONALITY or 0)
> 
> but ... i'm surprised you can use metafun in plain at all ... i never
> test that and to be honest am not too motivated to support mpiv code in
> generic either .. better use

Until TeX Live 2018, MetaFun worked in plain (at least the subset I'm
using).  It would be a shame if the support would end.  I also think
that there are quite a number of users.  The number of posts on TeX
Stack Exchange mentioning luamplib with metafun is not negligible.
https://tex.stackexchange.com/search?q=mplibsetformat

I (and probably a lot of other people) would really appreciate if you
could apply Luigi's fix, so we can continue do enjoy MetaFun, even
outside ConTeXt.

Cheers, Henri

> 
> \startMPpage
> \stopMPpage
> 
> with context and then include the pdf
> 
> Hans
> 
>> MWE is below, as always.
>>
>> Cheers, Henri
>>
>> ---
>>
>> \directlua{
>> local mpkpse = kpse.new(arg[0], "mpost")
>>
>> local function finder(name, mode, ftype)
>>  if mode == "w" then
>>  return name
>>  else
>>  return mpkpse:find_file(name,ftype)
>>  end
>> end
>>
>> local mpx = mplib.new {
>>  find_file = finder
>> }
>> local ret = mpx:execute[[
>> boolean mplib ; mplib := true ;
>> input metafun.mp ;
>> ]]
>>
>> print(ret.log)
>> }
>> \bye
>>
>> ___
>>
>> If your question is of interest to others as well, please add an entry
>> to the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/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] Can't use MetaFun with mplib anymore

2019-03-14 Thread luigi scarso
On Thu, Mar 14, 2019 at 5:56 AM Henri Menke  wrote:

>
> Dear list,
>
> Something has changed in MetaFun and it can no longer be used in plain
> LuaTeX,
> with neither of
>
> luatex test.tex
> mtxrun --script plain test.tex
>
> This is the error:
>
> >> LUATEXFUNCTIONALITY
> >> "mp.print(LUATEXFUNCTIONALITY)"
> ! Equation cannot be performed (numeric=string).
>
> MWE is below, as always.
>
> Cheers, Henri
>
> ---
>
> \directlua{
> local mpkpse = kpse.new(arg[0], "mpost")
>
> local function finder(name, mode, ftype)
> if mode == "w" then
> return name
> else
> return mpkpse:find_file(name,ftype)
> end
> end
>
> local mpx = mplib.new {
> find_file = finder
> }
> local ret = mpx:execute[[
> boolean mplib ; mplib := true ;
> input metafun.mp ;
> ]]
>
> print(ret.log)
> }
> \bye
>
>
in mp-mlib.mpiv it seems that we should have
string  LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY :=
runscript("mp.print(LUATEXFUNCTIONALITY)") ;
instead of
numeric LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY :=
runscript("mp.print(LUATEXFUNCTIONALITY)") ;

Now I have
tex/texmf-context/metapost/context/base/mpiv$ grep -r LUATEXFUNCTIONALITY
mp-mlib.mpiv:%numeric LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY :=
runscript("mp.print(LUATEXFUNCTIONALITY)") ;
mp-mlib.mpiv:string  LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY :=
runscript("mp.print(LUATEXFUNCTIONALITY)") ;

and your example looks ok.

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


Re: [NTG-context] Can't use MetaFun with mplib anymore

2019-03-14 Thread Hans Hagen

On 3/14/2019 5:56 AM, Henri Menke wrote:


Dear list,

Something has changed in MetaFun and it can no longer be used in plain LuaTeX,
with neither of

 luatex test.tex
 mtxrun --script plain test.tex

This is the error:

 >> LUATEXFUNCTIONALITY
 >> "mp.print(LUATEXFUNCTIONALITY)"
 ! Equation cannot be performed (numeric=string).


hm, that can be

mp.print(LUATEXFUNCTIONALITY or 0)

but ... i'm surprised you can use metafun in plain at all ... i never 
test that and to be honest am not too motivated to support mpiv code in 
generic either .. better use


\startMPpage
\stopMPpage

with context and then include the pdf

Hans


MWE is below, as always.

Cheers, Henri

---

\directlua{
local mpkpse = kpse.new(arg[0], "mpost")

local function finder(name, mode, ftype)
 if mode == "w" then
 return name
 else
 return mpkpse:find_file(name,ftype)
 end
end

local mpx = mplib.new {
 find_file = finder
}
local ret = mpx:execute[[
boolean mplib ; mplib := true ;
input metafun.mp ;
]]

print(ret.log)
}
\bye

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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
___


[NTG-context] Can't use MetaFun with mplib anymore

2019-03-13 Thread Henri Menke

Dear list,

Something has changed in MetaFun and it can no longer be used in plain LuaTeX,
with neither of

luatex test.tex
mtxrun --script plain test.tex

This is the error:

>> LUATEXFUNCTIONALITY
>> "mp.print(LUATEXFUNCTIONALITY)"
! Equation cannot be performed (numeric=string).

MWE is below, as always.

Cheers, Henri

---

\directlua{
local mpkpse = kpse.new(arg[0], "mpost")

local function finder(name, mode, ftype)
if mode == "w" then
return name
else
return mpkpse:find_file(name,ftype)
end
end

local mpx = mplib.new {
find_file = finder
}
local ret = mpx:execute[[
boolean mplib ; mplib := true ;
input metafun.mp ;
]]

print(ret.log)
}
\bye

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 color of sidebar

2019-02-25 Thread Jeong Dal
Dear Mohammad Hossein Bateni,

> 2019. 2. 25. 오후 1:27, ntg-context-requ...@ntg.nl 작성:
> 
> I have never used the sidebar mechanism, but there is a "rulecolor" option
> in setupsidebar.  Maybe that's what you're looking for.
> 
> You can look up the commands and their options in "i-context.pdf" file.

Thank you for the reply.
I found the command “\setupsidebar”.

The following example is working well.
%%%
\definecolor[dGreen][r=0,g=.4,b=0]
%\setupsidebar[rulecolor=(.4green)]
\setupsidebar[rulecolor=dGreen]

\starttext

\startsidebar
\samplefile{knuth}
\stopsidebar

\stoptext
%

The reason of putting “\definecolor…” is that “[rulecolor=(.4green)]” is not 
working as in MetaFun, while [rulecolor=green] is working well.

Because of this, I can remove my definition of sidebar from my environment.

Thank you again.

Best regards,

Dalyoung


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

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


Re: [NTG-context] getdocumentargument in Metafun

2019-02-22 Thread Fabrice L
Le 22 février 2019 à 11:08:51, Aditya Mahajan (adit...@umich.edu) a écrit:

Untested. Add quotes around FileName:

> string FileName ;
> FileName := "\getdocumentargument{File}" ;


And not tested successfully !

Thanks a lot Aditya !

Fabrice.



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

maillist : ntg-context@ntg.nl /
http://www.ntg.nl/mailman/listinfo/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] getdocumentargument in Metafun

2019-02-22 Thread Aditya Mahajan

On Fri, 22 Feb 2019, Fabrice L wrote:


Dear list,

I wish to do several zoom from a picture made in MetaFun, from a pdf file
which name is given on the commande line, like:

context zoom.tex —File=EntryFile —Page=9 —result=OutFile.pdf


Untested. Add quotes around FileName:


string FileName ;
FileName := "\getdocumentargument{File}" ;


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
___


[NTG-context] getdocumentargument in Metafun

2019-02-22 Thread Fabrice L
Dear list,

I wish to do several zoom from a picture made in MetaFun, from a pdf file
which name is given on the commande line, like:

context zoom.tex —File=EntryFile —Page=9 —result=OutFile.pdf

Minimal example:

\starttext
  \startMPpage
numeric ThePage ;
string FileName ;
FileName := \getdocumentargument{File} ;
ThePage := \getdocumentargument{Page} ;
draw textext("\externalfigure["  & FileName &"][page="  & ThePage &"]")
xysized (48in,48in) ;
  \stopMPpage
\stoptext

I can get in the MPpage the page number in entry (9 in my example), but not
the file name.
Thanks for any help.
Fabrice.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] troubles with \MPinclusions (Taco Hoekwater)

2019-02-21 Thread Damien Thiriet
Thanks for your answers, I could significantly reduce my long 
timeline code.

 
> 1. Variable names x and y are special and cleared before
>every graphic. This is related to the fact that “z" is 
>defined as a shortcut for "(x,y)”. Both of these are
>traditional. 
> 
>Every metapost graphic does at least this at its start:
> 
>save x,y;
>currentpicture := nullpicture;
>currentpen:=defaultpen;
>   
>so pair xx[]; would have worked just fine.
> 
>In general, I would advice to stay away from single-letter
>variable names inside MPinclusions, and use CamelCase
>to avoid clashes with metafun internals.
> 

So, got one more z-related error in Metapost. I bet this is
absolutely the n.1 on help-lists. Btw, if I were a scientist, 
I'd realized that defining x as a pair is quite heretic…
And that sounds much familiar to an historian.

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

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


<    2   3   4   5   6   7   8   9   10   11   >