##### 27.8.3.3 Supplying properties for extracted graphics

You can use predefined macro variable <$$_extrgraphid> to access properties you have assigned to individual graphics in the configuration file.

For example, suppose you are using JavaScript in extract replacement code to specify characteristics of the secondary window in which each extracted graphic will appear. And suppose you want each window to be the same size as the graphic. You could place code like the following in an ExtrReplace PI marker for each individual extract, with the dimensions for that particular graphic:

    <p class="fig"><a href="javascript:location='<$$_currfile>';
      window.open('<$$_extrfile>','height=387,width=550')">
      <$$_extrtitle></a></p>

Or, you could specify the dimensions of any extractable graphics in the project configuration file: (see §32.8.2 Adjusting image size for selected graphics):

    [GraphWide]
    ; Graphic file name = number of pixels wide, 0 to omit width attribute
    aa123456=525
    ab654321=440

    [GraphHigh]
    ; Graphic file name = number of pixels high, 0 to omit height
    ; attribute
    aa123456=150
    ab654321=220

Then you could access the dimensions with a list variable (see §37.4 Using multiple-value list variables) in the replacement code. For example, you could replace the JavaScript height and width clause with the following code, where $$graphhigh and $$graphwide are list variables:

    'height=<$$graphhigh[$$_extrgraphid]>,
    width=<$$graphwide[$$_extrgraphid]>'

You could define macros to supply default values for graphics not listed in the configuration sections that your list variables access. For example:

    [ExtrGraphHigh]
    <$$ht = ($$graphhigh[$$_extrgraphid])>
    <$_if ($$ht==0)><$$ht=387><$_endif><$$ht>

Previous Topic: 27.8.3.2.4 Including text with a thumbnail

Next Topic: 27.8.4 Specifying extracts: an example

Parent Topic: 27.8.3 Replacing extracts with links in the parent file

Sibling Topics:

27.8.3.1 Assigning replacement code

27.8.3.2 Using thumbnails for links to illustrations in HTML

Table of Contents • Index