Changes

Jump to navigation Jump to search
m
Changing mode=mkiv
* '''cld''': Typeset the [[CLD|ConTeXt Lua document]] using <code>context</code> and include the result as a PDF file.
 
== Tracing and error Messages ==
 
When a file is specified by its full name, and is not found, no error message is displayed in the log; rather a gray box is shown in the generated PDF which indicates that the figure was not found. For example (note that <code>cat.pdf</code> should '''not''' exist in the current directory)
 
<context source=yes>
\externalfigure[cat.pdf]
</context>
== Example ==
In the example below, no file name extension is used. ConTeXt searches for an image file in the following order: <code>cow.pdf</code>, <code>cow.mps</code>, <code>cow.1</code>, <code>cow.2</code>, etc., <code>cow.jpg</code>, <code>cow.png</code>, <code>cow.jp2</code>, <code>cow.jbig</code>, <code>cow.jbig2</code>, <code>cow.jb2</code>. The file <code>cow.pdf</code>, which is distributed as part of the ConTeXt distribution, is found and displayed.
<context source="yes"mode=mkiv>% look for figure files in texmf tree\setupexternalfigures[location=default] 
\externalfigure[cow][width=4cm]
</context>
ConTeXt distribution also includes a sample image <code>hacker.jpg</code>. To include it use:
<context source="yes"mode=mkiv>% look for figure files in texmf tree\setupexternalfigures[location=default] 
\externalfigure[hacker][height=3cm]
</context>
=== Include a remote image ===
<context source="yes" mode="mkiv">
\externalfigure[http://placekitten.com/g/200/300][method=jpg]
</context>
 
The above example does not work on the wiki due to security restrictions. It runs on the default ConTeXt installation.
== See also ==

Navigation menu