Changes

Jump to navigation Jump to search
1,026 bytes added ,  23:02, 1 December 2012
m
Reordering and clarifying material
== Description ==
Command to include an external figure/movie inside ConTeXt. Includes both localfiles or remote files hosted on HTTP servers.  === How the filetype is determined === * '''File extension''': Normally, the type of file is determined by the extension of the file (in a case-insensitive manner).* '''<code>method=type</code>''' If the file uses a non-standard extension, specify the file type using <code>method=type</code> where type is any of the file extensions that is recognized by {{cmd|externalfigure}}.* '''auto''': When the file extension is <code>.auto</code> or <code>method=auto</code> is used, ConTeXt reads the first few bytes of the file to determine the filetype. Such an auto-discovery is useful for remote images that do not have a file extension. If the extension of the file is not specified, ConTeXt searches for all possible extensions in the order given below. (When postscript output was used, the order in which the file extensions were searched depended on the output format (PDF or PS). These days, PDF is the default output format, so for all practical purposes, the order in which the file extensions are searched is fixed). === Natively supported image formats ===
The following image formats are supported natively in MkIV:
* '''[http://en.wikipedia.org/wiki/JPEG_2000 JPEG 2000]''': File extesion <code>.jp2</code>
* '''[http://en.wikipedia.org/wiki/JBIG JBIG]''' and '''[http://en.wikipedia.org/wiki/JBIG2 JBIG2]''': File extension <code>.jbig</code>, <code>.jbib2</code>, and <code>.jb2</code>
 
=== Image formats supported through external converters ===
The following formats are converted to PDF by external programs before being included. The conversion generates a new file with a prefix <code>m_k_i_v_</code> and a suffix <code>.pdf</code> added to the name of the original file (the original extension is nor removed). The result is cached, and the conversion is rerun only if the timestamp of the original file is newer than the converted file.
gm convert [inputfile] [outputfile]
 
=== Supported movie formats ===
 
{{note| Inclusion of movie formats is broken in MkIV }}
The following movie formats are supported.
* '''[http://en.wikipedia.org/wiki/QuickTime QuickTime]''': File extension <code>.mov</code>.
: (Note: Check if this works?)=== Support for special TeX formats ===
Normally, the type of file is determined by the extension of the file. If the file uses a non-standard extension, then use <code>method=....</code> to specify the file type. If <code>method=<b>auto</b></code> is used, ConTeXt reads the first few bytes of the file to determine the filetype. Such an auto-discovery is useful for remote images that do not have a file extension. In addition, the The following special formats are supported:
* '''buffer''': Typeset the buffer with the given name and include the result as a PDF file.
* '''cld''': Typeset the [[CLD|ConTeXt Lua document]] using <code>context</code> and include the result as a PDF file.
 
 
'''Note''': The file extesions are case insensitive.
 
== Example ==
=== Including a local image ===
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">
</context>
ConTeXt distribution also includes a sample image `<code>hacker.jpg`</code>. To include it use:
<context source="yes">
</context>
The above example does not work on the wiki due to security restrictions. It should run runs on the default ConTeXt installation.
== See also ==
[[Category:Command/FiguresImages|externalfigure]]
/code>. Converted to PDF on the fly using MPtoPDF.
* '''[http://en.wikipedia.org/wiki/JPEG JPEG]''': File extension

Navigation menu