Changes

Jump to navigation Jump to search
m
no edit summary
= Commonly used commands =
== \; {{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 \{{cmd|setupMPinstance ==}}, instead.
; {{cmd|defineMPinstance}} and {{cmd|setupMPinstancestartMPinclusions}} : Inside, one can be used to set up specify MetaPost invocations with particular features. One use case could be files to select a sans serif font for all ''input'', and also define MetaPostlabelsfunctions.
'''; {{cmd|startMPenvironmentstartuseMPgraphic}} is a DEPRECATED''' environment 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|defineMPinstanceuseMPgraphic}} and : defines a piece of graphics code that is processed anew every time the graphic is placed with {{cmd|setupMPinstanceuseMPgraphic}}, instead.
== ; {{cmd|\startMPinclusions ==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}}.
Inside ; {{cmd|startMPinclusionsstartMPcode}} one : When reusing a graphic is not important, you can specify MetaPost files to ''input'', and also define MetaPost functionssimply use {{cmd|startMPcode}}.
== \startuseMPgraphic and \useMPgraphic ==; {{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|startuseMPgraphic}} defines a piece of graphics code that is processed anew every time the graphic is placed with {{cmd|useMPgraphic}}. == ; \startreusableMPgraphic and \reuseMPgraphic ==For graphics that are the same every time, it is better to use {{cmd|startreusableMPgraphic}}startstaticMPfigure: the graphic is compiled only once, and the one resulting picture can be placed at various points with {{cmd|reuseMPgraphic}}. == \startMPcode == When reusing a graphic is not important, you can simply use {{cmd|startMPcode}}. == \startMPpage == {{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.  == \startstaticMPfigure == 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 document. {{cmd|startstaticMPfigure}} creates a separate pdf file containing the graphic. This pdf can be included in the document using {{cmd|usestaticMPfigure}}. ConTeXt is clever enough to recompile the resulting MetaPost file only if something inside the {{cmd|startstaticMPfigure}} has changed.
[[Category:Graphics]]

Navigation menu