diff options
author | Hans Hagen <pragma@wxs.nl> | 2006-07-13 22:26:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2006-07-13 22:26:00 +0200 |
commit | cb58eea8a8460f4288c8ba9279bcd1a4d9333f74 (patch) | |
tree | a935db5f4be07adc3ab7ff0a6838505030a72fc4 /tex/context/base/meta-ini.tex | |
parent | f9420a5dde4d6646f2e117813bd85e0bfc701d7d (diff) | |
download | context-cb58eea8a8460f4288c8ba9279bcd1a4d9333f74.tar.gz |
stable 2006.07.13 22:26
Diffstat (limited to 'tex/context/base/meta-ini.tex')
-rw-r--r-- | tex/context/base/meta-ini.tex | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex index 38c3ec3bd..0fa99aa5c 100644 --- a/tex/context/base/meta-ini.tex +++ b/tex/context/base/meta-ini.tex @@ -1015,6 +1015,57 @@ %D \ruledhbox{\flushlayer[mp]} %D \stoptyping +%D \macros +%D {startstaticMPfigure,useMPstaticfigure} +%D +%D Static figures are processed only when there has been +%D something changed. Here is Aditya Mahajan's testcase: +%D +%D \startbuffer +%D \startstaticMPfigure{circle} +%D fill fullcircle scaled 1cm withcolor blue; +%D \stopstaticMPfigure +%D +%D \startstaticMPfigure{axis} +%D drawarrow (0,0)--(2cm,0) ; +%D drawarrow (0,0)--(0,2cm) ; +%D label.llft(textext("(0,0)") ,origin) ; +%D \stopstaticMPfigure +%D \stopbuffer +%D +%D \typebuffer \getbuffer + +\def\usestaticMPfigure[#1]% + {\dodoubleempty\externalfigure[\jobname-#1.pdf]} + +\def\startstaticMPfigure + {\begingroup + \obeyMPlines + \dostartstaticMPfigure} + +\def\dostartstaticMPfigure#1#2\stopstaticMPfigure + {\startstaticMPgraphic{\jobname-#1}#2\stopstaticMPgraphic + \doifmode{*\v!first}{\executesystemcommand + {texmfstart --ifchanged=\MPgraphicfile.mp texexec --mpgraphic \MPgraphicfile.mp}}% + \endgroup} + +% faster, but more tricky +% +% \def\startstaticMPfigure +% {\doifmodeelse{*\v!first} +% {\begingroup +% \obeyMPlines +% \dostartstaticMPfigure} +% {\gobbleuntil\stopstaticMPfigure}} +% +% \def\dostartstaticMPfigure#1#2\stopstaticMPfigure +% {\startMPstaticgraphic{\jobname-#1}#2\stopMPstaticgraphic +% \executesystemcommand +% {texmfstart --ifchanged=\MPgraphicfile.mp texexec --mpgraphic \MPgraphicfile.mp}% +% % dirty trick, don't register, so no second main run of texexec: +% \global\advance\nofMPgraphics \minusone +% \endgroup}} + %D New: % \appendtoks \closeMPgraphicfiles \to \everystoptext |