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
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
>
>
>
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 compile my
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
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
:
\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
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
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
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
=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 frames to include
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
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
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 =
>
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
/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
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
…\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
;
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
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
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
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
)) &&&&
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
,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:
>
> \startuseMPgrap
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
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
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
=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
, 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);
);
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
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
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 lay
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
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
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
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
.org/2000/svg;>
\stopbuffer
\starttext
\startTEXpage
\includesvgbuffer[gradient]
\stopTEXpage
\startMPpage
fill unitsquare xyscaled (200,100)
withshademethod "linear"
withs
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
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):
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
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
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
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
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
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]
> >
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
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
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
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;
>\
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
> % 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
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
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]
> 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.
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
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
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
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
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
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
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
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
>>
> >>> 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
> 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
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
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
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
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
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
. 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
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
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
> 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(
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
d I approach this?
Like this ?
\startMPpage
draw externalfigure "thefile.pdf";
(… other commands…)
\stopMPpage
>
> Sincerely,
> Stefan
Fabrice.
> ___
> If your question is o
; > 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
>
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
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":
>&
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
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
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
@@ -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
adventor]
> \storexheight[pagella]
> \storexheight[heros]
>
> \starttext
> \startMPpage
> draw textext.origin("\setxheight[adventor][1cm]Hello!");
>
> draw (0, 1cm) -- (6cm, 1cm);
> \stopMPpage
>
>
\relax]
\stoptexdefinition
\storexheight[adventor]
\storexheight[pagella]
\storexheight[heros]
\starttext
\startMPpage
draw textext.origin("\setxheight[adventor][1cm]Hello!");
draw (0, 1cm) -- (6cm, 1cm);
\
1 - 100 of 812 matches
Mail list logo