ectly in MP but easily
run out of memory tokens when the drawing is complex enough.
is there a way to define a function to draw a particular line passing
its coords and pen and color?
do_line(path, pen, color)
where path is a list of x,y points?
8<---
\usecolors[crayola]
\startMPpag
when the drawing is complex enough.
is there a way to define a function to draw a particular line passing
its coords and pen and color?
do_line(path, pen, color)
where path is a list of x,y points?
8<---
\usecolors[crayola]
\startMPpage[offset=5mm]
path p;
pen q[];
q[1] := pencircle
nepalet[MyColors][1=SkyBlue,2=Orange,3=PigPink,4=BananaMania,5=BrilliantRose]
\setuppalet[MyColors]
\starttext
\startMPpage%[Page 7]
numeric p;
p := 4;
lua.MP.MakeByteMap(p);
fill
unitsquare xyscaled (999,999)
withbytemap p;
\stopMPpage
\stoptext
___
t i
guess:
\startMPpage %page 1
color newColor;
newbytemap 1 of (250,250,3);
numeric p ; p := 0;
numeric i ; i := 1;
for x := 0 upto 249:
for y := 0 upto 249:
if i = 1:
newColor := \MPcolor{red};
i := 2;
elseif i = 2:
newColor := \MPcolor{blue};
green. To
get what I expected I rewrote the code as in MPpage page 2, but to get
the desired outcome I had to create 3 bytemaps. So, does this mean that
bytemaps can't be overwritten, or am I missing something?
Best Wishes
Keith
\starttext
\startMPpage %page 1
color newColor;
newby
the large bytemap.
> > I've made a MWE below
> >
> > %%
> > \startMPpage
> > i := 1;
> > for x = 1 upto 5:
> > for y := 1 upto 5:
> > newbytemap i of (250,250,3);
> > setbytemap i to (floor(uniformdeviate(255) +
> > 1),f
emaps with the data from the large bytemap.
I've made a MWE below
%%
\startMPpage
i := 1;
for x = 1 upto 5:
for y := 1 upto 5:
newbytemap i of (250,250,3);
setbytemap i to (floor(uniformdeviate(255) +
1),floor(uniformdeviate(255)
temap.
I've made a MWE below
%%%%%%
\startMPpage
i := 1;
for x = 1 upto 5:
for y := 1 upto 5:
newbytemap i of (250,250,3);
setbytemap i to (floor(uniformdeviate(255) +
1),floor(uniformdeviate(255) + 1),floor(uniformdeviate(255) + 1));
fill
s width and height to discern whether it's wide,
> tall, or square. This works, but I feel I'm reinventing the wheel. Is there a
> more straightforward way to implement this? Any suggestions would be much
> appreciated.
Here is a suggestion :
\starttext
\startMPpage
ith outlinetext, I found it generally works well for
> > both text and equations but seems to fail for fractions or square roots.
> > The code below demonstrates the issue:
> > ____
> > \startMPpage
> > draw outline
On 2/19/2025 10:23 PM, Florent Michel wrote:
Hi,
When experimenting with outlinetext, I found it generally works well for
both text and equations but seems to fail for fractions or square roots.
The code below demonstrates the issue:
\startMPpage
draw outlinetext
Hi,
When experimenting with outlinetext, I found it generally works well for
both text and equations but seems to fail for fractions or square roots.
The code below demonstrates the issue:
\startMPpage
draw outlinetext("$\frac{1}{\sqrt{2}}$");
\
?
it probably is possible, yet how?
Any hints?
AFAIK it’s not possible to change the pen during the path.
At least that was true a few years ago.
Here's the logo of the CMS:
\startMPpage
path p ; p := fullcircle xyscaled (100,70) ;
path s ; s := nepstroke (1000) (.25 + uniformdevi
> data cs=polar,
> > ]
> > coordinates {
> > (90,4) [color=red]
> > (210,4) [color=green]
> > (-30,4) [color=blue]
> > };
> > \stopaxis
> > \stoptikzpicture
> > \stopTEXpage
> > \stoptext
&g
draw a sequence of triangles, each with a linear gradient:
\startMPpage
def LinearIntTriangle(expr pa, pb, pc, cola, colb, colc, n_iter) =
for i = n_iter step -1 until 1 :
path p;
x := i / n_iter;
y := (i
awarrow (a * xstep, b * ystep) -- ( c * xstep, d * ystep)
withpen pencircle scaled .5mm withcolor mycolor;
enddef ;
% touchtolink
def touchtolink (expr a, b) (text t) =
label
("\framed[background=color,backgroundcolor=transparentwhite,align=normal,corner=00,frame=no]{"
& t &a
:
\startMPpage
def LinearIntTriangle(expr pa, pb, pc, cola, colb, colc, n_iter) =
for i = n_iter step -1 until 1 :
path p;
x := i / n_iter;
y := (i - 0.5) / n_iter;
p := pa -- (pa + x * (pb - pa)) -- (pa + x * (pc - pa
ink
def touchtolink (expr a, b) (text t) =
label
("\framed[background=color,backgroundcolor=transparentwhite,align=normal,corner=00,frame=no]{"
& t &"}", (a * xstep, b * ystep));
enddef ;
\stopMPinclusions
\startMPpage
% Picture
draw e
image shows only the bottom
left corner (the part where the red circle and yellow square overlap).
To get the center of the picture you can either ship fullcircle by .5 in
the x and y direction or use unitcircle.
begin example
\startMPpage[offset=1cm]
fill unitsquare scaled 5cm withcolor
On 01/01/2025 22:25, Hans Hagen wrote:
define more colors
anyway, you can try to comment line 1543 in mlib-pps.lmt and then, after
making a new format file, see if
\startMPpage
definecolor [ name = "MyColor", r = .5, g = .25, b = .25 ] ;
fill fullsquare xyscaled (
and then, after
making a new format file, see if
\startMPpage
definecolor [ name = "MyColor", r = .5, g = .25, b = .25 ] ;
fill fullsquare xyscaled (40mm, 15mm) withcolor "MyColor" ;
fill fullsquare xyscaled (40mm, 15mm) shifted (42mm, 0mm) withcolor
.5 * namedcol
make variants of it). Example:
\startMPpage[offset=1dk]
fill function(2,"x","sin(x)",0,epsed(6*pi),0.1)
scaled 20
penstroked
function(2,"x","1+7*(sin(x)^2)",0,epsed(pi),0.001)
withcolor "orange" ;
\stopMPpage
/Mikael
On Fri, Dec 6
shifted
(12,12)withcolor red;
draw ((0,0)-- (1,0))scaled 10 withpen TcirclePen rotated 180 shifted
(12,12)withcolor red;
On 06/12/2024 19:16, Wolfgang Schuster wrote:
Hi,
are there now better ways to create rounded pens without adding many
support points?
\starttext
\startMPpage[offset=1dk
Hi,
are there now better ways to create rounded pens without adding many
support points?
\starttext
\startMPpage[offset=1dk]
path Halfcircle ; Halfcircle = (1,0){up} for i = 1 upto 180 : .. ((1,0)
rotated i) endfor -- cycle ;
draw Halfcircle scaled 10 shifted (0,12) ;
pen HalfcirclePen
ides part
of the path.
Mikael’s solution is neat because he doesn’t just hide part of the path, he
makes a new path with that part completely removed. If you name that path, you
can do whatever you want with it — draw it, scale it, put it in an image()
command, etc.
\startMPpage[offset=1DK]
-(2u,0)--(3u,u)--(3u,0)--(4u,0);
>> q := (3u,u)--(3u,0);
>> pic := image(draw p; draw q withcolor white;);
>>
>> draw pic;
>> \stopMPcode
>
> It is not clear how general you want this to be. For your example you
> can draw only the parts of p you need.
>
; \stopMPcode
It is not clear how general you want this to be. For your example you
can draw only the parts of p you need.
\startMPpage[offset=1DK]
path p,q;
picture pic;
numeric u; u:= 1cm;
p := origin--(2u,0)--(3u,u)--(3u,0)--(4u,0);
q := (3u,u)--(3u,0);
% pic := image(draw p; draw q withc
riation or passing the shape as argument).
BTW: Use && to connect the parts of the line to avoid graphical errors
in your pdf viewer.
\startMPpage[offset=1pt]
pickup pensquare scaled 1 ;
draw (0,0) ;
draw (1,0) ;
draw (0,2) && (1,2
essed
automatically when it changes).
Hans
-
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----\startMP
ber := uniformdeviate(1);
draw textext(decimal(arandomnumber)) scaled 0.5;
);
\stopMPinclusions
\startMPpage
draw AnImage ;
draw AnotherImage ;
\stopMPpage
\startMPpage
draw AnImage ;
draw AnotherImage ;
\stopMPpage
\stoptext
uming there is no other
misunderstanding from me) is:
\startMPpage
pair A,B;
path p, psubPath, asPathEnvelope;
A = (0cm,0cm);B = (5cm,0cm);
p = A{dir 60} .. B;
fill fullsquare scaled 12cm withcolor 0.5[blue,white];
for i = 0 step 5 until 355:
psubPath := (subpath((0.1 * length p), (1 * length p) )
Apologies for the double email. Seems I slightly misunderstood what you
aimed for - the corrected (assuming there is no other misunderstanding from
me) is:
\startMPpage
pair A,B;
path p, psubPath, asPathEnvelope;
A = (0cm,0cm);B = (5cm,0cm);
p = A{dir 60} .. B;
fill fullsquare scaled 12cm
Hi,
It's probably not the best solution as it uses the ‘old’ shading method,
but seems to give the result you were expecting:
\startMPpage
pair A,B;
path p, psubPath, asPathEnvelope;
A = (0cm,0cm);B = (5cm,0cm);
p = A{dir 60} .. B;
fill fullsquare scaled 12cm withcolor 0.5[blue,white];
for
spiral. Here is the code:
\startMPpage
pair A,B; path p, psubPath, asPathEnvelope; A = (0cm,0cm);B = (5cm,0cm);
p = A{dir 60}.. B; fill fullsquare scaled 12cm withcolor
0.5[blue,white]; for i = 0 step 5 until 355: psubPath := (subpath((0.1 *
length p), (1 * length p))of p)rotated i
\starttext
\startMPpage
path tt ; tt := lmt_outline [
kind = "outline",
text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
] xsized 12cm ;
% fill tt
% withshademethod "linear"
% withshadedirection down
% wit
ia.
>>
>> My file is:
>>
>> \setupbodyfont[cambria]
>> \definefont[symbola][file:symbola*default at 10pt]
>> \starttext
>> \startMPpage[offset=1dk]
>> draw textext("AC{\symbola ⚡}DC");
>> \stopMPpage
>> \stoptext
>
>Which result (YE
Lutz Haseloff schrieb am 16.08.2024 um 09:47:
Hi Hans, hi all,
the latest ConTeXt lmtx seems to have a problem with MS Cambria.
My file is:
\setupbodyfont[cambria]
\definefont[symbola][file:symbola*default at 10pt]
\starttext
\startMPpage[offset=1dk]
draw textext("AC{\symbola
Hi Hans, hi all,
the latest ConTeXt lmtx seems to have a problem with MS Cambria.
My file is:
\setupbodyfont[cambria]
\definefont[symbola][file:symbola*default at 10pt]
\starttext
\startMPpage[offset=1dk]
draw textext("AC{\symbola ⚡}DC");
\stopMPpage
\stoptext
mtxrun find
0.3
local ymin = 0.4
local function f(x,y)
local x = xstep*x - xmin
local y = ystep*y - ymin
local z = x + exp(-60*x) - y
if z > 0 then
return '1'
else
return '0'
end
end
potrace.setbitmap("mybitmap", potrace.contourp
erstand.
> > Thanks
> > Fabrice
> >
> > \startMPpage[offset=1DK]
> >
> >numeric u;
> >u = 6cm;
> >
> >interim linejoin := mitered;
> >interim ahangle := 30;
> >
> >path xx,
On 5/12/2024 3:57 PM, Fabrice Couvreur wrote:
Hi,
When I want to draw the curve which corresponds to n=60 (blue curve), it
doesn't seem possible: I don't understand.
Thanks
Fabrice
\startMPpage[offset=1DK]
numeric u;
u = 6cm;
interim linejoin
Hi,
When I want to draw the curve which corresponds to n=60 (blue curve), it
doesn't seem possible: I don't understand.
Thanks
Fabrice
\startMPpage[offset=1DK]
numeric u;
u = 6cm;
interim linejoin := mitered;
interim ahangle := 30;
p
od.nl
-
outlines-003.pdf
Description: Adobe PDF document
\continuewhenlmtxmode
\starttext
\startMPpage[offset=10pt]
draw lmt_outline [
text = "\mathematics{\sqrt{2}-1}"
] ;
draw lmt_outline [
text = "\mathe
As for the current ConTeXt, the example above still produces the wrong
output. Can anyone reproduce this case? Thank you in advance.
Jairo
El sáb, 4 may 2024 a la(s) 7:23 p.m., Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:
> Hi, list
>
> \startMPpage
> draw outlinetext.d(&
Hi, list
\startMPpage
draw outlinetext.d("\mathematics{\sqrt{2}-1}")(withcolor black withpen
currentpen) scaled 1;
\stopMPpage
fails (radicals are not drawn at all). As for context --version,
mtx-context | ConTeXt Process Management 1.06
mtx-context |
mtx-context | ma
isible 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
>> b
ly 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
>
>
e 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
&
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 compi
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 !!
\startpr
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
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 =
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
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",
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
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
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 ; pp := bb enlarged 2cm ;
fill pp
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
look 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 p
mples 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
=ff1aa4]
\startMPpage
picture Mytext;
Mytext := btex hello etex;
draw lmt_shade [
picture="Mytext",
direction = "right",
domain= { 0, 2 },
colors= { "headerGleft", "headerGright" },
] ;
\stopMPpage
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 fr
ut format 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 alw
t to do some 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 (
ycle'. So I'll 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",
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 = "MyC
So I'll 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 =
unifor
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
>
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
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 or \star
…\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
] = {{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
h TheFrame ;
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
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
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
at 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
)) &&&&
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
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
, 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
= (10,70);
>
> p1:=image(
> label(textext("Word 1"), z1);
> );
>
> p2:=image(
> label(textext("Mot 2"), z2);
> );
>
> p3:=image(
> label(textext("Parola 3"), z3);
> );
>
> \stopMPinclusions
>
> \starttext
>
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:
>
> \startuseM
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:=
lusions
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);
);
\stopMPin
..z1..z2..z3..z4 ;
>> pair AStartPoint; AStartPoint = 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..AEndPoin
; draw A withcolor red;
> );
>
> p2:=image(draw A; label(lmt_outline [
> text = "\JapaneseFont 日本語"
> ], AEndPoint););
>
> p3:=image(
> label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2,
> BStartPoint);
> );
>
> p4:=ima
t 日本語"
> ], 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
ot;) scaled 1.2, BStartPoint);
);
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}{ %
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 pass
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
.
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 layout
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
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
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 that into a
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
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
laced 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 =
http://www.w3.org/2000/svg";>
\stopbuffer
\starttext
\startTEXpage
\includesvgbuffer[gradient]
\stopTEXpage
\startMPpage
fill unitsquare xyscaled (200,100)
withshademethod "linear&qu
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
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
ult in 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):
1 - 100 of 881 matches
Mail list logo