[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
e in the >> component chapter-14 : >> >> It is probably not related to the figure itself. Something may be >> different in this component compared to the other ones. I cannot really >> say, of course. Still, using external image instead of inline metapost may >> be fix

[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
not related to the figure itself. Something may be > different in this component compared to the other ones. I cannot really > say, of course. Still, using external image instead of inline metapost may > be fix it. Not elegant, but if it works it works! > > Good luck, > Taco > > >

[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Taco Hoekwater
itself. Something may be different in this component compared to the other ones. I cannot really say, of course. Still, using external image instead of inline metapost may be fix it. Not elegant, but if it works it works! Good luck, Taco > > \startcomponent[chapter-14] > \startMPpage > .

[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Hans Hagen
On 4/25/2024 4:08 PM, Fabrice Couvreur wrote: Hi Taco, I knew I wouldn't be able to explain what was happening. The code works perfectly and the figure is clearly visible in the component chapter-14 : \startcomponent[chapter-14] \startMPpage ... \stopMPpage \stopcomponent But if I compile my

[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
Hi Taco, I knew I wouldn't be able to explain what was happening. The code works perfectly and the figure is clearly visible in the component chapter-14 : \startcomponent[chapter-14] \startMPpage ... \stopMPpage \stopcomponent But if I compile my project, it disappears !! \startproduct

[NTG-context] Re: The graph is not visible.

2024-04-25 Thread Taco Hoekwater
H Fabrice, You did not provide a good minimum test because the graph by itself renders fine: fabr.pdf Description: Adobe PDF document Best wishes, Taco (if all else fails, you can replace \startMPcode with \startMPpage and generate a standalone graph that way) > On 25 Apr 2024, at 12

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-10 Thread Hans Hagen
all.nl>> wrote: On 4/8/2024 8:22 AM, seyal zavira wrote: > thank you Harban and Keith McKay. > >     \startMPpage >            picture tt ; tt := lmt_outline [ >                kind = "path", >                text =

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-09 Thread seyal zavira
ed the codes and pdf results. On Mon, Apr 8, 2024 at 4:37 AM Hans Hagen wrote: > On 4/8/2024 8:22 AM, seyal zavira wrote: > > thank you Harban and Keith McKay. > > > > \startMPpage > >picture tt ; tt := lmt_outline [ > >k

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-08 Thread Hans Hagen
On 4/8/2024 8:22 AM, seyal zavira wrote: thank you Harban and Keith McKay. \startMPpage       picture tt ; tt := lmt_outline [           kind = "path",           text = "\definedfont[name:texgyrepagellabold*default]foo f o o",      

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-08 Thread seyal zavira
thank you Harban and Keith McKay. \startMPpage > picture tt ; tt := lmt_outline [ > kind = "path", > text = "\definedfont[name:texgyrepagellabold*default]foo f o o", > ] ; > > fill > for

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Hans Hagen
On 4/7/2024 7:42 PM, Henning Hraban Ramm wrote: Am 07.04.24 um 19:05 schrieb Hans Hagen: \startMPpage picture tt ; tt := lmt_outline [ kind = "fillup", text = "\definedfont[name:texgyrepagellabold*default]foo f o o", ] xsized 12cm ; path bb

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Keith McKay
: \startMPpage picture tt ; tt := lmt_outline [ kind = "fillup", text = "\definedfont[name:texgyrepagellabold*default]foo f o o", ] xsized 12cm ; path bb ; bb := boundingbox tt ; path pp ; pp := bb enlarged 2cm ; fill pp wit

[NTG-context] Re: Fwd: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Henning Hraban Ramm
Am 07.04.24 um 19:05 schrieb Hans Hagen: \startMPpage     picture tt ; tt := lmt_outline [     kind = "fillup",     text = "\definedfont[name:texgyrepagellabold*default]foo f o o",     ] xsized 12cm ;     path bb ; bb := boundingbox tt ;     path pp ; p

[NTG-context] Fwd: Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Hans Hagen
back in my files. \startMPpage picture tt ; tt := lmt_outline [ kind = "fillup", text = "\definedfont[name:texgyrepagellabold*default]foo f o o", ] xsized 12cm ; path bb ; bb := boundingbox tt ; path pp ; pp := bb enlarged 2cm ; fill pp

[NTG-context] Re: how to apply gradient color to a piece of text?

2024-04-07 Thread Keith McKay
g examples that can apply gradient colors to metapost paths. how i can apply this cool feature to a piece of text? i tried the code below but it does not produce any result. \definecolor[Gleft] [h=9f9393] \definecolor[Gright] [h=ff1aa4] \startMPpage picture Mytext; Mytext := btex hello etex; draw

[NTG-context] how to apply gradient color to a piece of text?

2024-04-07 Thread seyal . zavira
=ff1aa4] \startMPpage picture Mytext; Mytext := btex hello etex; draw lmt_shade [ picture="Mytext", direction = "right", domain= { 0, 2 }, colors= { "headerGleft", "headerGright" }, ] ; \stopMPpage

[NTG-context] Re: how to include an an svg file?

2024-03-16 Thread Jean-Pierre Delange
Dear CTX wizards, The commands given by Hans don't work properly in my case (with CTX on Windows 11). I am probably ignorant of how to implement \startMPpage. I'm not a "MetaPost lover", but I'd like to understand something; especially as I know how to make simple frames to include

[NTG-context] Re: how to include an an svg file?

2024-03-15 Thread seyal zavira
rmat one has to specify every character with > possible abuse of a substitution feature that accesses it. So that is no > longer a real interesting option, unless of course one exports all text > as curves, just to be sure. > > (I will extend general text suport but it will always be sub

[NTG-context] Re: how to include an an svg file?

2024-03-15 Thread Hans Hagen via ntg-context
me cleanup, ps. For metapost lovers, here is some of the trickery used: \startMPpage[offset=1ts] draw image ( fill (unitsquare xscaled 10cm yscaled 4cm) withcolor svgcolor(0.5,0,0) ; registerluminositygroup ("test") ( fill (unitsquare

[NTG-context] Re: lmt_shade fails

2024-02-19 Thread Keith McKay
not change* > *anything just now.* > The MWE I used is as follows: > \starttext > \startMPpage > definecolor [ name = "MyColor3", r = uniformdeviate(1), g = > uniformdeviate(1), b = uniformdeviate(1) ] ; > definecolor [ name = "MyColor4", r = uniformdeviate(1), g = >

[NTG-context] Re: lmt_shade fails

2024-02-19 Thread Fabrice L
then: > > metafun > log > That contour should have ended with '.. cycle' or '& > cycle'. So I'll not change > anything just now. > > The MWE I used is as follows: > > \starttext > \startMPpage > definecolor [ name = "MyColor3", r = uniformd

[NTG-context] lmt_shade fails

2024-02-18 Thread Keith McKay
/anything just now./ // The MWE I used is as follows: \starttext \startMPpage definecolor [ name = "MyColor3", r = uniformdeviate(1), g = uniformdeviate(1), b = uniformdeviate(1) ] ; definecolor [ name = "MyColor4", r = uniformdeviate(1), g = uniformdeviate(1), b = uniformd

[NTG-context] Re: Problem with wiki example

2024-02-17 Thread Shiv Shankar Dayal
Never mind it was my idiocy. On Sun, Feb 18, 2024 at 3:29 AM Shiv Shankar Dayal < shivshankar.da...@gmail.com> wrote: > I found following on Wiki to produce PDF out of standalone type( > https://wiki.contextgarden.net/Sharing_graphics): > > \starttext > \startMPpage >

[NTG-context] Problem with wiki example

2024-02-17 Thread Shiv Shankar Dayal
I found following on Wiki to produce PDF out of standalone type( https://wiki.contextgarden.net/Sharing_graphics): \starttext \startMPpage draw fullcircle scaled 10cm ; \stopMPPage \stoptext It generates a PDF but when I open it with Evince, Evince complains that no page was found and does

[NTG-context] Re: Metapost docs

2024-01-11 Thread Shiv Shankar Dayal
specific > documentation on things like chemical structures is a little hit-or-miss, > but often quite useful. > -The mailing list. I have the most luck with very specific questions that > include a minimal working example. It should include the appropriate > \starttext…\stoptext

[NTG-context] Re: Metapost docs

2024-01-11 Thread Gavin via ntg-context
…\stoptext or \startMPpage…\stopMPpage, so that it can be typeset as-is. If you want to do 3D, you may want to get Lua involved for calculations. I use - Programming in LuaTeX page on the wiki (https://wiki.contextgarden.net/Programming_in_LuaTeX) - Programming in Lua, 4th ed. by Roberto Ierusalimschy

[NTG-context] Lua and inject.path to make a disconnected MetaPost path?

2024-01-08 Thread Gavin via ntg-context
] = {{0,0}, {-1,-1}, {-1,0}, cycle = true } continents[2] = {{0,1}, {1,0}, {1,-1}, cycle = true } function mp.getglobepath(continentnum) mp.inject.path(continents[continentnum]) end \stopluacode \startMPpage path p[], q ; p1 = (lua.mp.getglobepath(1) scaled 1cm) ; p2

[NTG-context] Re: multipage metapost output from ConTeXt

2024-01-06 Thread Emanuel Han via ntg-context
; TheFrame := fullsquare scaled 5in ; z1 = (60,40); z2 = (40,90); z3 = (10,70); p1:=image( label("Word 1", z1); ); p2:=image( label("Mot 2", z2); ); p3:=image( label("Parola 3", z3); ); \stopuseMPgraphic \starttext \dorecurse{3}{ % Frame \startMPpage[pagestate

[NTG-context] Re: MetaFun path joiners && and &&&& do not like single point paths

2023-12-31 Thread Hans Hagen via ntg-context
On 12/31/2023 8:06 AM, Mikael Sundqvist wrote: \startMPpage path p[], q ; p1 = fullcircle scaled 3cm ; p2 = fullcircle scaled 2cm shifted (3cm,0) ; p3 = (3cm,2cm) ; p4 = fullcircle ; q = p[1] for i = 2 upto 3: if (length(p[i]) == 0): &&& else: && fi p[i] endfor && cy

[NTG-context] Re: MetaFun path joiners && and &&&& do not like single point paths

2023-12-30 Thread Mikael Sundqvist
or a > very specific orientation of the globe. I guessed that this orientation had > an island right on the horizon, so that only one boundary point was visible, > creating a singe point path for that island. I should probably fix my module > so it doesn’t do that. However, it might be ni

[NTG-context] MetaFun path joiners && and &&&& do not like single point paths

2023-12-30 Thread Gavin via ntg-context
o that only one boundary point was visible, creating a singe point path for that island. I should probably fix my module so it doesn’t do that. However, it might be nice to have && and &&&& deal with this situation gracefully. Gavin \startMPpage path p[], q ; p1 = fullci

[NTG-context] Re: Seeking advice for module that draws globes

2023-12-17 Thread Hans Hagen via ntg-context
)) &&&& endfor cycle enddef ; and then: \startMPpage GlobeDiameter = 10cm ; fill fullcircle scaled GlobeDiameter withcolor .9white ; path p ; p := theglobe(23, 0) scaled .5GlobeDiameter ; draw p withpen pencircle scaled .2mm

[NTG-context] Re: Seeking advice for module that draws globes

2023-12-17 Thread Hans Hagen via ntg-context
On 12/17/2023 11:22 PM, Gavin via ntg-context wrote: 1. How do I avoid redrawing diagrams with every typeset? The globe above takes about 0.7s, which is not bad, but it adds up in a book with many diagrams. \startbuffer[demo] \usemodule [luageo] \startMPpage GlobeDiameter = 10cm

[NTG-context] Seeking advice for module that draws globes

2023-12-17 Thread Gavin via ntg-context
, which draws the globe. Below is an example document with the output. (I attached a small .png of the output for the mailing list. The output PDF has excessive detail.) The module (code and data) is on GitHub at https://github.com/GavinPolhemus/luageo. \usemodule [luageo] \startMPpage

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-04 Thread Fabrice L
,70); > > p1:=image( > label(textext("Word 1"), z1); > ); > > p2:=image( > label(textext("Mot 2"), z2); > ); > > p3:=image( > label(textext("Parola 3"), z3); > ); > > \stopMPinclusions > > \starttext > >

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
Thank you Mikael, this works! Emanuel On Dez. 2 2023, at 7:46 pm, Mikael Sundqvist wrote: > Hi, > > I don't know if \startMPinclusions \stopMPinclusions shall work with > \startMPpage and \stopMPpage. In this case, one can use a separate > graphics: > > \startuseMPgrap

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Mikael Sundqvist
Hi, I don't know if \startMPinclusions \stopMPinclusions shall work with \startMPpage and \stopMPpage. In this case, one can use a separate graphics: \startuseMPgraphic{base} picture p[]; path TheFrame ; TheFrame := fullsquare scaled 5in ; z1 = (60,40); z2 = (40,90); z3 = (10,70); p1:=image

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
ns picture p[]; path TheFrame ; TheFrame := fullsquare scaled 5in ; z1 = (60,40); z2 = (40,90); z3 = (10,70); p1:=image( label(textext("Word 1"), z1); ); p2:=image( label(textext("Mot 2"), z2); ); p3:=image( label(textext("Parola 3"), z3); ); \stopMPinclusi

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Mikael Sundqvist
artPoint = point 0 of A; >> pair AEndPoint; AEndPoint = point 4 of A; >> path B; B = z5..z6; >> pair BStartPoint; BStartPoint = point 0 of B; >> pair BEndPoint; BEndPoint = point 1 of B; >> path C; C = AStartPoint..AEndPoint; >> >> p1:=image( >> draw A w

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread fv leung
=image(draw A; label(lmt_outline [ > text = "\JapaneseFont 日本語" > ], AEndPoint);); > > p3:=image( > label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, > BStartPoint); > ); > > p4:=image(draw A; label(lmt_outline [ > text = "\Korea

[NTG-context] Re: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
, AEndPoint);); > > p3:=image( > label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, BStartPoint); > ); > > p4:=image(draw A; label(lmt_outline [ > text = "\KoreanFont 한국어" > ], AStartPoint);); > > p5:=image( > label(textext("bāng"), BEndPoint);

[NTG-context] Re: multipage metapost output from ConTeXt

2023-11-29 Thread Emanuel Han via ntg-context
); p4:=image(draw A; label(lmt_outline [ text = "\KoreanFont 한국어" ], AStartPoint);); p5:=image( label(textext("bāng"), BEndPoint); draw C withcolor green; ); p6:=image( draw B withcolor blue; ); \stopMPinclusions \starttext \dorecurse{6}{ % Frame \setupMPpage[background=colo

[NTG-context] Re: multipage metapost output from ConTeXt

2023-11-27 Thread Aditya Mahajan
On Mon, 27 Nov 2023, Fabrice L wrote: > Hi, > > It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage > multiple times. Here is an example which build an animation of a particle > moving according to a Brownian motion. A very similar option is to

[NTG-context] Re: multipage metapost output from ConTeXt

2023-11-27 Thread Fabrice L
Hi, It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage multiple times. Here is an example which build an animation of a particle moving according to a Brownian motion. Fabrice. % 8< --- \usecolors[crayola] \setupMPinsta

[NTG-context] Re: Wiki problem - labels missing from the main diagram on the Page Layout page

2023-11-08 Thread Henning Hraban Ramm
. Fixed. Any suggestions as to what needs to be changed to get the diagram to display correctly? I saved it again and now it seems to work. Thank you! BTW, for my book I made a new one in MetaPost, see attachment. \startMPpage input layout.mp; draw Layout; \stopMPpage Hraban % Diagram of lay

[NTG-context] Re: [ metapost -> svg ]

2023-11-07 Thread Lutz Haseloff
Hi Floris, directly generating SVG with ConTeXt LMTX is not possible. But, using LMTX to generate SVGs has some advantages over MPOST. You can use ConTeXt's advanced color management (transparency and more) and you can use the very nice font management. So my "metapost" file is: \s

[NTG-context] MP: problems with dashed lines

2023-10-22 Thread Henning Hraban Ramm
Hi, I wanted to use dashed lines as folding marks, but apparently they only work with pencircle, or at least not with pensquare. The Metafun manual (Reference, C5) also shows a problem with "dashed oddly", that I can’t reproduce in this MWE: \startMPpage draw (0,0)--(100,10

[NTG-context] Re: [ export to svg ]

2023-08-19 Thread Hans Hagen via ntg-context
On 8/19/2023 1:12 PM, vm via ntg-context wrote: Is there a (simple) way to export the results of a \startMPpage ... \stopMPpage directly to a svg file? My current route is to import the pdf into inkscape, group path objects by stroke color, then save the result as svg and translate

[NTG-context] [ export to svg ]

2023-08-19 Thread vm via ntg-context
Is there a (simple) way to export the results of a \startMPpage ... \stopMPpage directly to a svg file? My current route is to import the pdf into inkscape, group path objects by stroke color, then save the result as svg and translate that into a hpgl format for the pen plotter. I guess/hope

[NTG-context] Re: text width shadow background

2023-07-09 Thread Keith McKay
Well this is fun.  Getting the right patterns could make some interesting with fonts. Thanks for the tip Hans! Best Wishes Keith McKay % \startMPpage vardef tst (expr x, y, i, n) = definecolor [ name = "MyColor1", r = uniformdeviate(1), g = uniformdeviate(1), b = unif

[NTG-context] Re: text width shadow background

2023-07-09 Thread Hans Hagen via ntg-context
the text by \TeX and published it here: https://fosstodon.org/@context/110684919994406565 But is it possible to fill a path (e.g. an lmt_outline) with a lmt_poisson pattern? Here's something to get you and Keith starting: \startMPpage picture p ; p := lmt_outline [ text = "\bf

[NTG-context] SVG converter bugs

2023-07-06 Thread Max Chernoff
.org/2000/svg;> \stopbuffer \starttext \startTEXpage \includesvgbuffer[gradient] \stopTEXpage \startMPpage fill unitsquare xyscaled (200,100) withshademethod "linear" withs

Re: [NTG-context] Feynman Diagrams

2023-04-12 Thread Aditya Mahajan via ntg-context
vconnect ("photon", __v1, __v2); vfreeze; vdraw; endsubgraph; endchar; % the end. end. endinput; So, I created a context file: \startMPinclusions input feynmp; require_RCS_revision "1.30"; \stopMPinclusions \starttext \sta

Re: [NTG-context] Meta(post)/(fun) macro with label position

2023-01-19 Thread Jeong Dal via ntg-context
Dear Alex, I don’t know what you want exactly. I hope that it may help. \startMPpage def myLabel(expr xpos, ypos)(text t) = dotlabel.top(textext(t),(xpos,ypos)); enddef; myLabel(1cm, 1cm, "Position"); \stoppage Good luck. Be

Re: [NTG-context] atan2 function

2022-10-14 Thread Hans Hagen via ntg-context
n radians. This demo: \startMPpage vardef atantwo( expr dy, dx ) = save theta; numeric theta; theta := 0; if (dx > 0): theta := atan( dy / dx ); elseif (dx < 0) and (dy >= 0):

Re: [NTG-context] atan2 function

2022-10-13 Thread Max Chernoff via ntg-context
Hi, > The angle function doesn't appear to provide the same calculation as > my atantwo in all cases. They both give the same results, but "angle" gives a result in degrees while "atantwo" gives a result in radians. This demo: \startMPpage v

Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Fabrice Couvreur via ntg-context
ia ntg-context wrote: > > > Ok, it works very well. Without wanting to insist, how to have the same > > > hatching with two different figures ? > > see upcoming mail from Mikael > > Oh, OK, here it goes. Hans will probably rename things if he adds this. > > \startMPp

Re: [NTG-context] About macro numberstriped ()

2022-10-02 Thread Mikael Sundqvist via ntg-context
l from Mikael Oh, OK, here it goes. Hans will probably rename things if he adds this. \startMPpage[offset=1dk] vardef Stripe(expr p, a, d) = save thestripe ; picture thestripe ; thestripe := nullpicture ; save diag ; numeric diag ; diag := 0.55*( abs((urcorner boundingbox p) - (llcorner bounding

[NTG-context] ConTeXt meeting and the annotated cow

2022-09-18 Thread Axel Kielhorn via ntg-context
scaled .5mm withcolor mycolor; enddef ; \stopMPinclusions \startMPpage % Picture draw externalfigure "cow.pdf" xsized 16cm; % Grid gridscaled; % Text annotb (1, 5, .8, 7.3, "Maul"); annotb (6, 2, 7, 3.2, "Euter"); annott (9.2, 9.5, 9.6, 3, "Schwanz"); an

Re: [NTG-context] m-graph label

2022-07-30 Thread John Kitzmiller via ntg-context
t; The format string uses "@" rather then "%", as % is normally scanned as > a comment. > Thank you again, but the "0.0" remains unchanged. The only way I've been able to succeed is with a for loop to label explicitly. See mwe below for things I've attempted. The

Re: [NTG-context] m-graph label

2022-07-21 Thread John Kitzmiller via ntg-context
be > > formatted? > > > > % -1 1 > > % 0 1 > > % 0 2 > > % 1 1 > > % 2 1 > > % 2 2 > > % 2 3 > > % 2 4 > > % 3 1 > > % 3 2 > > > > \usemodule[m-graph] > > \startMPpage[instance=graph, offset=5mm] > >

Re: [NTG-context] Metafun hexagons aren't hexagons

2022-07-21 Thread Alan via ntg-context
roducing octagons > >> instead: > >> > >> \startMPpage > >> fill fullhexagon scaled 100; > >> draw unithexagon scaled 50 withcolor white; > >> \stopMPpage > > > > Of course, for an MP circle is defined by 8 point

Re: [NTG-context] Metafun hexagons aren't hexagons

2022-07-21 Thread Hans Hagen via ntg-context
On 7/21/2022 5:56 AM, Alan via ntg-context wrote: On Wed, 20 Jul 2022 15:26:53 -0600 Max Chernoff via ntg-context wrote: The recently added Metafun hexagons seem to be producing octagons instead: \startMPpage fill fullhexagon scaled 100; draw unithexagon scaled 50

Re: [NTG-context] no greyscales in MetaFun any more?

2022-07-21 Thread Alan via ntg-context
On Sun, 17 Jul 2022 23:46:36 +0200 Hans Hagen via ntg-context wrote: > On 7/17/2022 9:52 PM, Henning Hraban Ramm via ntg-context wrote: > > Hi Hans et al., > > > > all my greys are black: > > > > % MWE: > > \startMPpage > > fill unitsqu

Re: [NTG-context] Metafun hexagons aren't hexagons

2022-07-20 Thread Alan via ntg-context
On Wed, 20 Jul 2022 15:26:53 -0600 Max Chernoff via ntg-context wrote: > The recently added Metafun hexagons seem to be producing octagons > instead: > >\startMPpage >fill fullhexagon scaled 100; >draw unithexagon scaled 50 withcolor white; >\

[NTG-context] Metafun hexagons aren't hexagons

2022-07-20 Thread Max Chernoff via ntg-context
Hi, The recently added Metafun hexagons seem to be producing octagons instead: \startMPpage fill fullhexagon scaled 100; draw unithexagon scaled 50 withcolor white; \stopMPpage -- Max

Re: [NTG-context] m-graph label

2022-07-20 Thread Alan via ntg-context
> % 0 1 > % 0 2 > % 1 1 > % 2 1 > % 2 2 > % 2 3 > % 2 4 > % 3 1 > % 3 2 > > \usemodule[m-graph] > \startMPpage[instance=graph, offset=5mm] > labeloffset:=3mm; > draw begingraph(8cm,4cm); > setrange(-1.5,0.5,3.5,5); > picture symbol ; > symbol

Re: [NTG-context] Metafun : save memory content ?

2022-07-19 Thread Fabrice L via ntg-context
missed this part ! I completely miss the «write to » and « read from » instructions. Even a research on the web before posting did not return something interesting. I guess I did not used the good terms, because now, I find some ressources about these functions ! > > \starttext &g

Re: [NTG-context] Metafun : save memory content ?

2022-07-19 Thread Bruce Horrocks via ntg-context
d this example from the metafun-p manual by adding some "write" statements. \starttext \startMPpage numeric done[][], i, j, n ; n := 0 ; forever : i := round(uniformdeviate(10)) ; j := round(uniformdeviate(10)) ; if unknown done[i][j]

Re: [NTG-context] Metafun : save memory content ?

2022-07-18 Thread Fabrice L via ntg-context
> Le 18 juill. 2022 à 12:31, Hans Hagen via ntg-context a > écrit : > > On 7/18/2022 3:20 PM, Fabrice L via ntg-context wrote: >> Dear list, >> I’m doing animations in MetaFun, by simply using \startMPpage (…) >> \stopMPpage for each frame of the animation.

Re: [NTG-context] Metafun : save memory content ?

2022-07-18 Thread Hans van der Meer via ntg-context
ote: >> Dear list, >> I’m doing animations in MetaFun, by simply using \startMPpage (…) >> \stopMPpage for each frame of the animation. Here is an example: >> https://youtu.be/yhxUbVQx9Uo (please note you can watch it in HD by >> adjusting the setting in YouTu

Re: [NTG-context] Metafun : save memory content ?

2022-07-18 Thread Hans Hagen via ntg-context
On 7/18/2022 3:20 PM, Fabrice L via ntg-context wrote: Dear list, I’m doing animations in MetaFun, by simply using \startMPpage (…) \stopMPpage for each frame of the animation. Here is an example: https://youtu.be/yhxUbVQx9Uo (please note you can watch it in HD by adjusting the setting

Re: [NTG-context] Metafun : save memory content ?

2022-07-18 Thread Hans Hagen via ntg-context
On 7/18/2022 4:39 PM, Henning Hraban Ramm via ntg-context wrote: Am 18.07.22 um 15:20 schrieb Fabrice L via ntg-context: Dear list, I’m doing animations in MetaFun, by simply using \startMPpage (…) \stopMPpage for each frame of the animation. Here is an example: https://youtu.be/yhxUbVQx9Uo

Re: [NTG-context] Metafun : save memory content ?

2022-07-18 Thread Henning Hraban Ramm via ntg-context
Am 18.07.22 um 15:20 schrieb Fabrice L via ntg-context: Dear list, I’m doing animations in MetaFun, by simply using \startMPpage (…) \stopMPpage for each frame of the animation. Here is an example: https://youtu.be/yhxUbVQx9Uo (please note you can watch it in HD by adjusting the setting

[NTG-context] Metafun : save memory content ?

2022-07-18 Thread Fabrice L via ntg-context
Dear list, I’m doing animations in MetaFun, by simply using \startMPpage (…) \stopMPpage for each frame of the animation. Here is an example: https://youtu.be/yhxUbVQx9Uo (please note you can watch it in HD by adjusting the setting in YouTube). This works usually great, but when the number

Re: [NTG-context] no greyscales in MetaFun any more?

2022-07-17 Thread Hans Hagen via ntg-context
On 7/17/2022 9:52 PM, Henning Hraban Ramm via ntg-context wrote: Hi Hans et al., all my greys are black: % MWE: \startMPpage fill unitsquare scaled 10mm withcolor .5; \stopMPpage % real life example: \startMPpage % grayscale squares for s=5 step 5 until 95:   numeric c; c := s/100;   fill

[NTG-context] no greyscales in MetaFun any more?

2022-07-17 Thread Henning Hraban Ramm via ntg-context
Hi Hans et al., all my greys are black: % MWE: \startMPpage fill unitsquare scaled 10mm withcolor .5; \stopMPpage % real life example: \startMPpage % grayscale squares for s=5 step 5 until 95: numeric c; c := s/100; fill unitsquare scaled 5mm shifted (0,(s-5)*mm) withcolor c; label.lft

[NTG-context] m-graph label

2022-07-16 Thread John Kitzmiller via ntg-context
The horizontal axis label of mwe below has 0.0 (showing tenths; pdf attached; filename is mwe.tex). I expected it to show -1, 0, 1, 2, 3, (integers only). Can this be formatted? % -1 1 % 0 1 % 0 2 % 1 1 % 2 1 % 2 2 % 2 3 % 2 4 % 3 1 % 3 2 \usemodule[m-graph] \startMPpage[instance=graph, offset

Re: [NTG-context] MetaPost cutdraw

2022-07-06 Thread Mikael Sundqvist via ntg-context
>> > >>> Hi, I’m trying to understand MetaPost better. > >>> > >>> I’d like to draw a fat line that’s cut at its end points. > >> > >> You mean like linecap = butt? > > Yes, but that doesn’t behave differently. > > > &g

Re: [NTG-context] MetaPost label font size

2022-07-06 Thread Fabrice L via ntg-context
> Le 5 juill. 2022 à 19:00, Henning Hraban Ramm via ntg-context > a écrit : > > How can I change the font size of labels within one picture? > > Hraban > > \startMPpage > defaultfont := "\truefontname{Sans}"; > defaultfontsize := \the\bodyfontsi

Re: [NTG-context] MetaPost cutdraw

2022-07-06 Thread Henning Hraban Ramm via ntg-context
mean like linecap = butt? Yes, but that doesn’t behave differently. \startMPpage[offset=5mm]     path p;     p := origin -- (7cm,0);     interim  linecap := squared;     draw p withpen ((pensquare    ) scaled 5mm) withcolor red ;     draw envelope  ((pensquare    ) scaled

Re: [NTG-context] MetaPost cutdraw

2022-07-06 Thread Hans Hagen via ntg-context
On 7/6/2022 7:10 AM, Aditya Mahajan via ntg-context wrote: On Wed, 6 Jul 2022, Henning Hraban Ramm via ntg-context wrote: Hi, I’m trying to understand MetaPost better. I’d like to draw a fat line that’s cut at its end points. You mean like linecap = butt? \startMPpage[offset=5mm] path p

Re: [NTG-context] MetaPost cutdraw

2022-07-05 Thread Aditya Mahajan via ntg-context
On Wed, 6 Jul 2022, Henning Hraban Ramm via ntg-context wrote: > Hi, I’m trying to understand MetaPost better. > > I’d like to draw a fat line that’s cut at its end points. You mean like linecap = butt? \startMPpage[offset=5mm] path p; p := origin -- (7cm,0); interim lineca

[NTG-context] MetaPost label font size

2022-07-05 Thread Henning Hraban Ramm via ntg-context
How can I change the font size of labels within one picture? Hraban \startMPpage defaultfont := "\truefontname{Sans}"; defaultfontsize := \the\bodyfontsize; label.top(defaultfontsize, (0,0)); defaultfontsize := 4bp; label.top(defaultfontsize, (50,0)); % shows that the variab

[NTG-context] MetaPost cutdraw

2022-07-05 Thread Henning Hraban Ramm via ntg-context
Hi, I’m trying to understand MetaPost better. I’d like to draw a fat line that’s cut at its end points. I learned, “cutdraw” should do the trick, but I get a parallelogram instead of a rectangle. What’s wrong? Hraban \startMPpage draw (0,20)--(20,20) withpen pensquare scaled 10; cutdraw

[NTG-context] Graded Transparency in MetaFun

2022-06-30 Thread Keith McKay via ntg-context
. I'm guessing the way lmt_shade areas are drawn is the way to go. Is this likely to be easy to code for what I want to do? Best Wishes Keith McKay %%%MWE%% \setuppapersize[A4,portrait] \usecolors[crayola] \starttext \startMPpage %page 1 StartPage; numeric maxTransp;% Must be between 0 and 1

[NTG-context] Problems with MetaFun Transparency Groups

2022-06-13 Thread Stefan Haller via ntg-context
10mm; n := 20; pickup pencircle scaled 7mm; for i = 1 upto n: draw (0, i) * u -- (n+1, i) * u withmycolor; draw (i, 0) * u -- (i, n+1) * u withmycolor; endfor; enddef; \stopMPdefinitions \startMPpage draw image( draw_grid ) asgroup ""; addbackground w

Re: [NTG-context] Importing pdf into MPpage

2022-06-11 Thread Stefan Nedeljkovic via ntg-context
aps there is > a simpler solution !): > > \startMPpage > picture TheImage ; > TheImage := image( > draw externalfigure "cow.pdf"; > ); > TheImage := TheImage shifted -center(TheImage); > draw TheImage ; > draw (0,0) withpen pencircle scaled .2in withcolor mage

Re: [NTG-context] Importing pdf into MPpage

2022-06-11 Thread Fabrice L via ntg-context
> Le 11 juin 2022 à 11:30, Stefan Nedeljkovic a écrit : > > That's it, but how do I center it on (0, 0)? Sorry, I misunderstood the question. Here is a solution (perhaps there is a simpler solution !): \startMPpage picture TheImage ; TheImage := image(

Re: [NTG-context] Importing pdf into MPpage

2022-06-11 Thread Stefan Nedeljkovic via ntg-context
t (0, 0), centered at original size on a > MPpage, and draw over it. But using the input command doesn't work. How > should I approach this? > > > Like this ? > > \startMPpage >draw externalfigure "thefile.pdf"; >(… other

Re: [NTG-context] Importing pdf into MPpage

2022-06-11 Thread Fabrice L via ntg-context
d I approach this? Like this ? \startMPpage draw externalfigure "thefile.pdf"; (… other commands…) \stopMPpage > > Sincerely, > Stefan Fabrice. > ___ > If your question is o

Re: [NTG-context] Compiling a large metapost document

2022-06-02 Thread Stefan Nedeljkovic via ntg-context
; > problem through a huge file? What have you done to identify this > > problem? Is there a minimal example? > due to a mail server crash i lost todays and last nights mail sop here s > a partial reply > > (Just put that large mp blob in a file and call that one instead of >

Re: [NTG-context] Compiling a large metapost document

2022-06-02 Thread Hans Hagen via ntg-context
and call that one instead of passing through tex's tokenizer: \startMPpage input test.mp ; \stopMPpage then in order to save runtime do draw image ( draw (220.852, 127.175) ; draw (226.248, 128.606) ; draw (221.840, 129.541) ; draw (280.733, 100.927) ; draw (276.968, 83.053) ; draw (251.644

Re: [NTG-context] Compiling a large metapost document

2022-06-01 Thread Stefan Nedeljkovic via ntg-context
One more question. How would >> I >> > import the eps file back into MPpage, so I could do trickery with text. >> >> Convert the PostScript file into PDF with either "ps2pdf" or >> GhostScript, then you can import the file with "externalfigure": >&

Re: [NTG-context] Compiling a large metapost document

2022-06-01 Thread Stefan Nedeljkovic via ntg-context
ript, then you can import the file with "externalfigure": > > \startMPpage > draw externalfigure "belgrade_gm.pdf"; > draw textext.top("One") shifted (264.352, 116.362); > dr

Re: [NTG-context] Compiling a large metapost document

2022-06-01 Thread Max Chernoff via ntg-context
can import the file with "externalfigure": \startMPpage draw externalfigure "belgrade_gm.pdf"; draw textext.top("One") shifted (264.352, 116.362); draw textext.top("Two") s

Re: [NTG-context] Compiling a large metapost document

2022-06-01 Thread Stefan Nedeljkovic via ntg-context
ompile > > it, but it fails. Do you know of a way to compile it? > > Just use plain MetaPost: > > diff --git a/belgrade_gm.tex b/belgrade_gm.mp > index 3281754..d536b64 100644 > --- a/belgrade_gm.tex > +++ b/belgrade_gm.mp > @@ -1 +1 @@ > -\startMPpag

Re: [NTG-context] Compiling a large metapost document

2022-06-01 Thread Max Chernoff via ntg-context
@@ -1 +1 @@ -\startMPpage +beginfig(1) @@ -125187 +125187 @@ drawdot (264.352, 116.362) withpen pencircle scaled 1.35 withcolor (0.929, 0.110 -\stopMPpage \ No newline at end of file +endfig; end; Then compile with: mpost belgrade_gm ps2pdf belgrade_gm.1 -- Max

Re: [NTG-context] Changing font and font size inside textex

2022-05-31 Thread Stefan Nedeljkovic via ntg-context
adventor] > \storexheight[pagella] > \storexheight[heros] > > \starttext > \startMPpage > draw textext.origin("\setxheight[adventor][1cm]Hello!"); > > draw (0, 1cm) -- (6cm, 1cm); > \stopMPpage > >

Re: [NTG-context] Changing font and font size inside textex

2022-05-31 Thread Max Chernoff via ntg-context
\relax] \stoptexdefinition \storexheight[adventor] \storexheight[pagella] \storexheight[heros] \starttext \startMPpage draw textext.origin("\setxheight[adventor][1cm]Hello!"); draw (0, 1cm) -- (6cm, 1cm); \

  1   2   3   4   5   6   7   8   9   >