Changes

Jump to navigation Jump to search
Introduction from the TUGBoat article
Command to include an external figure/movie inside ConTeXt. Includes both local files or remote files hosted on HTTP servers.
 
The simplest way to insert an image is to use:
 
<context source="yes" mode="mkiv">
\externalfigure[cow.pdf]
</context>
 
This command places the PDF image <code>cow.pdf</code> in a
<code>\vbox</code>; the width and height of the image are equal to the natural dimensions of the image.
 
To set the width of the image to a specific size, say <code>1cm</code>, use:
<context source="yes" mode="mkiv" text="which gives">
\externalfigure[cow.pdf][width=1cm]
</context>
 
Similarly, to set the height of the image to a specific size, say <code>2cm</code>, use:
<context source="yes" mode="mkiv" text="which gives">
\externalfigure[cow.pdf][height=2cm]
</context>
 
If only the <code>width</code> or <code>height</code> of the image is specified, the other dimension is scaled appropriately to keep the aspect ratio.
 
To include a specific page, say page 5, of a multi-page PDF file, use:
<texcode>
\externalfigure[filename.pdf][page=5]
</texcode>
 
These four variations cover 90% of the use cases.
 
=== How the filetype is determined ===

Navigation menu