Changes

Jump to navigation Jump to search
m
Add \definegraphictypesynonym to 'See also'
<noinclude>
 
{{Reference
|name=externalfigure
}}
== [[Help:Reference|Syntax]] (autogenerated) ==<table cellspacing="4" cellpadding="2" class="cmd"> <tr> <td colspan="2" class="cmd"syntax>\externalfigure<span class="first" >[...]</span><span class="second" >[...,...=...,...]</span></td> </tr> <tr valign="top" class="first"> <td class="cmd">[...]</td> <td>file </td> </tr> <tr valign="top" class="second"> <td class="cmd">[...,...=...,...]</td> <td>see [[Command/useexternalfigure|\useexternalfigure]] </td> </tr></tablesyntax>
</noinclude>
== Description ==
Command The <code>\externalfigure</code> command is used 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:
* '''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  Historically, when postscript output was used, the order in which the file extensions were searched depended on the output format (PDF or PS). These daysWith recent releases of ConTeXt, 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 ===
* '''[http://en.wikipedia.org/wiki/Portable_Document_Format PDF]''': File extension <code>.pdf</code>. By default, ''mediabox'' is used to determine size. Use <code>size=artbox</code> to use ''artbox''.
* '''MPS (MetaPost Output)''': File extension <code>.mp</code>, <code>.mps</code> or <code>.[digits]</code>. <!-- Converted to PDF on the fly using MPtoPDF. -->
* '''[http://en.wikipedia.org/wiki/JPEG JPEG]''': File extension <code>.jpg</code> and <code>.jpeg</code>
* '''[http://en.wikipedia.org/wiki/Portable_Network_Graphics PNG]''': File extesion <code>.png</code>
* '''[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>
 
Additionally supported natively in LMTX:
 
* '''[http://en.wikipedia.org/wiki/Scalable_Vector_Graphics SVG]''': File extension <code>.svg</code> and <code>.svgz</code> via an internal Metapost conversion; use <code>conversion=mp</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 not removed). The result is cached, and the conversion is rerun only if the timestamp of the original file is newer than the converted file.
inkscape [inputfile] --export-dpi=600 -A [outputfile]
: (Note: Conversion to PNG is also possible, but I don't don’t know the details on how to active that -- 03:32, 29 November 2012 (CET)).
* '''[http://en.wikipedia.org/wiki/PostScript PS]''' and '''[http://en.wikipedia.org/wiki/Encapsulated_PostScript EPS]''': File extension <code>.eps</code> and <code>.ai</code>. Converted to PDF using [http://en.wikipedia.org/wiki/Ghostscript Ghostscript].
=== 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>.
* '''[https://en.wikipedia.org/wiki/Flash_Video Flash Video]''': File extension <code>.flv</code>
* '''[https://en.wikipedia.org/wiki/MPEG-4 MPEG 4]''': File extension <code>.mp4</code>
 
{{ note| Movie inclusion only works in a few PDF viewers }}
=== Support for special TeX formats ===
* '''cld''': Typeset the [[CLD|ConTeXt Lua document]] using <code>context</code> and include the result as a PDF file.
 
== Command options ==
 
=== <code>interaction</code> ===
 
By default, the interactive elements of the included PDF file are discarded. To enable the interactive elements of the included PDF file, use
 
<texcode>\externalfigure[filename.pdf][interaction=yes]</texcode>
== Example ==
<context source="yes" mode="mkiv">
\externalfigure[http://placekitten.com/g/200/300][method=jpg]
</context>
== Tracking ==
The following trackers are available for {{cmd|externalfiguresexternalfigure}} (MkIV only)
* '''graphics.locating''': Gives details about where the image files are searched, what strategy was used to infer the file format, and what was the inferred file format.
context --trackers=list [filename]
When the '''graphics.locating''' tracker is enabled, including a known file gives displays the following information on the terminal:
graphics > inclusion > locations: local,global
graphics > inclusion > format natively supported by backend: pdf
If the asked requested file does not exist, the following information is displayed.:
graphics > inclusion > locations: local,global
graphics > inclusion > format not supported: %s
When the '''graphics.conversion''' tracker is enabled, and, including a file type that requires conversion(e.g., say PS) is included, displays the following message is displayed on the terminal:
graphics > inclusion > checking conversion of './tiger.ps' (./tiger.ps): old format 'ps', new format 'pdf', conversion 'default', resolution 'default'
graphics > inclusion > new graphic, hash: m_k_i_v_tiger.ps.pdf->1->crop->unknown->unknown->unknown->
When the '''graphics.inclusion''' tracker is enabled, including and a movie displays is included, the following message is displayed on the terminal :
graphics > inclusion > including movie 'clip.mov': width 5594039.4330709, height 5594039.4330709
<noinclude>
== See also ==
* {{cmd|defineexternalfigure}} to define a collection of settings
* {{cmd|setupexternalfiguressetupexternalfigure}} to define a different collection of settings
* {{cmd|useexternalfigure}} to define an image+settings combination
* {{cmd|definegraphictypesynonym}} to map a file extension to a particular image type handler
* [[Using Graphics]]
* [[Multimedia Inclusion]] to add audio and video contents.
== Help from ConTeXt-Mailinglist/Forum ==
All issues with:
{{Forum|{{SUBPAGENAME}}}}
</noinclude>
[[Category:Command/FiguresImages|externalfigure]]
38

edits

Navigation menu