[NTG-context] Re: Row span in tabulate

2024-12-29 Thread Jeong Dal via ntg-context
command as > shown below. (I presume there is a way to compute the correct offset from the > column widths and write a macro to avoid having to fine-tune it by hand.) > > > \startuseMPgraphic{recBox}{w,h,sx,sy,lColor} > numeric u;

[NTG-context] Re: Row span in tabulate

2024-12-29 Thread Florent Michel
unitsquare xyscaled (\MPvar{w}, \MPvar{h}) shifted (\MPvar{sx},\MPvar{sy}) withpen pencircle scaled 3pt withcolor \MPvar{lColor}; \stopuseMPgraphic \defineoverlay [kBox] [\useMPgraphic{recBox}{w=2u,h=LineHeight+4pt, sx=.8u,sy=LineHeight-2pt,lColor=darkred}] \starttext \framed[frame=on,backg

[NTG-context] Re: Row span in tabulate

2024-12-29 Thread Jeong Dal via ntg-context
h \stoptabulate as follows: > > _ > > \startuseMPgraphic{recBox}{w,h,sx,sy,lColor} > numeric u;u := 1cm; > draw unitsquare xyscaled (\MPvar{w}, \MPvar{h}) shifted > (\MPvar{sx},\MPvar{sy}) withpen pencircle scaled 3pt withcolor \MPvar{lColor}; > \stopuseMPgraphic > \defineoverlay &g

[NTG-context] Re: Row span in tabulate

2024-12-29 Thread Florent Michel
sx,sy,lColor} numeric u;u := 1cm; draw unitsquare xyscaled (\MPvar{w}, \MPvar{h}) shifted (\MPvar{sx},\MPvar{sy}) withpen pencircle scaled 3pt withcolor \MPvar{lColor}; \stopuseMPgraphic \defineoverlay [kBox] [\useMPgraphic{recBox}{w=2u,h=LineHeight+4pt, sx=.8u,sy=LineHeight-2pt,lColor=da

[NTG-context] Row span in tabulate

2024-12-28 Thread Jeong Dal via ntg-context
Sorry. Here is a sample code. Thank you. Best regards, Dalyoung \startuseMPgraphic{recBox}{w,h,sx,sy,lColor} numeric u;u := 1cm; draw unitsquare xyscaled (\MPvar{w}, \MPvar{h}) shifted (\MPvar{sx},\MPvar{sy}) withpen pencircle scaled 3pt withcolor \MPvar{lColor}; \stopuseMPgraphic

[NTG-context] Vertical space between section and subsection.

2024-12-17 Thread Jeong Dal via ntg-context
reading. Best regards, Dalyoung \startbuffer[styleOutline] \startuseMPgraphic{outlineT} draw lmt_outline [ text = \MPvar{tt}, kind = "both", width = OverlayWidth, align = "middle", fillcolor = "gray&quo

[NTG-context] Re: Including SVG manipulating color or rewrite in MP

2024-12-14 Thread juh+ntg-context--- via ntg-context
:= lmt_svg [ > filename = "juh.svg", > origin = true ] ; > >draw juh ysized OverlayHeight withcolor \MPvar{juhcolor} ; > >\stopuseMPgraphic > >\setupMPvariables[juh][juhcolor=darkred] > >\defineoverlay[juh][\useMPgraphic{juh}] > >\starttext > >\f

[NTG-context] Re: Including SVG manipulating color or rewrite in MP

2024-12-12 Thread Mikael Sundqvist
Hi, Not sure exactly what you are after, but this could work (I saved your svg as juh.svg) /Mikael \startuseMPgraphic{juh}{juhcolor} picture juh ; juh := lmt_svg [ filename = "juh.svg", origin = true ] ; draw juh ysized OverlayHeight withcolor \MPvar{juhcolor} ; \stopus

[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-19 Thread Gerion Entrup
;>>>> \bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} > >>>>> \eTD \bTD \digits{2} \eTD \eTR > >>>>> \eTABLE > >>>>> \stoptext > >>>>> ``` > >>>>> I would like to achieve that

[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-19 Thread Hans Hagen via ntg-context
than 315° (I tested 305, 325 and 314). Try xyscaled(\the\struttotal,abs(sind(\MPvar{rotation}))*\the\widthofstring{\MPvar{text}}); with sind instead of sin. And maybe with abs around it, but one can think of improvements for smaller angles. It all depends on what one wants. here is an altern

[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Mikael Sundqvist
} \eTD \eTR > > >> \eTABLE > > >> \stoptext > > >> ``` > > >> I would like to achieve that the text "Mexican redknee tarantula" is > > >> typeset right and above of "Water buffalo" so that the single columns > > >

[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Gerion Entrup
ater buffalo" so that the single columns have > >> a width that is similar to the width of the single digit coming in the > >> second row. > > > > To visualize this, I patched the PDF of the above example to the desired > > result. See the attachmen

[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Hans Hagen
the PDF of the above example to the desired result. See the attachment. You can use Metapost. \startuseMPgraphic{tableheader}{text,rotation}   label.lft("\strut\bf\MPvar{text}",origin)     rotated \MPvar{rotation}     shifted (\the\strutht,0);   setbounds currentpicture to unitsquare

[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Wolfgang Schuster
red result. See the attachment. You can use Metapost. \startuseMPgraphic{tableheader}{text,rotation} label.lft("\strut\bf\MPvar{text}",origin) rotated \MPvar{rotation} shifted (\the\strutht,0); setbounds currentpicture to unitsquare xyscaled(\the\struttotal,sin(\MPvar

[NTG-context] Asking help for better way to make tickets.

2024-01-12 Thread Jeong Dal via ntg-context
]\startuseMPgraphic{ticket}{i,j}path p,q;pair A,B;p := unitsquare xyscaled (67mm,73mm);A := point 0.5 of p;B := point 2.5 of p;draw p;label(textext("Text"), .25A+.75B );label(textext("\tfd " & decimal (3*\MPvar{i}-\MPvar{j})), center p);label(textext("Text"

[NTG-context] Verbatim Textbox with Reference NUmbering

2023-09-09 Thread Jeroen
upto nofmultipars : p := multipars[1] topenlarged 4pt bottomenlarged 4pt cornered 2mm ; fill p withcolor 0.95white ; draw p withcolor black withpen pencircle scaled \MPvar{linewidth}; endfor; \stopuseMPgraphic \definetextbackground [listingbackground] [state=start, mp

[NTG-context] Re: Text runs out of Verbatim Frame

2023-09-08 Thread Wolfgang Schuster
; draw p withcolor black withpen pencircle scaled \MPvar{linewidth}; endfor; \stopuseMPgraphic \definetextbackground [listingbackground]   [state=start,    mp=mpos:par:myexample,  location=paragraph,    topoffset=0.4em,    leftoffset=0em,  rulethickness=0.7pt] \definetyping[Listing] [option=commands

[NTG-context] Text runs out of Verbatim Frame

2023-09-08 Thread Jeroen
scaled \MPvar{linewidth}; endfor; \stopuseMPgraphic \definetextbackground [listingbackground] [state=start, mp=mpos:par:myexample, location=paragraph, topoffset=0.4em, leftoffset=0em, rulethickness=0.7pt] \definetyping[Listing] [option=commands] \setuptyping [Listing

Re: [NTG-context] Mathematical MetaFun Mania

2022-12-15 Thread Hans Hagen via ntg-context
- z2{down} ; draw pab ; fi ; positioninregion ; fi ; \stopMPpositiongraphic A connector command might look something like this: \setMPpositiongraphic{X-1}{mypos:contract}{to=X-2,product=sym,startstem=-2,stopstem=2,distance=0.5ex} All of the key=value pairs in the last argume

[NTG-context] Mathematical MetaFun Mania

2022-12-14 Thread Gavin via ntg-context
positiongraphic A connector command might look something like this: \setMPpositiongraphic{X-1}{mypos:contract}{to=X-2,product=sym,startstem=-2,stopstem=2,distance=0.5ex} All of the key=value pairs in the last argument of \setMPpositiongraphic pop right up in my MetaPost code with mpvar(“key”). I haven

Re: [NTG-context] Write a long chapter title in two lines

2022-08-19 Thread Hans Hagen via ntg-context
On 8/19/2022 3:03 AM, Jeong Dal wrote: Dear all, A few days ago, I sent an email as follows. But it is linked to another subject because I choose reply of another subject. So, I send the same mail again. \startuseMPgraphic{outlineT} draw lmt_outline [ text = \MPvar{tt

[NTG-context] Write a long chapter title in two lines

2022-08-18 Thread Jeong Dal via ntg-context
(\MPvar{tt}) (withcolor .75white) (withcolor .725blue withpen pencircle scaled .75pt);%\MPvar{thick}); \stopuseMPgraphic \definefont[BigFontOne][NotoSansCJKkr-Bold sa 4] \define[1]\outlineTitle{\useMPgraphic{outlineT}{tt="#1"}} \setuphead[chapter] [textcommand=\outlineTit

[NTG-context] Write a long chapter title in two lines

2022-08-15 Thread Jeong Dal via ntg-context
? Thanks, Best regards, Dalyoung \startuseMPgraphic{outlineT} draw outlinetext.b (\MPvar{tt}) (withcolor .75white) (withcolor .725blue withpen pencircle scaled .75pt);%\MPvar{thick}); \stopuseMPgraphic \definefont[BigFontOne][NotoSansCJKkr-Bold sa 4] \define[1]\outlineTitle

[NTG-context] MetaFun manual's "texvar" is not working for me

2022-05-21 Thread Gavin via ntg-context
Hello list, I’m trying to reproduce the positional graphics examples in the MetaFun manual on pp. 151-153. There are two examples of code for the mpos:box. The first example uses \MPvar to retrieve variables set using \setupMPvariables. This works fine. The second example uses texvar to

Re: [NTG-context] Switching fonts changes framedtext justification

2022-04-07 Thread Thangalin via ntg-context
tail := 1 ; % Flip the tail's location and direction. if \MPvar{side} = 1: offset := 5 ; tail := -1 ; fi (offset/6)[x1,x2] = x8 + .25cm * tail = x7 + .25cm = x9 - .25cm ; y7 = 0cm ; y8 = -.5cm ; y9 = 0cm ; path p ; p = (z1--z7--z8--z9--z2--z3--z4--cycle) corn

Re: [NTG-context] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-23 Thread Jeong Dal
maxNum := k; exitif xpart(z[k]) > TextWidth; endfor; maxNum := maxNum-1; setglobalmacro("udMacro",decimal maxNum); %%% define udMacro and udCount setglobalcount("udCount",maxNum); \stopMPinitializations \startuseMPgraphic{foldUD}{num} numeric n; n

Re: [NTG-context] Delivering the value of a variable in MetaFun to ConTeXt

2021-06-23 Thread Aditya Mahajan
ng)*u] = whatever[A,B]; >for k = 2 upto 20: > z[k] = nextPt(z[k-2],z[k-1]); > maxNum := k; > exitif xpart(z[k]) > TextWidth; >endfor; >maxNum := maxNum-1; >setglobalmacro("udMacro",decimal maxNum); %%% define udMacro and udCount >setglob

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-23 Thread Jeong Dal
nged next line from G to z[-1] z[-1] = whatever[z[0], z[0]+dir(2*ang)*u] = whatever[A,B]; for k = 2 upto 20: z[k] = nextPt(z[k-2],z[k-1]); maxNum := k; exitif xpart(z[k]) > TextWidth; endfor; \stopMPinitializations \startuseMPgraphic{foldUD}{num} numeric n;

[NTG-context] new upload

2021-05-05 Thread Hans Hagen
eeded, adapting is not hard and gives nicer code, as in: \startuseMPgraphic{foo1} fill fullcircle scaled \MPvar{size} withcolor \MPvar{color} ; \stopuseMPgraphic which now becomes: \startuseMPgraphic{foo2} fill fullcircle scaled mpvard("size") withcolo

[NTG-context] working on page refs with MP

2021-03-18 Thread Werner Hennrich
defineoverlay[hdrPgs][\useMPgraphic{hdrPgs}] \startuseMPgraphic{hdrPgs} StartPage; % calc and draw 'Page x of y' numeric numCurr; numCurr := \MPvar{curr}; string strFirst; strFirst := "\MPvar{first}"; string strNext; strNext := "\MPvar{next}"; message(&qu

Re: [NTG-context] Lua code and table

2021-02-19 Thread Hans Hagen
context.stopxcell() end context.stopxrow() end context.stopxtable() end \stopluacode \startuniqueMPgraphic{cross}{width,height,depth,color,line} draw image ( draw (\MPvar{depth},\MPvar{height}) -- (\MPvar{width},0) ; draw (\MPvar{depth}

Re: [NTG-context] Lua code and table

2021-02-18 Thread Fabrice Couvreur
version,i) > context.stopxcell() > for j=1,n do > context.startxcell { align = "middle" } > action(string.sub(pattern[i],j,j)) > context.stopxcell() >

Re: [NTG-context] Lua code and table

2021-02-18 Thread Hans Hagen
opxcell() for j=1,n do context.startxcell { align = "middle" } action(string.sub(pattern[i],j,j)) context.stopxcell() end context.stopxrow() end context.stop

Re: [NTG-context] Are positional graphics still working?

2021-02-17 Thread Jairo A. del Rio
> \defineoverlay[frames][\positionoverlay{frames}] > > > > \setupbackgrounds[text][background=frames] > > > > > > \startMPpositiongraphic{frame} > > > > if unknown context_apos : input mp-apos.mpiv ; fi ; > > > > \MPgetposboxes{\MPvar{self}}

Re: [NTG-context] Are positional graphics still working?

2021-02-17 Thread Hans Hagen
; fi ; \MPgetposboxes{\MPvar{self}}{\MPanchorid} if nofposboxes = 1 : draw posboxes[1] ; fi ; \stopMPpositiongraphic \startpositionoverlay{frames} \setMPpositiongraphic{one}{frame} \setMPpositiongraphic{two}{frame} \stoppositionoverlay \starttext This \hpos{one}{word} should be \hpos{two}{f

[NTG-context] Are positional graphics still working?

2021-02-16 Thread Jairo A. del Rio
I've copied the following example from the ConTeXt archive: \defineoverlay[frames][\positionoverlay{frames}] \setupbackgrounds[text][background=frames] \startMPpositiongraphic{frame} if unknown context_apos : input mp-apos.mpiv ; fi ; \MPgetposboxes{\MPvar{self}}{\MPanchorid} if nofpos

Re: [NTG-context] Combining modes and MetaFun

2020-09-06 Thread Jan Willem Flamma
uffer[square]}}> > \stoptextYou need to compensate these solutions by "wikifying" them: \starttext \startuseMPgraphic{whatever}{s::mode} u := 2cm ; draw unitsquare scaled u ; drawdblarrow (0,-0.2u)..(u,-0.2u) ; drawdblarrow (1.2u, 0)..(1.2u, u) ; if "\MPva

Re: [NTG-context] Combining modes and MetaFun

2020-09-04 Thread Hans Hagen
hatever}{s::mode} u := 2cm ; draw unitsquare scaled u ; drawdblarrow (0,-0.2u)..(u,-0.2u) ; drawdblarrow (1.2u, 0)..(1.2u, u) ; if "\MPvar{mode}" = "en" : label("e", (0.5u,-0.4u)) ; label("n", (1.6u, 0.5u)) ; else :

Re: [NTG-context] Placing number in \sqrt

2020-05-04 Thread Aditya Mahajan
t customized square root signed which was asked on TeX.SE a few years ago: https://tex.stackexchange.com/a/406680/323 I tried the code from the link above, but: - I had change some macro names: \mpvar -> \MPvar, \startuniquempgraphic -> \startuniqueMPgraphic and some others, - there

Re: [NTG-context] Placing number in \sqrt

2020-05-04 Thread context
which was asked on TeX.SE a few years ago: https://tex.stackexchange.com/a/406680/323 I tried the code from the link above, but: - I had change some macro names: \mpvar -> \MPvar, \startuniquempgraphic -> \startuniqueMPgraphic and some others, - there is still an error I'm not able to fix (see att

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-19 Thread Jeong Dal
:= fullcircle scaled radius shifted (2cm, 1cm); draw p; draw q; % end of base figure % draw points move := 0.1; now := move*\MPvar{n}; P := point now along q; Q := findPointD(C, P, radius); drawdot P; drawdot Q withcolor .625red; dotlabel.lft(textext("

Re: [NTG-context] animation using \startuseMPgraphic

2020-04-19 Thread Aditya Mahajan
:= 2cm; C := origin; p := fullcircle scaled (2*radius); z[1] = point 6 of p; z[2] = point .8 of p; q := (1.5*z1 - .5*z2) -- (-.5z1 + 1.5*z2); %q := fullcircle scaled radius shifted (2cm, 1cm); draw p; draw q; %for i := 0 step 0.1 until 1: move := 0.1; now := move*\MPvar{n}; P := point now

[NTG-context] animation using \startuseMPgraphic

2020-04-18 Thread Jeong Dal
:= fullcircle scaled (2*radius); z[1] = point 6 of p; z[2] = point .8 of p; q := (1.5*z1 - .5*z2) -- (-.5z1 + 1.5*z2); %q := fullcircle scaled radius shifted (2cm, 1cm); draw p; draw q; %for i := 0 step 0.1 until 1: move := 0.1; now := move*\MPvar{n}; P := point now along q; Q := findPointD(C

Re: [NTG-context] write a subtitle under the title of a chapter using outlined font

2020-03-19 Thread Jeong Dal
Dear Hans, I found how to. By removing ‘& ditto’, then it works! > draw outlinetext.b ("\framed[align=normal]{" & \MPvar{tt} & "}”) Thank you so much. Best regards, Dalyoung ___ I

Re: [NTG-context] write a subtitle under the title of a chapter using outlined font

2020-03-19 Thread Jeong Dal
Dear Hans, Thanks for the reply. Your method works partly. > >draw outlinetext.b ("\framed[align=normal]{" & ditto & \MPvar{tt} & ditto > & "}”) > It allows to write it in two lines. However, the title is surrounded by ‘ “ ‘. How to remo

Re: [NTG-context] write a subtitle under the title of a chapter using outlined font

2020-03-19 Thread Hans Hagen
them in two lines? draw outlinetext.b ("\framed[align=normal]{" & ditto & \MPvar{tt} & ditto & "}") Thanks. Best regards, Dalyoung ** \startuseMPgraphic{outlineT}   draw outlinetext.b (\MPvar{tt})   (withcolor .75white)   (withcolor .72

[NTG-context] write a subtitle under the title of a chapter using outlined font

2020-03-19 Thread Jeong Dal
, Dalyoung ** \startuseMPgraphic{outlineT} draw outlinetext.b (\MPvar{tt}) (withcolor .75white) (withcolor .725blue withpen pencircle scaled .75pt); \stopuseMPgraphic \define[1]\outlineFill{\useMPgraphic{outlineT}{tt="#1"}}% \setuphead[cha

[NTG-context] Hatch color in a table cell

2020-03-12 Thread Fabrice Couvreur
Hi, I would like to hatch the cell green. Thank you. Fabrice \usecolors[xwi] \startuniqueMPgraphic{meta:hash}{linewidth,linecolor,angle,gap} if unknown context_back : input mp-back ; fi ; some_hash ( OverlayWidth, OverlayHeight , \MPvar{linewidth}, \MPvar{linecolor} , \MPvar{angle}, \MPvar{gap

Re: [NTG-context] baseline of outlined font

2019-02-16 Thread Wolfgang Schuster
[BigFontOne][NotoSansCJKkr-Bold sa 4] \definecolor[BigColorOne][r=.86,g=.850,b=.54] \startuseMPgraphic{outlineT} draw outlinetext.b (\MPvar{tt}) (withcolor .75white) (withcolor .725blue withpen pencircle scaled .75pt);%\MPvar{thick}); \stopuseMPgraphic \define[1]\titleOutline{\useMPgraphic

[NTG-context] baseline of outlined font

2019-02-16 Thread Jeong Dal
] \definecolor[BigColorOne][r=.86,g=.850,b=.54] \startuseMPgraphic{outlineT} draw outlinetext.b (\MPvar{tt}) (withcolor .75white) (withcolor .725blue withpen pencircle scaled .75pt);%\MPvar{thick}); \stopuseMPgraphic \define[1]\titleOutline{\useMPgraphic{outlineT}{tt="#1"}} \setuphead[cha

Re: [NTG-context] outlined font using MetaFun

2019-02-08 Thread Wolfgang Schuster
Jeong Dal schrieb am 08.02.19 um 17:18: Dear all, The following code which is borrowed from MetaFun manual is working nicely. %% \setupMPvariables[outlineT][tt="Hello"] \startuseMPgraphic{outlineT} draw outlinetext.b (\MPvar{tt}) (withcolor .5white) (withcolor .625bl

[NTG-context] outlined font using MetaFun

2019-02-08 Thread Jeong Dal
Dear all, The following code which is borrowed from MetaFun manual is working nicely. %% \setupMPvariables[outlineT][tt="Hello"] \startuseMPgraphic{outlineT} draw outlinetext.b (\MPvar{tt}) (withcolor .5white) (withcolor .625blue withpen pencircle scaled .2pt)

Re: [NTG-context] Color a column (xtable, lua)

2019-01-26 Thread Fabrice Couvreur
#x27;) 3 4 \startuseMPgraphic{tablebackground}{i,j} 5 if (\MPvar{i} = 1) or (\MPvar{j} = 1): 6 fill OverlayBox withcolor \MPcolor{fondpaille} ; 7 fi; 8 \stopuseMPgraphic 9 10 \defineoverlay 11 [tablebackground] 12 13 >> [\useMPgraphic{tablebackground}{

Re: [NTG-context] Color a column (xtable, lua)

2019-01-26 Thread Henri Menke
aluate the conditional purely in MetaPost. I don't know if that would be faster, but it's a bit more readable to me. \startuseMPgraphic{tablebackground}{i,j} if (\MPvar{i} = 1) or (\MPvar{j} = 1): fill OverlayBox withcolor \MPcolor{fondpaille} ; fi; \stopuseMPgraphic \defineo

Re: [NTG-context] MetaFun: how to check the number of arguments

2019-01-16 Thread Hans Hagen
tartbuffer[3x3b] wu := \MPvar{width}; drawGridF (3)  (1,2,3,0,1, 1,4,5,8); \stopbuffer \starttext \setupMPvariables[width=30pt] \processMPbuffer[defs,3x3b] \stoptext \startbuffer[defs] def drawGridF (expr nb) (text s) =    path p ;    picture pic ;    numeric n; p := unitsquare scaled wu; n:= 0; f

Re: [NTG-context] MetaFun: how to check the number of arguments

2019-01-15 Thread Jeong Dal
div nb; >> pic := image (draw p; label(textext(m), center p); ); >> draw pic shifted (i*wu, j*wu); >> n:= n+ 1; >> endfor; >> enddef; >> \stopbuffer >> \startbuffer[3x3b] >> wu := \MPvar{width}

Re: [NTG-context] MetaFun: how to check the number of arguments

2019-01-15 Thread Hans Hagen
); n:= n+ 1; endfor; enddef; \stopbuffer \startbuffer[3x3b] wu := \MPvar{width}; drawGridF (3) (1,2,3,0,1, 1,4,5,8); \stopbuffer \starttext \setupMPvariables[width=30pt] \processMPbuffer[defs,3x3b] \stoptext \startbuffer[defs] def drawGridF (expr nb) (text s) = path p

[NTG-context] MetaFun: how to check the number of arguments

2019-01-14 Thread Jeong Dal
; enddef; \stopbuffer \startbuffer[3x3b] wu := \MPvar{width}; drawGridF (3) (1,2,3,0,1, 1,4,5,8); \stopbuffer \starttext \setupMPvariables[width=30pt] \processMPbuffer[defs,3x3b] \stoptext > 2019. 1. 14. 오후 8:00, ntg-context-requ...@ntg.nl 작성: > > Send ntg-context mailing list submi

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-09 Thread Alan Braslau
tourX() ; (ymin, ymax) = lua.mp.ContourY() ; draw lua.mp.ContourPath() withpen pencircle scaled ((xmax-xmin)/200) ; setbounds currentpicture to boundingbox ((xmin,ymin)--(xmax,ymax)); currentpicture := currentpicture xsized \MPvar{width} ; save pic ; picture pic ; pic :=

Re: [NTG-context] drop shadow

2018-09-10 Thread Hans Hagen
at follows arbitrary shapes, maybe even letters (like drop shadows e.g. in InDesign do). \startuniqueMPgraphic{mpnewshadow}{offset} MyOffset := \MPvar{offset} ; ... ... OverlayWidth ... \defineoverlay[newshadow][\uniqueMPgraphic{mpnewshadow}{offset=.3em}] you use unique graphics ... so you ne

Re: [NTG-context] \basegrid ignores color

2018-03-22 Thread Henri Menke
er} \startuseMPgraphic{grid}{nx,ny,dx,dy,factor,scale,xstep,ystep,xoffset,yoffset,align,rulecolor,rulethickness} begingroup ; save nx, ny, dx, dy, wd, ht, xstep, ystep, xoffset, yoffset, align, xalign, yalign, rulecolor, rulethickness ; numeric nx ; nx := \MP

Re: [NTG-context] framed with titles

2017-12-02 Thread Pablo Rodriguez
notin G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space > $(X, {\mathcal T} )$ is called {\bf Fort's space}. > \stopTheorem > > \startLemma >     Fort's space is a compact and Hausdorff topological space. > \stopLemma > > \startCoro >     Fort's space

Re: [NTG-context] framed with titles

2017-12-02 Thread Jeong Dal
\stopTheorem \startLemma Fort's space is a compact and Hausdorff topological space. \stopLemma \startCoro Fort's space is a compact and Hausdorff topological space. \stopCoro } \stoptext % 2nd method %2. use \MPvar{} and define 3 different backgrounds, 3 different frame

Re: [NTG-context] Colored rule using MPgraphic

2017-05-17 Thread Hans Hagen
,bottomoffset=1em, before={\testpage[3]\blank[3*big]}, after={\blank[3*big]}] \startuseMPgraphic{background:rule} linecap := butt; begingroup; for i=1 upto nofmultipars : draw (ulcorner multipars[i]--llcorner multipars[i]) withcolor \MPvar{linecolor

[NTG-context] Colored rule using MPgraphic

2017-05-17 Thread Jan Willem Flamma
:= butt; begingroup; for i=1 upto nofmultipars : draw (ulcorner multipars[i]--llcorner multipars[i]) withcolor \MPvar{linecolor} withpen pencircle scaled \MPvar{linewidth} ; endfor ; endgroup; \stopuseMPgraphic \useMPlibrary[dum] \starttext

Re: [NTG-context] Passing data back and forth between metapost and lua

2017-03-19 Thread Hans Hagen
for details (search for MPvar). Hans has developed tools making it quite easy to pass data back and forth between MetaPost and lua. This is quite efficient, and it is being used more and more in the development of macro functionality. I finally need to write a macro where I want to pass data from

Re: [NTG-context] Passing data back and forth between metapost and lua

2017-03-19 Thread Aditya Mahajan
On Sun, 19 Mar 2017, Aditya Mahajan wrote: On Tue, 20 Dec 2016, Alan Braslau wrote: On Mon, 19 Dec 2016 08:19:25 -0800 Aditya Mahajan wrote: The ability to pass parameters to metapost has been around since the beginning. See the metafun manual for details (search for MPvar). Hans has

[NTG-context] Passing data back and forth between metapost and lua

2017-03-19 Thread Aditya Mahajan
On Tue, 20 Dec 2016, Alan Braslau wrote: On Mon, 19 Dec 2016 08:19:25 -0800 Aditya Mahajan wrote: The ability to pass parameters to metapost has been around since the beginning. See the metafun manual for details (search for MPvar). Hans has developed tools making it quite easy to pass

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-20 Thread Aditya Mahajan
On Tue, 20 Dec 2016, Alan Braslau wrote: On Mon, 19 Dec 2016 08:19:25 -0800 Aditya Mahajan wrote: The ability to pass parameters to metapost has been around since the beginning. See the metafun manual for details (search for MPvar). Hans has developed tools making it quite easy to pass

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-20 Thread Alan Braslau
On Mon, 19 Dec 2016 08:19:25 -0800 Aditya Mahajan wrote: > The ability to pass parameters to metapost has been around since the > beginning. See the metafun manual for details (search for MPvar). Hans has developed tools making it quite easy to pass data back and forth between MetaPost a

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-20 Thread Jaroslav Hajtmar
to pass parameters to metapost has been around since the beginning. See the metafun manual for details (search for MPvar). For simple images, you can also do: \define[1]\Circle{\startMPcode draw fullcircle scaled #1*cm; \stopMPcode} \Circle{1} \Circle{2} \Circle{3}

Re: [NTG-context] Asymptote or Metapost and ConTeXt parameters.

2016-12-19 Thread Aditya Mahajan
On Mon, 19 Dec 2016, Jaroslav Hajtmar wrote: There is a similar possibility, at least in Metapost? For simpler pictures it would probably suffice The ability to pass parameters to metapost has been around since the beginning. See the metafun manual for details (search for MPvar). For

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Wolfgang Schuster
Meer, Hans van der <mailto:h.vanderm...@uva.nl> 11. April 2016 um 21:50 But why should typing \MPcolor{\MPvar{color}}be necessary or useful when \MPvar(color) obviously is sufficient? Or is there a special reason for the nested macros? Let's separate your question in two separate

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Meer, Hans van der
But why should typing \MPcolor{\MPvar{color}}be necessary or useful when \MPvar(color) obviously is sufficient? Or is there a special reason for the nested macros? > On 11 Apr 2016, at 19:16, Aditya Mahajan wrote: > > On Mon, 11 Apr 2016, Meer, Hans van der wrote: > >> >

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Aditya Mahajan
d with \MPvar. Thus? Hans van der Meer \starttext \startuseMPgraphic{example1}{color} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm withcolor \MPcolor{color}; This is looking for a color named 'color'. You need \MPcolor{\MPvar{color}}. \

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Meer, Hans van der
On 11 Apr 2016, at 16:17, Alan BRASLAU mailto:alan.bras...@cea.fr>> wrote: Remember that ConTeXt colors can be accessed in MP as \MPcolor{orange} Alan However with the snippet below I see the default black with MPcolor and the wanted red with \MPvar. Thus? Hans van der Meer \sta

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Meer, Hans van der
t to be done otherwise? \startuseMPgraphic{hans}{color} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm withcolor \MPvar{color}; \stopuseMPgraphic \setupMPvariables[hans][color=red] \starttext \useMPgraphic{hans} \useMPgraphic{hans}{color=blue

[NTG-context] \startuseMPgraphic

2016-04-11 Thread Jeong Dal
. Best regards, Dalyoung > \starttext > \startuseMPgraphic{myname1}{color} > pickup pencircle scaled 1mm; > draw unitsquare scaled 1cm withcolor \MPvar{color}; > \stopuseMPgraphic > > \startuseMPgraphic{myname2}{color=red} > pickup pencircle scaled 1mm; > draw unit

Re: [NTG-context] \startuseMPgraphic

2016-04-11 Thread Wolfgang Schuster
xt \startuseMPgraphic{myname1}{color} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm withcolor \MPvar{color}; \stopuseMPgraphic \startuseMPgraphic{myname2}{color=red} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm withcolor \MPvar{color}; \stopuseMPgraphic \useMPgraphi

[NTG-context] \startuseMPgraphic

2016-04-11 Thread Meer, Hans van der
itsquare scaled 1cm withcolor \MPvar{color}; \stopuseMPgraphic \startuseMPgraphic{myname2}{color=red} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm withcolor \MPvar{color}; \stopuseMPgraphic \useMPgraphic{myname1}{color=blue} \useMPgraphic{myname2}{color=orange} \stoptext Ha

Re: [NTG-context] metafun

2016-03-24 Thread Hans Hagen
On 3/24/2016 6:24 PM, Piotr Kopszak wrote: P.S. For your conveniance, the minimal example: \startMPpositiongraphic{mypos:arrow} pair c[] ; initialize_box(\MPpos{\MPvar{self}}); c[1] := cxy ; initialize_box(\MPpos{\MPvar{to}}); c[2] := cxy ; drawarrow c[1] -- c[2

Re: [NTG-context] metafun

2016-03-24 Thread luigi scarso
On Thu, Mar 24, 2016 at 6:24 PM, Piotr Kopszak wrote: > P.S. > > For your conveniance, the minimal example: > > \startMPpositiongraphic{mypos:arrow} >pair c[] ; >initialize_box(\MPpos{\MPvar{self}}); >c[1] := cxy ; >initialize_box(\MPpos{\MP

Re: [NTG-context] metafun

2016-03-24 Thread Piotr Kopszak
P.S. For your conveniance, the minimal example: \startMPpositiongraphic{mypos:arrow} pair c[] ; initialize_box(\MPpos{\MPvar{self}}); c[1] := cxy ; initialize_box(\MPpos{\MPvar{to}}); c[2] := cxy ; drawarrow c[1] -- c[2] withpen pencircle scaled 2bp ; \stopMPpositiongraphic

Re: [NTG-context] metafun

2016-03-24 Thread Piotr Kopszak
something with the anchors that > it is passed. > > \startMPpositiongraphic{mypos:arrow} > pair c[] ; > initialize_box(\MPpos{\MPvar{self}}); > c[1] := cxy ; > initialize_box(\MPpos{\MPvar{to}}); > c[2] := cxy ; > drawarrow c[1] -- c[2] withpen pencircle s

[NTG-context] Update text variables inside metapost

2015-03-07 Thread DesdeChaves
\def\Bolha[#1]#2#3#4% {\setupMPvariables[bolha][#1]% \setMPtext{labelcima}{#3}% \setMPtext{labelesquerda}{#2}% \setMPtext{labeldireita}{#4}% \useMPgraphic{bolha}} \startuniqueMPgraphic{bolha} path p, q, cima, esquerda, direita, vertical; pair A, B, C; p:=fullcircle scaled \MPvar{size}; A

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Hans Hagen
ghtoverlay} \setMPpositiongraphic{n1}{highlightgraphic}{from=n1,to=n2} \stoppositionoverlay \startMPpositiongraphic{highlightgraphic} save n; path n[]; initialize_box(\MPpos{\MPvar{from}}); n[1] := pxy; initialize_box(\MPpos{\MPvar{to}}); n[2] := pxy; draw n[1]; draw n[2];

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Aditya Mahajan
graphic{n1}{highlightgraphic}{from=n1,to=n2} \stoppositionoverlay \startMPpositiongraphic{highlightgraphic} save n; path n[]; initialize_box(\MPpos{\MPvar{from}}); n[1] := pxy; initialize_box(\MPpos{\MPvar{to}}); n[2] := pxy; draw n[1]; draw n[2]; drawarrow (center n[1]){dir 45} .. {dir -45}(

Re: [NTG-context] \startanimation and \dorecurse

2014-10-22 Thread Jeong Dal
Dear Wolfgang, According to your advice, I am able to make a working example as following. \usemodule[animation] \setupinteraction[state=start] \startuseMPgraphic{Circles}{s} numeric sn, L, N; path p, q; p := fullcircle scaled 72; L:=length p; N:=20; sn := \MPvar{s}; q := subpath (0, sn/N*L

Re: [NTG-context] \startanimation and \dorecurse

2014-10-21 Thread Wolfgang Schuster
=start] > \startuseMPgraphic{Circles}{s} > numeric sn, L, N; > path p, q; > p := fullcircle scaled 72; > L:=length p; > N:=20; > sn:= \MPvar{s}; > q := subpath (0, sn/N*L) of p;% > draw q withcolor red; > fill fullcircle scaled 3 shifted point length q of q withcolor

Re: [NTG-context] \startanimation and \dorecurse

2014-10-21 Thread Jeong Dal
; N:=20; sn:= \MPvar{s}; q := subpath (0, sn/N*L) of p;% draw q withcolor red; fill fullcircle scaled 3 shifted point length q of q withcolor blue; setbounds currentpicture to unitsquare shifted (-0.5,-0.5) scaled 75; \stopuseMPgraphic \starttext \startanimation \dorecurse{20} {\startexpanded

Re: [NTG-context] \startanimation and \dorecurse

2014-10-20 Thread Wolfgang Schuster
ation \dorecurse{5} {\startexpanded \startframe \setupMPvariables[Circles][s=\recurselevel] \processMPbuffer [Circles] \stopframe \stopexpanded} \stopanimation \stoptext Variant 2: \usemodule[animation] \setupinteraction[state=start] \startuseMPgraphic{Circles}{

Re: [NTG-context] passing arguments to \processMPbuffer

2014-04-22 Thread Wolfgang Schuster
Am 22.04.2014 um 14:42 schrieb Jeong Dal : > Dear Wolfgang, > > Thank you for your solution. > Sometimes I need to use \processMPbuffer for the animated graphics. > BTW, what is the differences between ‘MPrawvar’ and ‘MPvar’. > MPvar didn’t work in your example. The \Mprawvar

Re: [NTG-context] passing arguments to \processMPbuffer

2014-04-22 Thread Jeong Dal
Dear Wolfgang, Thank you for your solution. Sometimes I need to use \processMPbuffer for the animated graphics. BTW, what is the differences between ‘MPrawvar’ and ‘MPvar’. MPvar didn’t work in your example. Best regards, Dalyoung

Re: [NTG-context] passing arguments to \processMPbuffer

2014-04-21 Thread Wolfgang Schuster
Am 21.04.2014 um 15:46 schrieb Jeong Dal : > Dear all, > > For \startuseMPgraphic, there is a way to do that (found in metafun book) as > following: > > \startuseMPgraphic{Labels}{s, t} > numeric u; u:= 1cm; > > for i=0 upto 7: > label (textext("$v_{"

[NTG-context] passing arguments to \processMPbuffer

2014-04-21 Thread Jeong Dal
Dear all, For \startuseMPgraphic, there is a way to do that (found in metafun book) as following: \startuseMPgraphic{Labels}{s, t} numeric u; u:= 1cm; for i=0 upto 7: label (textext("$v_{" & decimal (i) & "}$" ), \MPvar{s}[origin,3u*dir(30*i)]) ; label

Re: [NTG-context] MPpositiongraphic: I don't know when it's going to work and when it's not.

2014-01-27 Thread Elspeth McGullicuddy
On Mon, Jan 27, 2014 at 1:34 PM, Hans Hagen wrote: > > you need to anchor the graphic: > > anchor_box(\MPanchor{\MPvar{self}}) ; Thanks a lot, it works now. I wouldn't have guessed: I learnt a lot

Re: [NTG-context] MPpositiongraphic: I don't know when it's going to work and when it's not.

2014-01-27 Thread Hans Hagen
MPinclusions if unknown context_apos : input mp-apos.mpiv ; fi ; if unknown context_abck : input mp-abck.mpiv ; fi ; \stopMPinclusions \startMPpositiongraphic{mypos:circle} numeric x, y, w, h, d, radius; color c; path p ; x = \MPx{\MPvar{self}}; y = \MPy{\MPvar{self}};

[NTG-context] MPpositiongraphic: I don't know when it's going to work and when it's not.

2014-01-18 Thread Elspeth McGullicuddy
can be removed without consequences \startuniqueMPgraphic{first demo} \stopuniqueMPgraphic \startMPpositiongraphic{mypos:circle} % absolute coordinates relative to paper by default? numeric x, y, w, h, d, radius; x = \MPx{\MPvar{self}}; y = \MPy{\MPvar{self}}; w = \MPw{\MPvar{self}};

Re: [NTG-context] command for a MP graphic

2013-05-07 Thread Roland Thiers
Le 8 mai 13 à 06:56, Wolfgang Schuster a écrit : Am 07.05.2013 um 22:28 schrieb Roland Thiers : Thank you very much for this precision, Wolfgang. I tried with two variables and it works with this syntax : \startuniqueMPgraphic{polygoneregulier} numeric u ; u:=\MPvar{unite}*cm

Re: [NTG-context] command for a MP graphic

2013-05-07 Thread Wolfgang Schuster
Am 07.05.2013 um 22:28 schrieb Roland Thiers : > Thank you very much for this precision, Wolfgang. I tried with two variables > and it works with this > syntax : > > \startuniqueMPgraphic{polygoneregulier} > numeric u ; u:=\MPvar{unite}*cm ; > numeric n ; n:=\MPvar{sides

  1   2   >