Changes

Jump to navigation Jump to search
m
no edit summary
< [[Graphics]]|[[Metafun]]|[[Metapost]]>__TOC__
ConTeXT provides a tight integration of TeX and [[MetaPost]]. MetaPost can used behind the scenes for some graphic trickery. This integration is also helpful for drawing figures in MetaPost and use them in the document. This page is a brief overview of some of the commonly used commands.
== \defineMPinstance MetaFun is ConTeXt extension the [[MetaPost]] language. It provides a tight integration of both TeX and \setupMPinstance ==[[MetaPost]]. MetaPost can used behind the scenes for some graphic trickery. This integration is also helpful for drawing figures in MetaPost and use them in the document.
{{cmd'''THE [[manual:metafun-p.pdf|defineMPinstance}} and {{cmdMetaFun manual]]''', also available in a [[manual:metafun-s.pdf|setupMPinstance}} can be used to set up MetaPost invocations with particular features. One use case could be to select a sans serif font for all MetaPostlabelsscreen version]].
=== \startMPenvironment ===
{{cmd|startMPenvironment}} This page is a '''deprecated''' evironment in which one could place settings that one only wanted to apply in brief overview of some of the MetaPost environment, but not in the document itself. One should use {{cmd|defineMPinstance}} and {{cmd|setupMPinstance}}, insteadcommonly used commands.
== \startMPinclusions ==
Inside {{cmd|startMPinclusions}} one can specify MetaPost files to ''input'', and also define MetaPost functions.= Commonly used commands =
== \startuseMPgraphic ; {{cmd|defineMPinstance}}, {{cmd|setupMPinstance}}: used to set up MetaPost invocations with particular features. One use case could be to select a sans serif font for all MetaPost labels. : {{cmd|startMPenvironment}} '''is DEPRECATED''' in which one could place settings that one only wanted to apply in the MetaPost environment, but not in the document itself. One should use {{cmd|defineMPinstance}} and \useMPgraphic =={{cmd|setupMPinstance}}, instead.
; {{cmd|startuseMPgraphic}}defines a piece of graphics code that is processed anew every time the graphic is placed with {{cmd|useMPgraphicstartMPinclusions}}: Inside, one can specify MetaPost files to ''input'', and also define MetaPost functions.
== \startreusableMPgraphic and \reuseMPgraphic ==For graphics that are the same every time; {{cmd|startuseMPgraphic}}, it is better to use {{cmd|startreusableMPgraphicuseMPgraphic}}: defines a piece of graphics code that is processed anew every time the graphic is compiled only once, and the one resulting picture can be placed at various points with {{cmd|reuseMPgraphicuseMPgraphic}}.
== \startMPcode ==; {{cmd|startreusableMPgraphic}}, {{cmd|reuseMPgraphic}}: For graphics that are the same every time, it is better to use {{cmd|startreusableMPgraphic}}: the graphic is compiled only once, and the one resulting picture can be placed at various points with {{cmd|reuseMPgraphic}}.
; {{cmd|startMPcode}}: When reusing a graphic is not important, you can simply use {{cmd|startMPcode}}.
== \; {{cmd|startMPpage ==}}: produces a page a containing MetaPost graphic. The page is just large enough to contain the graphic. The resulting pdf is self-contained (it has all the fonts embedded). This is useful if you want to send the figure to a coauthor or a journal.
; {{cmd|startMPpagestartstaticMPfigure}} produces , {{cmd|usestaticMPfigure}}: The {{cmd|startuseMPgraphic}} series of commands were designed for using MetaPost for drawing fancy frames and backgrounds and not for using <i>stand-alone</i> graphics for a page document. {{cmd|startstaticMPfigure}} creates a separate pdf file containing MetaPost the graphic. The page This pdf can be included in the document using {{cmd|usestaticMPfigure}}. ConTeXt is just large clever enough to contain recompile the graphic. The resulting pdf is self-contained (it has all the fonts embedded) This is useful MetaPost file only if you want to send something inside the figure to a coauthor or a journal{{cmd|startstaticMPfigure}} has changed.
== \startstaticMPfigure =Documentation and links =
The {{cmd* [[manual:mmakempy.pdf|MakeMPY]]: create MetaPost outlines (by Pragma)* [[Flow Charts|startuseMPgraphic}} series FlowCharts]]: encapsulated application, demonstration of commands were designed for using MetaPost for drawing fancy frames and backgrounds and not for using <i>stand/MetaFun* [http://www.pragma-alone<ade.com/general/sources/i> mptopdf.pdf MPtoPDF]: create PDF from MetaPost (by Pragma)* [http://www.pragma-ade.com/show-gra.pdf a few examples of MetaPost graphics for a document]* [http://www.pragma-ade. {{cmd|startstaticMPfigure}} creates a separate pdf file containing the graphiccom/articles/art-puzz. This pdf can be included Puzzling graphics in the document using {{cmd|usestaticMPfigure}}MetaPost] (article)* [http://www.ntg.nl/maps/25/15. ConTeXt is clever enough to recompile the resulting MetaPost file only if something inside the {{cmd|startstaticMPfigure}} has changedpdf metapost metafun.Hans Hagen at MAPS]
 
----
[[Category:Graphics]]
[[Category:Metapost]]
== See also ==
{{MetaPost see also}}
* section 3.3 of the [[manual:metafun-s.pdf|MetaFun manual]].{{Metapost navbox}}

Navigation menu