Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
share|improve this question
    
Welcome to TeX.SX. –  Claudio Fiandrino Feb 22 '13 at 10:01
add comment

1 Answer

up vote 4 down vote accepted

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
share|improve this answer
    
This is perfect! Exactly what I was looking for: thank you very much. –  sdumi Feb 22 '13 at 10:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.