Hi,
I get different results when I compile the following file using mkii and
mkiv. See the attached pdf output. I am using (I know, I need to update)
mpost -v = MetaPost 1.005 (Web2C 7.5.5)
context --version = 2008.06.22 17:38
\setupcolors [state=start]
\starttext
\startMPpage
z.1
lua
code, but for now, just use textext().
why not use
\starttext
\startMPpage
a=.7in; b=0.5in;
z0=(0,0); z1=(a,0); z2=(0,b);
z0=.5[z1,z3]=.5[z2,z4];
draw z1..z2..z3..z4..cycle;
drawarrow z0..z1;
drawarrow z0..z2;
label.top(btex $a$ etex, .5[z0,z1]);
label.lft(btex $b$ etex, .5[z0,z2]);
endfig
=\textwidth]
\stopMPinclusions
\starttext
\startMPpage
\startFLOWchart[SIRS]
\stopFLOWchart
\FLOWchart[SIRS]
\stopMPpage
\stoptext
But I am getting the following error. Any suggestions?
systems : system commands are disabled
(/usr/local/texlive/2007/../texmf-local/tex/context/base/pdfr
\bodyfontsize,
height=7\bodyfontsize,
maxwidth=\textwidth]
%%% \stopMPinclusions
\starttext
%%% \startMPpage
\startTEXpage
\startFLOWchart[SIRS]
\stopFLOWchart
\FLOWchart[SIRS]
%%% \stopMPpage
\stopTEXpage
\stoptext
But I am getting the following error. Any suggestions?
i never
[optional format][name][optional settings]
which i somehow dislike
3. What about \startMPcode, \startMPpage, and \processMPbuffer? I think
that the first approach will be easier to adapt.
another option is:
\useMPformat{metafun}
(the reason for { }instead of [] is that it then can be used within
.
\startuseMPgraphic[metafun]{...} is also an option but not consistent,
unless we provide
\startuseMPgraphic[optional format][name][optional settings]
which i somehow dislike
3. What about \startMPcode, \startMPpage, and \processMPbuffer? I think
that the first approach will be easier to adapt
\startMPpage
LABEL(oeps,origin) ;
\stopMPpage
works ok on my machine using pdftex but luatex gives an unknown (have to
look into it)
Hans
-
Hans Hagen | PRAGMA ADE
, then
maybe something like
\startuseMPgraphic{::metafun::bla} so that it does not break existing
code.
3. What about \startMPcode, \startMPpage, and \processMPbuffer? I think
that the first approach will be easier to adapt.
Aditya
Hi all,
I want to make a dvi output of one or more math formulas, on a page of
minimal size, ie the size of the formula; I had asked the same thing for a
metapost/fun graphic sometime ago, the answer had been:
\startMPpage
...
\stopMPpage
but I guess I can't use that here!
tia,
--
Jean
:
\startMPpage
...
\stopMPpage
but I guess I can't use that here!
\starttext
\startTEXpage
$$
c^2=a^2+b^2
$$
\stopTEXpage
\stoptext
The $$ pair give a better result in this case than the normal formula
environment.
Wolfgang
the same thing for a
| metapost/fun graphic sometime ago, the answer had been:
| \startMPpage
| ...
| \stopMPpage
|
| but I guess I can't use that here!
| \starttext
| \startTEXpage
| $$
| c^2=a^2+b^2
| $$
| \stopTEXpage
| \stoptext
| The $$ pair give a better result in this case than
\startmakeup[name][settings] \stopmakeup
\startmarginblock \stopmarginblock
\startmarginrule[number] \stopmarginrule
# \startmode \stopmode
# \startMPpage \stopMPpage
\startnamemakeup \stopnamemakeup
\startnarrower[left|middle|right] \stopnarrower
# \startnointerference \stopnointerference
# \startnotmode
?
\starttext
\startMPcode % or \startMPpage
for i=0 upto 10:
for j=0 upto 20:
fill fullcircle scaled 1mm shifted ((i,j) scaled 1cm);
endfor;
endfor;
\stopMPcode
\stoptext
Mojca
Because TeX is faster in this situation and it takes more time to write
On 10/10/07, MASON Peter J wrote:
Hope to create a regular (1cm spacing) grid on page, of bullets. Ultimately
over the whole page.
Why not using MetaPost?
\starttext
\startMPcode % or \startMPpage
for i=0 upto 10:
for j=0 upto 20:
fill fullcircle scaled 1mm shifted ((i,j) scaled 1cm
2007/10/10, Mojca Miklavec [EMAIL PROTECTED]:
On 10/10/07, MASON Peter J wrote:
Hope to create a regular (1cm spacing) grid on page, of bullets. Ultimately
over the whole page.
Why not using MetaPost?
\starttext
\startMPcode % or \startMPpage
for i=0 upto 10:
for j=0 upto 20
On 10/10/07, Wolfgang Schuster wrote:
2007/10/10, Mojca Miklavec:
On 10/10/07, MASON Peter J wrote:
Hope to create a regular (1cm spacing) grid on page, of bullets.
Ultimately
over the whole page.
Why not using MetaPost?
\starttext
\startMPcode % or \startMPpage
for i=0
\startMPpage:
\setupcolors[state=start]
\starttext
\startMPpage
fill fullcircle scaled 5cm withcolor red ;
\stopMPpage
\stoptext
Wolfgang
___
If your question is of interest to others as well, please add an entry to the
Wiki
we have also \startMPpage:
\setupcolors[state=start]
\starttext
\startMPpage
fill fullcircle scaled 5cm withcolor red ;
\stopMPpage
\stoptext
Great! I keep forgetting those.
Patrick
___
If your question
withcolor red ;
| \stopuseMPgraphic
| \useMPgraphic{dummy}
| \stopTEXpage
| \stoptext
|
| Patrick
| we have also \startMPpage:
| \setupcolors[state=start]
| \starttext
| \startMPpage
| fill fullcircle scaled 5cm withcolor red ;
| \stopMPpage
| \stoptext
| Wolfgang
Patrick and Wolfgang, thak
) =
label.rt (textext(You passed \quotation{ t }), (x,y))
enddef;
\stopMPinclusions
\startMPpage
myfunc (0,0) (Hello) ;
myfunc (2cm,1cm) (World) ;
\stopMPpage
\stoptext
Aditya
___
If your question
\loadfontfileoncetrue \readfile {cont-en.tmp}{}{}\starttext
\startMPpage
beginfig(1);
path p;
p := fullcircle scaled 2in yscaled 0.5;
label(btex hello etex, origin);
draw p;
endfig; \stopMPpage
\stoptext
Running 'texexec texexec.tex' produces the right pdf file, so I don't
know what's going on. But off
*everything* by u.
Try this: set u back to 1, then add a second MPpage like this:
\startMPpage
u:= 2;
fill_hline(20,5,5,red) ;
fill_vline(20,5,5,red) ;
draw_vline(20,5,25,blue) ;
draw_hline(20,25,5,blue) ;
draw_frame(50,50,0,0,black) ;
\stopMPpage
It should be clear from
but that you are scaling *everything* by u.
Try this: set u back to 1, then add a second MPpage like this:
\startMPpage
u:= 2;
fill_hline(20,5,5,red) ;
fill_vline(20,5,5,red) ;
draw_vline(20,5,25,blue) ;
draw_hline(20,25,5,blue) ;
draw_frame(50,50,0,0,black
)--cycle
withpen pensquare scaled u
shifted (a*u,b*u)
withcolor c
enddef ;
\stopMPinclusions
\startMPpage
fill_hline(20,5,5,red) ;
fill_vline(20,5,5,red) ;
draw_vline(20,5,25,blue) ;
draw_hline(20,25,5,blue) ;
draw_frame(50,50,0,0,black) ;
\stopMPpage
\stoptext
;
\stopMPinclusions
\startMPpage
fill_hline(20,5,5,red) ;
fill_vline(20,5,5,red) ;
draw_vline(20,5,25,blue) ;
draw_hline(20,25,5,blue) ;
draw_frame(50,50,0,0,black) ;
\stopMPpage
\stoptext
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl
=
\setupoutput[pdftex]
\setupcolors[state=start]
\global \loadfontfileoncetrue \starttext
\startMPpage
beginfig(1);
label(\sometxt{\vbox {\halign {##\hfil \cr h\cr x\cr }}}, origin);
endfig; \stopMPpage
\stoptext
texexec.tex =
The ## in the expanded argument to \sometxt
thread' is how I debug.
consider a static graphic to be(have) like an external figure, it's
basically mp code processes as startMPpage .. stopMPpage
Hans
--
-
Hans Hagen | PRAGMA ADE
\n
end
f \\starttext\n
f \\startMPpage\n
f data.gsub(/end\.*\s*$/m, '') # a bit of a hack
f \\stopMPpage\n
f \\stoptext\n
, but the MP section, _while at
first showing the correct font_, then changes to CM before my eyes. (my
pdf viewer auto-updates).
hm, looks like a bronwser problem
what happens if you only include the graphic,
\startMPpage
z40 = (2cm,0cm); z41 = (3cm,0cm) ;
z42 = (3cm,1cm
problem
what happens if you only include the graphic,
\startMPpage
z40 = (2cm,0cm); z41 = (3cm,0cm) ;
z42 = (3cm,1cm); z43 = (2cm,1cm) ;
z46 = (2.5cm,.5cm) ;
path F ; F := (z40--z41--z42--z43--cycle) ;
linejoin := mitered ;
drawpath F ;
label(very, z46
.
hm, looks like a bronwser problem
what happens if you only include the graphic,
\startMPpage
z40 = (2cm,0cm); z41 = (3cm,0cm) ;
z42 = (3cm,1cm); z43 = (2cm,1cm) ;
z46 = (2.5cm,.5cm) ;
path F ; F := (z40--z41--z42--z43--cycle) ;
linejoin := mitered
\startMPpage
label.top(btex $a$ first etex,origin) ;
\stopMPpage
\stoptext
While this works.
\usetypescript[palatino][ec]
\setupbodyfont[palatino,10pt]
\startMPenvironment
\usetypescript[palatino][ec]
\setupbodyfont[palatino,10pt]
\stopMPenvironment
\starttext
\startMPpage
explained, one should have a
[global] with MPenvironments anyway.
\starttext
\startMPpage
label.top(btex $a$ first etex,origin) ;
\stopMPpage
\stoptext
While this works.
\usetypescript[palatino][ec]
\setupbodyfont[palatino,10pt]
\startMPenvironment
\usetypescript[palatino][ec
nvironment
\usetypescript[palatino][ec]
\setupbodyfont[palatino,10pt]
\stopMPenvironment
This still does not work, but as Hans explained, one should have a
[global] with MPenvironments anyway.
\starttext
\startMPpage
label.top(btex $a$ first etex,origin) ;
\
]
\stopMPenvironment
\starttext
\startMPpage
label.top(btex $a$ first etex,origin) ;
\stopMPpage
\stoptext
While this works.
\usetypescript[palatino][ec]
\setupbodyfont[palatino,10pt]
\startMPenvironment
\usetypescript[palatino][ec]
\setupbodyfont[palatino,10pt]
\stopMPenvironment
Hi,
How can I make MPinclusions consider # as a normal character.
\startMPinclusions
input metaobj;
vardef [EMAIL PROTECTED](text name) text options=
[EMAIL PROTECTED](textext(name)) options;
enddef;
\stopMPinclusions
\starttext
\startMPpage
block.source(Source) ;
source.c = origin
the figures from the main document).
uniqueMPgraphic provides the first functionality, but the figure is
converted into pdf on runtime (thereby increasing the processing time
of the document).
I can use a separate document with each figure inside a \startMPpage
... \stopMPpage, but (i) I need
be able to include the figure using a label
(so that I can separate the figures from the main document).
you can use the figure database mechanism (davids arnold does that)
or make individual files, say 'thatfile.tex'
\starttext \startMPpage
fill fullcircle scaled 10cm;
\stopMPpage \stoptext
On Thu, 18 May 2006, Taco Hoekwater wrote:
Aditya Mahajan wrote:
On Tue, 9 May 2006, Aditya Mahajan wrote:
--batch --interaction=batch does not always process file in batch
mode, while internally running mp.
\starttext
\startMPpage
draw path ;
\stopMPpage
\stoptext
texmfstart
Aditya Mahajan wrote:
On Tue, 9 May 2006, Aditya Mahajan wrote:
--batch --interaction=batch does not always process file in batch
mode, while internally running mp.
\starttext
\startMPpage
draw path ;
\stopMPpage
\stoptext
texmfstart texexec.rb --batch --interaction=batchmode --pdf test
On Tue, 9 May 2006, Aditya Mahajan wrote:
--batch --interaction=batch does not always process file in batch
mode, while internally running mp.
\starttext
\startMPpage
draw path ;
\stopMPpage
\stoptext
texmfstart texexec.rb --batch --interaction=batchmode --pdf test
should not stop
=marginedge, state=stop]
\starttext
% Title page
\startMPpage
% Some metafun
\stopMPpage
% Some text
\stoptext
The resulting pdf has a smaller first page (thesis size) while the
rest are A4 with the thesis pages place centrally. I would like to see
the title page
=on]
\setuppagenumbering
[alternative=doublesided, location=marginedge, state=stop]
\starttext
% Title page
\startMPpage
% Some metafun
\stopMPpage
% Some text
\stoptext
The resulting pdf has a smaller first page (thesis size) while the
rest are A4 with the thesis pages place centrally. I would like
2006/5/11, Hans Hagen [EMAIL PROTECTED]:
\definepapersize[thesis][width=169mm, height=239mm]
\setuppapersize[thesis][A4]
\definelayer[page][width=\paperwidth,height=\paperheight]
\starttext
\startTEXpage
\setlayer
[page]
[preset=lefttop,x=3cm,y=4cm]
]
\usemodule[fig-base]
\usefigurebase[figures/figlibSection1]
\section[section:numbers]{Number systems}
The files section1figs.tex and section2figs.tex contain Metapost code in
\startMPpage
...
\stopMPpage
pairs. The figure libraries figlibSection1.xml and figlibSection2.xml
look like this:
?xml
Dear expertise,
I have the following:
\definepapersize[thesis][width=169mm, height=239mm]
\setuppapersize[thesis][A4]
\setuplayout
[location=middle, marking=on]
\setuppagenumbering
[alternative=doublesided, location=marginedge, state=stop]
\starttext
% Title page
\startMPpage
% Some metafun
]
\starttext
% Title page
\startMPpage
% Some metafun
\stopMPpage
% Some text
\stoptext
The resulting pdf has a smaller first page (thesis size) while the
rest are A4 with the thesis pages place centrally. I would like to see
the title page placed on an A4 sheet as well. What am I doing wrong
--batch --interaction=batch does not always process file in batch
mode, while internally running mp.
\starttext
\startMPpage
draw path ;
\stopMPpage
\stoptext
texmfstart texexec.rb --batch --interaction=batchmode --pdf test
should not stop at the error. However it does. Running ConTeXt ver
Aditya Mahajan wrote:
Hi,
Is the mp support for btex...etex broken in the latest context
(ConTeXt ver: 2006.04.27 15:59) The following does not compile,
\starttext
\startMPpage
label(btex This is a test etex, origin) ;
\stopMPpage
\stoptext
I get an error
! Unable to make
On 5/3/06, Aditya Mahajan wrote:
Hi,
Is the mp support for btex...etex broken in the latest context
(ConTeXt ver: 2006.04.27 15:59) The following does not compile,
\starttext
\startMPpage
label(btex This is a test etex, origin) ;
\stopMPpage
\stoptext
I get an error
! Unable
On Wed, 3 May 2006, Mojca Miklavec wrote:
On 5/3/06, Aditya Mahajan wrote:
Hi,
Is the mp support for btex...etex broken in the latest context
(ConTeXt ver: 2006.04.27 15:59) The following does not compile,
\starttext
\startMPpage
label(btex This is a test etex, origin
Hi,
Is the mp support for btex...etex broken in the latest context
(ConTeXt ver: 2006.04.27 15:59) The following does not compile,
\starttext
\startMPpage
label(btex This is a test etex, origin) ;
\stopMPpage
\stoptext
I get an error
! Unable to make mpx file.
l.123 label(btex
:
All,
I have the strangest Metapost error. The attached file compiles with:
texexec section1figs
It compiles just fine. But if I take the last graphic in the file,
copy it (everything between last \startMPpage...\stopMPpage pair,
including \startMPpage ... \stopMPpage, then paste
All,
I have the strangest Metapost error. The attached file compiles with:
texexec section1figs
It compiles just fine. But if I take the last graphic in the file,
copy it (everything between last \startMPpage...\stopMPpage pair,
including \startMPpage ... \stopMPpage, then paste
. The attached file compiles with:
texexec section1figs
It compiles just fine. But if I take the last graphic in the file,
copy it (everything between last \startMPpage...\stopMPpage pair,
including \startMPpage ... \stopMPpage, then paste it at the end of
the file, then I get this error
\startMPpage...\stopMPpage pair,
including \startMPpage ... \stopMPpage, then paste it at the end of
the file, then I get this error:
[10.1] [MP to PDF] (./section1figs-mpgraph.11) [11.1] [MP to PDF]
(./section1figs-mpgraph.12
! Dimension too large.
recently read \onebasepoint
On 3/19/06, David Arnold wrote:
All,
I have this:
\startMPpage %figure library name: sec3q1
...
%label extrema
dotlabel.top(btex Local Maximum etex, (-3.2,f(-3.2)) xyscaled (ux,uy));
dotlabel.bot(btex Local Minimum etex, (3.2,f(3.2)) xyscaled (ux,uy));
\stopMPpage
What I'd like to do
All,
I have this:
\startMPpage %figure library name: sec3q1
%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-10;
xmax:=10;
xscl:=1;
ymin:=-200;
ymax:=200;
yscl:=20;
%initialize number of points
numeric num_points;
num_points:=200;
%initialize dimensions
Lutz Haseloff wrote:
Hi Hans, Hi all,
I would like to typeset chinese labels with metapost.
My code is:
-
\starttext
\startMPpage
verbatimtex
\enableregime[utf]
\usemodule[chi-00]
etex;
label(btex ? etex,(0,0));
\stopMPpage
\stoptext
try:
\starttext
try:
\starttext
\startMPenvironment
\enableregime[utf]
\usemodule[chi-00]
\stopMPenvironment
\startMPpage
label(btex ÆÇæà etex,(0,0));
\stopMPpage
\stoptext
instead.
Hans
This works fine, thanks
Greetings Lutz
___
ntg
Hi Hans, Hi all,
I would like to typeset chinese labels with metapost.
My code is:
-
\starttext
\startMPpage
verbatimtex
\enableregime[utf]
\usemodule[chi-00]
etex;
label(btex ? etex,(0,0));
\stopMPpage
\stoptext
-
It results in the errormessage:
! Argument
\startMPenvironment
\setupbodyfont[8pt]
\setupframed[width=3cm, align=center, frame=off]
\stopMPenvironment
\startMPinclusions
input metaobj;
setObjectDefaultOption(Ellipse)(fit)(false)
setCurveDefaultOption(arcangleA,15);
setCurveDefaultOption(arcangleB,15);
\stopMPinclusions
\startMPpage
All,
With the wincontext installed, I run:
texexec section1figs
and I wind up with only section1figs-mpgraph.1. I want all of them.
What switch should I throw at texexec.
My source looks like:
\startMPpage
...
\stopMPpage
\startMPpage
...
\stopMPpage
etc.
David Arnold
College
David Arnold wrote:
All,
With the wincontext installed, I run:
texexec section1figs
and I wind up with only section1figs-mpgraph.1. I want all of them.
What switch should I throw at texexec.
My source looks like:
\startMPpage
...
\stopMPpage
\startMPpage
...
\stopMPpage
etc
-mpgraph.1. I want all of them.
What switch should I throw at texexec.
My source looks like:
\startMPpage
...
\stopMPpage
\startMPpage
...
\stopMPpage
etc.
eh ... when you have run-time metapost processing, figure slots are
reused when possible, so there is a good chance that you
All,
I have:
\startMPpage %figure library name: intersection
%initialize scale
numeric u; 10u=3in;
%ellipses
path A, B;
A:=fullcircle xyscaled (4u,3u);
B:=A shifted (2u,0);
draw A withcolor red;
label.ulft(btex $A$ etex, point 3 of A) withcolor red;
draw B withcolor blue
--- On Jan 19, David Arnold wrote ---
All,
I have:
\startMPpage %figure library name: intersection
%initialize scale
numeric u; 10u=3in;
%ellipses
path A, B;
A:=fullcircle xyscaled (4u,3u);
B:=A shifted (2u,0);
draw A withcolor red;
label.ulft(btex $A$ etex, point 3
;
p:=p cutbefore cpath;
p:=p xyscaled (ux,uy);
drawdblarrow p txt;
enddef;
\stopMPinclusions
\starttext
\startMPpage %figure library name: x2
%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-10;
xmax:=10;
xscl:=1;
ymin:=-10;
ymax:=10;
yscl:=1;
%initialize
--(scantokens(ind),scantokens(dep));
endfor;
hide(x:=r;) p:=p--(scantokens(ind),scantokens(dep));
p:=p cutbefore cpath;
p:=reverse p;
p:=p cutbefore cpath;
p:=p xyscaled (ux,uy);
drawdblarrow p txt;
enddef;
\stopMPinclusions
\starttext
\startMPpage %figure library name: x2
%initialize
I'm trying to play with colors in textext inclusions:
\setupcolors[state=start]
\setupMPpage[offset=2mm]
\startuseMPgraphic{test}
label(textext(\color[green]{XYZ}), (0,0));
\stopuseMPgraphic
\starttext
\forceMPTEXgraphictrue
\startMPpage
\includeMPgraphic{test}
\stopMPpage
Hans van der Meer wrote:
I'm trying to play with colors in textext inclusions:
\setupcolors[state=start]
\setupMPpage[offset=2mm]
\startuseMPgraphic{test}
label(textext(\color[green]{XYZ}), (0,0));
\stopuseMPgraphic
\starttext
\forceMPTEXgraphictrue
\startMPpage
\includeMPgraphic{test
}), (0,0)); % returns
black XYZ on execute
label(textext(\startcolor[red]{XYZ}\stopcolor), (0,20)); % returns
unknown on execute
\stopuseMPgraphic
\starttext
\forceMPTEXgraphictrue
\startMPpage
\includeMPgraphic{test}
\stopMPpage
\stoptext
I tried to run this on context
;
p:=reverse p;
p:=p cutbefore cpath;
p:=p xyscaled (uux,uuy);
drawdblarrow p withcolor blue;
enddef;
\stopMPinclusions
\starttext
\startMPpage
%initialize function
vardef f(expr x)=
x*x
enddef;
%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-5;
xmax:=5
David Arnold wrote:
All,
Why doesn't this work?
%output=pdf
\startuseMPgraphic{usquare}
draw unitsquare scaled 4cm;
\stopuseMPgraphic
\starttext
\startMPpage
\useMPgraphic{square}
\stopMPpage
\stoptext
because you nest a graphic, kind of
beginfig(1) beginfig(2) draw unitsquare
David Arnold wrote:
Why doesn't this work?
%output=pdf
\startuseMPgraphic{usquare}
draw unitsquare scaled \MPvar{u};
\stopuseMPgraphic
\starttext
\startMPpage
\setupMPvariables[usquare][u=4cm]
\includeMPgraphic{usquare}
\stopMPpage
\stoptext
because
(1) after startMPpage metapost code
David Arnold wrote:
% \startMPpage
% \includeMPgraphic{EnglishRule}
% \stopMPpage
you can only include a simple usable graphic, defined with
\startuseMPgraphic; unique mp graphics are more tricky and involve
(once we have lua in tex we can find ways around this since then we can
(1
the
usual x and y, if needed.
Finally, thanks to Hans' expertise, the drawfcn routine allows for a
parametric definition of the intended curve.
All you need to do to make another graphic is copy and paste
everything between \startMPpage ... \stopMPpage and adjust the
parameters described
\starttext
\startMPpage
%initialize window parameters
numeric xmin, xmax, xscl, ymin, ymax, yscl;
xmin:=-5;
xmax:=5;
xscl:=1;
ymin:=-5;
ymax:=5;
yscl:=1;
%initialize scale
numeric ux, uy;
(xmax-xmin)*ux=4in; (ymax-ymin)*uy=3in;
%create the grid
create_grid(xmin,xmax,xscl,ymin,ymax,yscl,ux,uy);
%create
,yymin,yymax,uux,uuy) (text xlbl) =
drawdblarrow (1.05*xxmin*uux,0)--(1.05*xxmax*uux,0);
draw textext.origin(\MPstring{xlbl});
drawdblarrow (0,1.05*yymin*uuy)--(0,1.05*yymax*uuy);
enddef;
\stopMPinclusions
\starttext
\startMPpage
%initialize window parameters
numeric xmin, xmax, xscl, ymin
create_axes (expr xxmin,xxmax,yymin,yymax,uux,uuy) (text xlbl) =
drawdblarrow (1.05*xxmin*uux,0)--(1.05*xxmax*uux,0);
draw textext.origin(\MPbetex{xlbl});
drawdblarrow (0,1.05*yymin*uuy)--(0,1.05*yymax*uuy);
enddef;
\stopMPinclusions
\starttext
\startMPpage
%initialize window parameters
numeric
All,
Why doesn't this work?
%output=pdf
\startuseMPgraphic{usquare}
draw unitsquare scaled 4cm;
\stopuseMPgraphic
\starttext
\startMPpage
\useMPgraphic{square}
\stopMPpage
\stoptext
Why doesn't this work?
%output=pdf
\startuseMPgraphic{usquare}
draw unitsquare scaled \MPvar{u
Hi David,
without digging into depth, it works if you change MPpage into TEXpage
Willi
David Arnold wrote:
All,
Why doesn't this work?
%output=pdf
\startuseMPgraphic{usquare}
draw unitsquare scaled 4cm;
\stopuseMPgraphic
\starttext
\startMPpage
\useMPgraphic{square}
\stopMPpage
Hans, Taco, et al,
There's a quote in metafun-s.pdf (page 539) that says You can embed
the graphic in a \startMPpage construct and process it with TEXEXEC.
In that case you have the full MetaFun functionality available.
Before processing the file, TEXEXEC will do a couple of checks
\starttext
\startMPpage
%define function
vardef f(expr x)=
x*x
enddef;
\useMPgraphic{create function path f 5-by-5}
%initialize scale
numeric u; 10u=2in;
\useMPgraphic{draw axis 5-by-5}
\useMPgraphic{scale and draw f 5-by-5}
%draw plotted points
for x=-2 step 1 until
));
endfor;
p:=p--(5,f(5));
%clip function path to clipping path
p:=p cutbefore cpath;
p:=reverse p;
p:=p cutbefore cpath;
p
enddef;
\stopMPinclusions
\starttext
\startMPpage
%define function
);
label (textext(cornerstone), (10,5)) rotated 45 withcolor
\MPcolor {yellow};
\stopuseMPgraphic
\starttext
%%\startMPpage
\includeMPgraphic{standalone}
%%\stopMPpage
\stoptext
When I remove the %'s it does not work.
The first below is the wrong one, showing unknown
(cornerstone), (10,5)) rotated 45 withcolor \MPcolor
{yellow};
\stopuseMPgraphic
\starttext
%%\startMPpage
\includeMPgraphic{standalone}
%%\stopMPpage
\stoptext
When I remove the %'s it does not work.
The first below is the wrong one, showing unknown, the second one
) somespecs ;
Is it available already, or should I roll my own?
it's there; watch out, i just added a scaling option
\starttext
\setupcolors[state=start]
\startMPpage
vardef arrowheadonpath (expr p, s) =
save autoarrows ; boolean autoarrows ; autoarrows := true ;
set_ahlength(scaled
points are 1238 points.
1238/1157= 1.070008643
I have tried it with 10.7pt. Looks the same. Mixed up bp with pt?
what dd's new or old -)
\starttext
\setupcolors[state=start]
\startMPpage
nd := \the\dimexpr50nd\relax ; dd := \the\dimexpr50dd\relax ;
nc := \the\dimexpr50nc\relax ; cc
the previous solution,
in mp-tool there is a repathed macro that does most of the job so
let's extend that one a bit:
\starttext
\setupcolors[state=start]
\startMPpage
def restroke suffix p = p := repathed (21,p) enddef ; % keep
attributes
def reprocess suffix p = p := repathed (22,p) enddef
\setupcolors[state=start]
\startMPpage
vardef lastpath (expr p) =
save _p_ ; path _p_ ; _p_ := origin ;
for i within p :
if stroked i : _p_ := pathpart i ; fi ;
endfor ;
_p_
enddef ;
vardef firstpath (expr p) =
save _p_, _b_ ; path _p_ ; _p_
:
\starttext
\setupcolors[state=start]
\startMPpage
def restroke suffix p = p := repathed (21,p) enddef ; % keep attributes
def reprocess suffix p = p := repathed (22,p) enddef ; % no attributes
vardef repathed (expr mode, p) text t =
begingroup ;
if mode=0 : save withcolor ; remapcolors ; fi
as an option.
(Sorry for responding to two separate mails, I'm a bit rushed, going on
a three-day holiday.)
Hans Hagen wrote:
Mojca Miklavec wrote:
If you have something like
\startMPpage
draw ...
\stopMPpage,
it will do the syntax highligting for metapost inside the \start-\stop
file to syntax\context.vim.
If you have something like
\startMPpage
draw ...
\stopMPpage,
it will do the syntax highligting for metapost inside the \start-\stop pair.
There are still some bugs present (see comments in file), but I don't
know how yet to get rid of them.
I downloaded SpellChecker
\startMPpage
draw ...
\stopMPpage,
it will do the syntax highligting for metapost inside the \start-
\stop pair.
There are still some bugs present (see comments in file), but I
don't know how yet to get rid of them.
I downloaded SpellChecker and SuperTab (autocomplete) today from
the vim website
) and move the
attached file to syntax\context.vim.
If you have something like
\startMPpage
draw ...
\stopMPpage,
it will do the syntax highligting for metapost inside the \start-\stop
pair.
There are still some bugs present (see comments in file), but I don't
know how yet to get rid of them.
I
(Sorry for responding to two separate mails, I'm a bit rushed, going on
a three-day holiday.)
Hans Hagen wrote:
Mojca Miklavec wrote:
If you have something like
\startMPpage
draw ...
\stopMPpage,
it will do the syntax highligting for metapost inside the \start-\stop
pair.
That's
to describe my problem. I have
no ouptput of btex-etex in any case...
a more simple version:
\setupoutput[pdftex]
\starttext
\startMPpage
draw btex TEST etex;
\stopMPpage
\stoptext
anyhow, what does
texexec --automp
produce
Hans
All,
This test file:
\starttext
\setupcolors[state=start]
\startMPpage
colorcircle(10cm,red,green,blue) ;
\stopMPpage
\stoptext
If I follow this procedure:
f:/context/texutil --purgeall
f:/context/texexec --pdf test
Then I get a nice document when opened in Acrobat Reader.
However
from Scite as also from the cmd.box.
I thought that may be you should check your cont-sys.tex file, there
should exist two lines as follows:
\runMPgraphicstrue
\runMPTEXgraphicstrue
Willi
David Arnold wrote:
All,
This test file:
\starttext
\setupcolors[state=start]
\startMPpage
701 - 800 of 813 matches
Mail list logo