Command/setupexternalfigure

From Wiki
< Command
Revision as of 18:09, 16 January 2023 by Ousia (talk | contribs) (add reference multimedia inclusion)
Jump to navigation Jump to search


\setupexternalfigure

Summary

The command \setupexternalfigure sets up \externalfigure

Settings

\setupexternalfigure[...,...][...=...,...]
[...,...]name
widthdimension
heightdimension
labelname
pagenumber
objectyes no
prefixtext
methodpdf mps jpg png jp2 jbig svg eps gif tif mov buffer tex cld auto
controlsyes no
previewyes no
masknone
resolutionnumber
colorcolor
cmykyes no auto
argumentstext
repeatyes no
factorfit broad max auto default
hfactorfit broad max auto default
wfactorfit broad max auto default
maxwidthdimension
maxheightdimension
equalwidthdimension
equalheightdimension
scalenumber
xscalenumber
yscalenumber
snumber
sxnumber
synumber
linesnumber
locationlocal global default
directorypath
optiontest frame empty
foregroundcolorcolor
resetyes no
backgroundcolor foreground name
frameon off
backgroundcolorcolor
xmaxnumber
ymaxnumber
frameson off
interactionyes all none reference layer bookmark
bodyfontdimension
commentcommand text
sizenone media crop trim art
cachepath
resourcespath
displayfile
conversiontext
orderlist
crossreferenceyes no number
transformauto number
userpasswordtext
ownerpasswordtext

OptionExplanation
label
internal name
page
Page number of PDF.
object
Reuse this image file as an object, i.e. embed it only once in PDF if it’s used several times?
method
force a file type (and processing), e.g. if there are different versions
mov is removed from LMTX
auto strips suffix and uses "order"
controls
Show media controls (for movies)
resolution
Set the image resolution (after scaling) for automatic downsampling
number dpi
color
Colorize the image. Works only with some greyscale pictures (no channels, no additional tables, ...?) and only with toned (p=) or spot colors. Use with object=no
color color name
cmyk
Force CMYK conversion
arguments
used for converters
factor
If both width and height are set, the factor is important. If factor is empty, the image is deformed accordingly.
fit aspect ratio is kept, the image is scaled to the smaller (fitted) variant
max aspect ratio is kept, the image is scaled to the bigger (oversized) variant
maxwidth
maximum width
maxheight
maximum height
scale
1000 is original size (100%); to get 72%, use scale=720.
lines
Height in lines
location
Where to find figure files. Multiple comma-separated options are allowed, and the default value is local,global
local search in the current directory
global search path specified with the directory key
default search in the texmf tree
directory
comma-separated directories to search for figure files
option
empty don’t include actual image (“draft mode”)
foregroundcolor
probably synonymous to "color"
background
like \setupframed
frame
Show frame around image. Most(?) options of \setupframed are usable!
backgroundcolor
like \setupframed, used if background=color
interaction
How to handle the interaction (links etc.) of included PDFs – default is to disable all of them.
yes keep all(?)
all keep all
none disable all
reference keep references
layer keep PDF layers (viewer layers, optional content groups)
bookmark keep bookmarks
size
Use specified box of PDF (MediaBox, CropBox, TrimBox, ArtBox). (No BleedBox?)
cache
Set location of cache for conversions
display
alternative figure, e.g. lowres; used with movie and 3D contents, probably obsolete
conversion
see grph-con.lua. conversion=mp activates internal processing of SVG via MetaPost
order
Sets the order in which the individual file types are looked up.
crossreference
yes use counter for referencing
transform
Rotation in 90˚ steps (otherwise use \rotate); does not always work (?) orientation=90|180|270 works
userpassword
Access to encrypted PDFs
ownerpassword
Access to encrypted PDFs

Description

There are a few more options that are missing in the interface files:
  • orientation: rotation (in LMTX arbitrary angles, in MkIV only 90˚steps)
  • minwidth/minheight
  • strut: strut=none also avoids the \noindent; otherwise we're in hmode when blank happens and we get a lineskip

Examples

Example 1

\setupexternalfigures
   [order={pdf,png,jpg},
    location=global,
    directory={images}]

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: