Changes

Jump to navigation Jump to search
38 bytes removed ,  19:57, 30 March 2014
m
no edit summary
= Basic usage Usage =
The simplest way to insert an image is to use:
<texcode>\externalfigure[logo.pdf]</texcode>
 
This command places the PDF image <tt>logo.pdf</tt> in a {{cmd|vbox}}; the width and height of the image are equal to the natural dimensions of the image.
<texcode>\externalfigure[logo.pdf][page=5]</texcode>
 
These four variations cover 90% of the use cases.
== Natively supported file formats File Formats ==
ConTeXt natively supports the image formats enumerated below. The image format is determined from the file extension (case insensitive).
* '''PDF''': File extension <tt>.pdf</tt>
* '''JBIG''' or '''JBIG2''': File extension <tt>.jbig</tt>, <tt>.jbig2</tt>, or <tt>.jb2</tt>
== Including images after conversion Image Conversion ==
The image file formats listed in the previous section are the ones that may be embedded directly in a PDF. ConTeXt also supports a few other formats which that are first converted to PDF using an external program. Of course, for such a conversion to work, the corresponding converter must be in the <tt>PATH</tt>.
<table>
The conversion generates a PDF file with prefix <tt>m_k_i_v_</tt> and a suffix <tt>.pdf</tt> added to the name of the original file. The result is cached, and the conversion is rerun if the timestamp of the original file is newer than that of the converted file.
== Specifying image directories Image Directory ==
By default, ConTeXt searches an image in the current directory, the parent directory, and the grand-parent directory.
To search for images in other directories, say for example a <tt>./images</tt> subdirectory and <tt>/home/user/images</tt>, use:
<texcode>\setupexternalfigures
[directory={images, /home/user/images}]</texcode>
Note: always use forward slashes (`/`) in path names, regardless of operating system.
The default search order is: the current directory, the parent directory, the grand-parent directory, and then the paths specified by the <tt>directory</tt> key. To restrict image search only to the paths specified by the <tt>directory</tt> key, use:
419

edits

Navigation menu