# ConTeXt: page large enough to contain a FLOWchart

How can I create a page which has the minimum size to contain the one FLOWchart defined in it?

I'm looking for something identical to \startMPpage but for FLOWchart

\startMPpage produces a page a containing MetaPost graphic. The page is just large enough to contain the graphic.

A minimum document using \startMPage:

\starttext
\startMPpage
fill fullcircle scaled 5cm withcolor red ;
\stopMPpage
\stoptext


this produces a cropped page containing only the circle.

The following document will produce a full A4 page with a flow-chart in it:

\usemodule[chart]
\starttext
\startFLOWchart [cells]
\startFLOWcell
\name {first}
\location {1,1}
\shape {singledocument}
\text {not realy a document}
\stopFLOWcell
\stopFLOWchart

\placefigure
[here][]
{}{\FLOWchart[cells]}
\stoptext

-
– Claudio Fiandrino Feb 22 '13 at 10:01

For MetaPost content you can use the environment MPpage, as you mentioned. For TeX content use the environment TEXpage. FLOWchars use MetaPost internally, however, the code is TeX, so you need to use TEXpage.

Furthermore, you don't need a figure. A figure is floating, which means TeX determines the position automatically, which is not what you want here. It makes only sense for multi-page documents containing text paragraphs as well. Here's a complete example.

\usemodule[chart]

\startFLOWchart [cells]
\startFLOWcell
\name {first}
\location {1,1}
\shape {singledocument}
\text {not realy a document}
\stopFLOWcell
\stopFLOWchart

\starttext
\startTEXpage
\FLOWchart[cells]
\stopTEXpage
\stoptext


FLOWcharts contain a margin by default. If you want to adjust for this margin you can use the offset key, either with positive or negative values:

\startTEXpage [offset=2cm]
\FLOWchart[cells]
\stopTEXpage

\startTEXpage [offset=-1cm]
\FLOWchart[cells]
\stopTEXpage

-
This is perfect! Exactly what I was looking for: thank you very much. – sdumi Feb 22 '13 at 10:57