Changes

Jump to navigation Jump to search
576 bytes added ,  13:52, 28 May 2020
update page with new info
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 attributes may be set:
* <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"mkii"</code> ensures forces [[Mark IVII]] is used instead of the default Mark IV. But please don't use [[Mark II]] unless absolutely necessary.* <code>force="yes"</code> forces regeneration of the PNG image each time the page is loaded. This is expensive, so please only use it on special occasions (like in the example below where we are showing the {{cmd|contextversionnumber}}.
Quotation marks around attribute strings are only required if the attribute contains non-alphabetic characters.
For some reason, examples using the default A4 paper size usually end up blown up twice as largeThe extension wraps your code with a bit of extra ConTeXt code to get a compilable file.There are two differentIf this happenscases, include depending on whether your code contains {{cmd|setuppapersizestarttext}} ... {{cmd|[A5]stoptext}} in your example, and everything will display at its proper size again. This has the added advantage that the resulting image will never be too large for this wiki's main columnor not.
With a starttext/stoptext block, the wrapping uses:
 
<texcode>
\setuppapersize[A5][A5]
\setupbodyfont[8pt]
\setupcolors[state=start]
.. your input here ..
</texcode>
 
and without starttext/stoptext, the extension uses:
 
<texcode>
\setuppapersize[A5][A5]
\setupbodyfont[8pt]
\setupcolors[state=start]
\starttext
\startTEXpage
.. your input here ..
\stopTEXpage
\stoptext
</texcode>
== Examples ==
|}
=== mode=mkii mkiv and mode=mkiv mkii ===By default, the wiki compiles examples using MkIIMkIV. You can specify that you want to use MkIV by adding the option <tt>mode=mkivmkii</tt> to the tag. Because MkII examples are visually indistinguishable from MkIV examples, it is good practice to start MkIV MkII examples with a comment <code>% mode=mkivmkii</code>.
{| class=wikitable
|- style="vertical-align: top"
| <xmlcode>
<context source=yes force=yes>% mode=mkii
Version: \contextversionnumber
</context>
</xmlcode>
| <context source=yes force=yes>Version: \contextversionnumber
</context>
|- style="vertical-align: top"
| <xmlcode>
<context mode=mkiv mkii source=yes force=yes>% mode=mkiv
Version: \contextversionnumber
</context>
</xmlcode>
|<context mode=mkiv mkii source=yes force=yes>% mode=mkivmkii
Version is: \contextversionnumber
</context>

Navigation menu