]
% \showframe
\definefloat
[marginfigure]
[figure]
\setupfloat
[marginfigure]
[outermargindistance=-\outermargintotal,
default={outermargin,height,high,low,none}]
\starttext
\startstaticMPfigure{square}
draw fullsquare scaled 3cm;
\stopstaticMPfigure
\startitemize
\placemarginfigure
]
[outermargindistance=-\outermargintotal,
default={outermargin,height,high,low,none}]
\starttext
\startstaticMPfigure{square}
draw fullsquare scaled 3cm;
\stopstaticMPfigure
\startitemize
\placemarginfigure{}{\usestaticMPfigure[square]}
\item bla
\item bla
\placemarginfigure
Hello Jairo and Everybody.
> It seems \startstarticMPfigure ... \stopstaticMPfigure is now a wrapper for
> reusable MP graphics, so auxiliary files are no longer generated.
Are reusable MP graphics compiled only once per run, or only when the code is
changed – which might not happen for many r
olleagues,
>
> I’m writing a physics textbook with lots of figures, some quite complex.
> I’ve been using TikZ, but I’m experimenting with MetaPost. Consulting the
> ConTeXt wiki, I found that \startstaticMPfigure and friends are designed
> exactly for this sort of use. However, I
Hello colleagues,
I’m writing a physics textbook with lots of figures, some quite complex. I’ve
been using TikZ, but I’m experimenting with MetaPost. Consulting the ConTeXt
wiki, I found that \startstaticMPfigure and friends are designed exactly for
this sort of use. However, I’m not seeing
t;>
>> FIRST EXAMPLE (No labels are displayed)
>> -
>> \starttext
>>
>> \startMPinclusions
>>input makecirc;
>> \stopMPinclusions
>>
>>
>> \startstaticMPfigure{circ1}
>> u:= 1cm ;
>&
ttext
\startMPinclusions
input makecirc;
\stopMPinclusions
\startstaticMPfigure{circ1}
u:= 1cm ;
source.e((0,0u),DC,90,"\Delta V","2V") ;
resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
resistor.b((2u,-1u),normal,90,&
ecirc;
\stopMPinclusions
\startstaticMPfigure{circ1}
u:= 1cm ;
source.e((0,0u),DC,90,"\Delta V","2V") ;
resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
resistor.b((2u,-1u),normal,90,"R_2","2$\Omega$") ;
wire(
Am 19.09.2011 11:17, schrieb Meer, H. van der:
>>From the Wiki I learn about \startstaticMPfigure that it "creates a separate
>>pdf file containing the graphic". But when I exercise the example given I do
>>not see those staticMPfigure's in sepaarte pdf's.
>From the Wiki I learn about \startstaticMPfigure that it "creates a separate
>pdf file containing the graphic". But when I exercise the example given I do
>not see those staticMPfigure's in sepaarte pdf's. What am I missing? I thought
>to use this for generatin
gt; > better illustrations, hopefully.
> >
> > My workflow has been like this:
> >
> > 1. Create the desired figure in DIA and choose the export option. TeX
> > metapost *.mp(see attached file ).
> >
> > 2. Tryed to do inclusion in a TeX-document like th
ption. TeX
> metapost *.mp(see attached file ).
>
1.1 remove all latex related code from the mp file
verbatimtex
%&latex
\documentclass{minimal}
\begin{document}
etex
> 2. Tryed to do inclusion in a TeX-document like this
>
> \startstaticMPfigure{magflux}
> the code in the a
ces inside the figure. By this method I can even do
better illustrations, hopefully.
My workflow has been like this:
1. Create the desired figure in DIA and choose the export option. TeX
metapost *.mp(see attached file ).
2. Tryed to do inclusion in a TeX-document like this
\startstaticMPfigure
e. By this method I can even do
better illustrations, hopefully.
My workflow has been like this:
1. Create the desired figure in DIA and choose the export option. TeX
metapost *.mp(see attached file ).
2. Tryed to do inclusion in a TeX-document like this
\startstaticMPfigure{magflux}
the c
nks for the hint. I tried both this version as well as the
>>> pdftex-stable-w32.bz2 and both don't work.
>>>
>>> A backup (20080421) however does work.
>>> >
>>> The first view lines from the log file:
>>> This is pdfTeX, Version
ork.
> >
> > A backup (20080421) however does work.
> > >
> > The first view lines from the log file:
> > This is pdfTeX, Version 3.1415926-1.50.0-alpha-20080414 (Web2C 7.5.6)
> > (format=cont-en 2008.4.21) 11 JUN 2008 08:24
> > entering extended
; \write18 enabled.
> (c:/context/debug2/context/tex/texmf-context/web2c/natural.tcx)
> **test.tex \emergencyend
> (./test.tex
>
> ConTeXt ver: 2008.04.19 22:41 MKII fmt: 2008.4.21 int: english/english
> <===
>
> Since the pdfTeX version is the same as the current one,
80421) however does work.
> >
> The first view lines from the log file:
> This is pdfTeX, Version 3.1415926-1.50.0-alpha-20080414 (Web2C 7.5.6)
> (format=cont-en 2008.4.21) 11 JUN 2008 08:24
> entering extended mode
> \write18 enabled.
> (c:/context/debug2/context/tex/texmf-
lpha-20080414 (Web2C 7.5.6)
(format=cont-en 2008.4.21) 11 JUN 2008 08:24
entering extended mode
\write18 enabled.
(c:/context/debug2/context/tex/texmf-context/web2c/natural.tcx)
**test.tex \emergencyend
(./test.tex
ConTeXt ver: 2008.04.19 22:41 MKII fmt: 2008.4.21 int: english/english
&l
error: pdftex.exe (file ./test-center.pdf): xpdf: reading PDF image
> fai
> led (0)
> ==> Fatal error occurred, no output PDF file produced!
afaik this is a pdftex bug, which is fixed in version 1.40.8 beta.
1.40.8 beta (window binaries):
ftp://udon.nict.go.jp
;
On Tuesday 10 June 2008 14:50, Hans Hagen wrote:
> [EMAIL PROTECTED] wrote:
> > Hi,
> >
> > When I run the example below (current beta, pdftex,
> > live.contextgarden.net) the generated pdf does not contain any pictures.
> > Any suggestion how to solve this? Or
n on the garden)
in mkiv there was indeed a buglet (i never tested it)
> Thanks,
>
> B. Vogel
>
> %test.tex
> \startstaticMPfigure{center}
> draw fullcircle scaled 2cm ;
> dotlabel.bot(textext("(0,0)"),origin) ;
> \stopstaticMPfigure
>
> \startstaticMPf
Hi,
When I run the example below (current beta, pdftex, live.contextgarden.net)
the generated pdf does not contain any pictures.
Any suggestion how to solve this? Or is the command obsolete?
Thanks,
B. Vogel
%test.tex
\startstaticMPfigure{center}
draw fullcircle scaled 2cm ;
dotlabel.bot
("%
\framed[width=1.5cm]{" & s & "}"),p)
enddef ;
\stopMPinclusions
\startstaticMPfigure{tst}
LABEL.llft("Test", (1,1) ) ;
\stopstaticMPfigure
\starttext
\midaligned{\usestaticMPfigure[tst]}
\stoptext
%-
> you can test the beta
I used the same test file:
\starttext
\startstaticMPfigure{fig:ellipse}
path p;
p := fullcircle scaled 2in yscaled 0.5;
label(btex hello etex, origin);
draw p;
\stopstaticMPfigure
\placefigure[right,none]{}{\usestaticMPfigure[fig:ellipse]}
\input tu
e pdf just with more runs?
>
> This is with context 2006.12.27 (from the Debian context package),
> pdftex 1.40.0, metapost 0.993, plus mostly texlive 2005.
>
> === begin: jjj.tex ==
> \starttext
>
> \startstaticMPfigure{fig:ellipse}
> pa
ht that one can leave all three settings false, and texexec
will still produce the same pdf just with more runs?
This is with context 2006.12.27 (from the Debian context package),
pdftex 1.40.0, metapost 0.993, plus mostly texlive 2005.
=== begin: jjj.tex ======
\startt
> \starttext
>
> \startstaticMPfigure{fig}
> draw fullcircle scaled 1in;
> \stopstaticMPfigure
>
> \usestaticMPfigure[fig]
> \stoptext
>
> [ConTeXt ver: 2006.10.04 09:35 MK II]
Works fine here on the same version.
Aditya
___
ntg-co
This file now produces a blank page except for the page number, perhaps
due to me messing up one of the upgrades (was trying an automatic
install to a TEXMFLOCAL directory but eventually gave up and went back
to ~/texmf/):
\starttext
\startstaticMPfigure{fig}
draw fullcircle scaled 1in
gn{##\hfil\cr#1\cr#2\cr}}}
\starttext
\startstaticMPfigure{fig}
label(\sometxt{\2{h}{x}}, origin);
\stopstaticMPfigure
\usestaticMPfigure[fig]
\stoptext
= y.tex
It produces this texexec.tex (2006.09.28 22:43 beta):
for the next chapter's figures, I'll write a python script that
will do the other transformations: e.g. turn each beginfig into
\startstaticMPfigure -- or is it \startstaticMPgraphic? I always have
to check, hence I'll put it in a script and have *it* remember.
I know that metafun was
or staticMPfigure] is pass info from the mpenvironment"
>
> It works well, thanks for another instant improvement. The 2006.09.28
> beta passes the following test case (I will commit it to the contexttest
> repository). It gives a 12pt "outside sometxt" and a 20pt &qu
tory). It gives a 12pt "outside sometxt" and a 20pt "in sometxt":
= with-static.tex ====
\startMPenvironment
\setupbodyfont[20pt]
\stopMPenvironment
\starttext
\startstaticMPfigure{fig}
label(\sometxt{in sometxt},origin);
tex test on a static MP figure works fine:
btex-static.tex ====
\starttext
\startstaticMPfigure{fig}
label(btex in b/e tex etex, origin);
\stopstaticMPfigure
outside btex..etex\quad
\usestaticMPfigure[fig]
\stoptext
=
t; \setupbodyfont[20pt]
> \starttext
>
> \startstaticMPfigure{fig}
> label(\sometxt{in sometxt},origin);
> \stopstaticMPfigure
>
> outside sometxt
> \usestaticMPfigure[fig]
> \stoptext
>
> produces a small "in sometxt" and a large "outside sometxt".
>
> With
[I'm testing the 2006.09.27 beta on Linux]
Thanks for the new \sometxt in staticMPfigures. I'm just testing its
operation, and find that the text is not set in the document's bodyfont
size. For example,
\setupbodyfont[20pt]
\starttext
\startstaticMPfigure{fig}
label(\som
Hans Hagen wrote:
the problem (if you look into the mp file) is that there is *no*
beginfig; this is because we now use a more stupid (stripped down)
variant of saving the graphic.
Right, I looked into the mp file and saw the new plan.
\startstaticMPfigure{fig}
beginfig(1
Sanjoy Mahajan wrote:
>> you can test the beta
>>
>
> This gives the clearboxes error:
>
> === box.tex ===
> \startMPinclusions
> input boxes
> \stopMPinclusions
>
> \starttext
> \startstaticMPfigure{fig}
> > \starttext
> >
> > \startMPinclusions
> > input boxes
> > \stopMPinclusions
> >
> > \startstaticMPfigure{fig}
> > boxit.h(btex h etex);
> > drawboxed(h);
> > \stopstaticMPfigure
> >
> > \usestaticMPfigure[fig]
>
> you can test the beta
This gives the clearboxes error:
=== box.tex ===
\startMPinclusions
input boxes
\stopMPinclusions
\starttext
\startstaticMPfigure{fig}
boxit.h(btex h etex);
drawboxed(h);
\stopstaticMPfigure
\usestaticMPfigure[fig]
\stopt
Sanjoy Mahajan wrote:
> With the new beta, this stress test for \sometxt works fine:
>
>
> \setupcolors[state=start]
> \starttext
> \startstaticMPfigure{fig}
> label(\sometxt{he\color[blue]{ab}lo}, origin) withcolor red
With the new beta, this stress test for \sometxt works fine:
\setupcolors[state=start]
\starttext
\startstaticMPfigure{fig}
label(\sometxt{he\color[blue]{ab}lo}, origin) withcolor red;
draw fullcircle scaled 1cm xscaled 2
staticMPfigure but got derailed at this staticMPgraphic:
= 4.tex =====
\starttext
\startstaticMPfigure{fig}
draw fullcircle scaled 1cm xscaled 2;
\stopstaticMPfigure
\usestaticMPfigure[fig]
xyz
\stoptext
;
> But "texexec --mpgraphic 1.mp" produces the right figure. So why does
> \startMPcode run the wrong command? The following works fine:
>
> cut here ====
> \starttext
> \startMPinclusions
> def yy =
> draw \textext{via yy def};
> enddef;
> \st
Sanjoy Mahajan wrote:
> Another small metafun test file. It displays no text in the middle of
> the ellipse. Using \textext instead of \sometxt works.
>
> \starttext
> \startstaticMPfigure{fig}
> draw \sometxt{hello};
> draw fullcircle scaled 1cm xscaled 2;
Another small metafun test file. It displays no text in the middle of
the ellipse. Using \textext instead of \sometxt works.
\starttext
\startstaticMPfigure{fig}
draw \sometxt{hello};
draw fullcircle scaled 1cm xscaled 2;
\stopstaticMPfigure
\usestaticMPfigure[fig]
xyz
\stoptext
inclusions
def yy =
draw \textext{via yy def};
enddef;
\stopMPinclusions
\startstaticMPfigure{a}
yy;
\stopstaticMPfigure
\usestaticMPfigure[a]
\stoptext
==== cut here
The log shows startstaticMPfigure running texexec:
system(texmfstart --ifchanged=1a-a.mp tex
;
\stopMPinclusions
\startstaticMPfigure{fig}
drawtext;
label(btex Inline in the figure. etex, (2in,0));
\stopstaticMPfigure
hello, in 12pt, for comparison.
\placefigure[force,none]{}{\usestaticMPfigure[fig]}
\stoptext
=== cut here
However
The following minimal file overruns the available output streams
(version 2006.08.08 and context live):
\starttext
\dorecurse{16}{\startstaticMPfigure{\recurselevel}
fill fullcircle scaled 1cm withcolor red;
\stopstaticMPfigure}
\stoptext
At the end are the last few lines of the log. Here are
unMPgraphicstrue
> \starttext
>
> % see how smart staticMPfigure is by changing r here but not
> % in the figure definition itself. Will it re-metapost the graphic?
> % Answer: It's smart.
> \startMPinclusions
> r := 1cm;
> \stopMPinclusions
>
> \startstaticMPfigure{a}
>
mart staticMPfigure is by changing r here but not
% in the figure definition itself. Will it re-metapost the graphic?
% Answer: It's smart.
\startMPinclusions
r := 1cm;
\stopMPinclusions
\startstaticMPfigure{a}
fill fullcircle scaled r;
\stopstaticMPfigure
\placefigure[force,none]{}{\usestaticM
t it wasn't any serious problem.)
While debugging, it helps to know what is happening in the background.
Everything between
\startstaticMPfigure{name}...\stopstaticMPfigure
is written to \jobname-name.mp. A pdf file is generated using
texexec --mpgraphic which creates a temp file i
s, p)= [EMAIL PROTECTED](textext("%
\framed[width=1.5cm,align=right,frame=off,autowidth=force,strut=on]{"
& s
& "}"),p)
enddef ;
vardef [EMAIL PROTECTED](expr s, p)= [EMAIL PROTECTED](textext("%
\framed[align=middle,frame=off,autowidth=force,strut=on]{" & s &
ame=off,autowidth=force,strut=on]{" & s & "}"),p)
enddef ;
picture p ; p := dashpattern(on 1mm off 1mm) ;
color mycolor; mycolor = .625red;
\stopMPinclusions
\startstaticMPfigure{2squares}
u := 0.7cm; a := 5;
pair diag[]; diag1 = (2,1.25); diag2=(10,-2.5);
for i=0 upto
ROTECTED](expr s, p)= [EMAIL PROTECTED](textext("%
\framed[width=1.5cm,align=right,frame=off,autowidth=force,strut=on]{" & s
& "}"),p)
enddef ;
vardef [EMAIL PROTECTED](expr s, p)= [EMAIL PROTECTED](textext("%
\framed[align=middle,frame=off,autowidth=force,strut=
On Tue, 13 Jun 2006, Hans Hagen wrote:
> Aditya Mahajan wrote:
>> I have right now kept the command as MPfigure.
>>
> grep MPfigure in meta-fig -)
>
Now I am using staticMPfigure. This is the final version
\def\startstaticMPfigure#1#2\stopstaticMPfigure
{\bgroup
56 matches
Mail list logo