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;
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
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
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
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
reading.
Best regards,
Dalyoung
\startbuffer[styleOutline]
\startuseMPgraphic{outlineT}
draw lmt_outline [
text = \MPvar{tt},
kind = "both",
width = OverlayWidth,
align = "middle",
fillcolor = "gray&quo
:= 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
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
;>>>> \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
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
} \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
> > >
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
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
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
]\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"
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
;
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
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
- 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
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
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
(\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
?
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
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
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
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
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
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;
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
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
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}
version,i)
> context.stopxcell()
> for j=1,n do
> context.startxcell { align = "middle" }
> action(string.sub(pattern[i],j,j))
> context.stopxcell()
>
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
> \defineoverlay[frames][\positionoverlay{frames}]
> >
> > \setupbackgrounds[text][background=frames]
> >
> >
> > \startMPpositiongraphic{frame}
> >
> > if unknown context_apos : input mp-apos.mpiv ; fi ;
> >
> > \MPgetposboxes{\MPvar{self}}
; 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
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
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
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 :
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
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
:= 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("
:= 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
:= 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
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
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
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
,
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
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
[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
]
\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
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
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)
#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}{
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
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
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}
);
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
;
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
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 :=
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
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
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
\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
,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
:= 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
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
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
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
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
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
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}
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
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
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:
>
>>
>
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}}.
\
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
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
.
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
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
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
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
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
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
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
\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
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];
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}(
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
=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
;
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
ation
\dorecurse{5}
{\startexpanded
\startframe
\setupMPvariables[Circles][s=\recurselevel]
\processMPbuffer [Circles]
\stopframe
\stopexpanded}
\stopanimation
\stoptext
Variant 2:
\usemodule[animation]
\setupinteraction[state=start]
\startuseMPgraphic{Circles}{
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
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
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_{"
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
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
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}};
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}};
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
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 - 100 of 184 matches
Mail list logo