Changes

Jump to navigation Jump to search
More elaborate examples
== Example ==
<context>
\setuppapersize[A7]
=== Including a local image ===
 
In the example below, no file name extension is used. ConTeXt searches for an image file in the following order: `cow.pdf`, `cow.mps`, `cow.1`, `cow.2`, etc., `cow.jpg`, `cow.png`, `cow.jp2`, `cow.jbig`, `cow.jbig2`, `cow.jb2`. The file `cow.pdf`, which is distributed as part of the ConTeXt distribution, is found and displayed.
 
<context source="yes">
% look for figure files in texmf tree
\setupexternalfigures[location=default]
\placefigure[here][fig:cow] {I never saw a purple cow. / I never hope to see one. / but I can tell you anyhow / I'd rather see than be one. ---Gelett Burgess} {\externalfigure[cow][width=\textwidth, height=1cm4cm]}
</context>
 
ConTeXt distribution also includes a sample image `hacker.jpg`. To include it use:
 
<context source="yes">
% look for figure files in texmf tree
\setupexternalfigures[location=default]
 
\externalfigure[hacker][height=3cm]
</context>
 
=== Include a remote image ===
 
<context source="yes">
\externalfigure[http://placekitten.com.s3.amazonaws.com/homepage-samples/200/286.jpg]
</context>
 
The above example does not work on the wiki due to security restrictions. It should run on the default ConTeXt installation.
 
== See also ==

Navigation menu