Common Desktop Environment: Help System Author's and Programmer's Guide

## To Create a Figure

1. Declare a file entity to identify the image file to be included in the figure.

`<!entity graphic-entity FILE "filename.ext">  `

Remember, all entity declarations must come before any other markup at the top of your help volume.

2. Use the <figure>element as shown:

```<figure entity=graphic-entity>
caption string
<\figure> ```

Where graphic-entity is the entity name for the graphic file you want to display, and caption string is an optional string. Caption text is displayed above the graphic.

By default, figures are numbered and the number is prepended to your caption string. To create a nonnumbered figure, include the nonumber parameter (as shown in one of the following examples).

```<figure entity=graphic-entity ghyperlink="id" glinktype=type>
caption string
<\figure>```

### Examples

For these examples, assume that you've declared these two file entities at the top of your help volume:

```<!entity FirstPicture  FILE "first.tif">
<!entity SecondPicture FILE "second.pm"> ```
• The following figure displays the graphic in the first.tif file and displays a number (by default) and caption:

```<figure entity=FirstPicture>
Here's the First Picture
<\figure> ```
• Here's a figure that displays the second.pm file without a number or a caption:

```<figure nonumber entity=SecondPicture>
<\figure> ```

If you add an ID to a figure, you must have a caption. The caption is needed in case an <xref> uses the figure's ID; if so, the caption is inserted in place of the <xref> and becomes a hyperlink to the figure.

• The following figure is an execution hyperlink that runs the xclock program:

```<figure entity=SecondPicture ghyperlink="xclock &" glinktype=execute>
Choose This Figure to Start the Clock
<\figure> ```