2,631 bytes added
, 11:46, 14 June 2012
The <code><nowiki><context> ... </context></nowiki></code> tags process their ConTeXt contents on the fly and include the result on the page as an image. Whitespace is cropped out. The following options are available:
* <code>source=yes</code> displays the source before the output.
* <code>text="some text"</code> places 'some text' between the source and the output.
* <code>mode=mkiv</code> ensures [[Mark IV]] is used instead of the default Mark II.
== Examples ==
=== Plain example ===
{| class=wikitable
! scope=col width=300 style="text-align: left"| Wiki markup
! scope=col width=300 style="text-align: left"| Wiki display
|- style="vertical-align: top"
| <xmlcode>
<context>
\setupcolors [state=start]
\framed [background=color,
backgroundcolor=green,
offset=0.5cm ]{hello world!}
</context>
</xmlcode>
| <context>
\setupcolors [state=start]
\framed [background=color,
backgroundcolor=green,
offset=0.5cm ]{hello world!}
</context>
|}
=== source=yes ===
{| class=wikitable
! scope=col width=300 style="text-align: left" | Wiki markup
! scope=col width=300 style="text-align: left"| Wiki display
|- style="vertical-align: top"
| <xmlcode>
<context source="yes" text="produces">
\setupcolors [state=start]
\framed [background=color,
backgroundcolor=green,
offset=0,5cm ]{hello world!}
</context>
</xmlcode>
| <context source="yes" text="produces">
\setupcolors [state=start]
\framed [background=color,
backgroundcolor=green,
offset=0.5cm ]{hello world!}
</context>
|}
=== mode=mkii and mode=mkiv ===
{| class=wikitable
! scope=col width=300 style="text-align: left" | Wiki markup
! scope=col width=300 style="text-align: left" | Wiki display
|- style="vertical-align: top"
| <xmlcode>
<context source="yes">
Version: \contextversionnumber
</context>
</xmlcode>
| <context source="yes">
Version: \contextversionnumber
</context>
|- style="vertical-align: top"
| <xmlcode>
<context mode=mkiv source="yes">
% mode=mkiv
Version: \contextversionnumber
</context>
</xmlcode>
|<context mode=mkiv source="yes">
% mode=mkiv
Version:
\contextversionnumber
</context>
|}
=== Displaying multiple pages ===
<context source="yes">
\setuppapersize[A10, landscape][A8, landscape]
\setuppaper[nx=2, ny=2] % arrange pages 2 by 2 (must come before \setuparranging[XY])
\setuparranging[XY] % arrange pages n by n (across, then down)
\setuppagenumbering[footer] % page numbers are always useful
\showframe[edge] % Draw line around each page. Prevents overzealous cropping
one \page[yes]
two \page[yes]
three \page[yes]
four
</context>