|  |  | 9.4 The <ipestyle> element

## 9.4 The <ipestyle> element

#### Attributes

name
  (optional) The name serves to identify the style sheet informally, and can be used to automatically update the style sheet from a file with the matching name.

The contents of the `<ipestyle>` element is a series of style definition elements, in no particular order. These elements are described below.

### 9.4.1 The <symbol> element

#### Attributes

name
  (required) The name identifies the symbol and must be unique in the style sheet. For parameterized symbols, the name must end with the pattern "(s?f?p?x?)", where "s" stands for stroke, "f" for fill, "p" for pen, and "x" for size.
transformations
  (optional) As for objects.
xform
  (optional) If this attribute is set, a PDF XForm will be created for this symbol when saving or exporting to PDF. It implies `transformations="translations"`, and will be ignored if any of the symbol parameters (that is, stroke, fill, pen, or size) are used. Setting this attribute will cause the PDF output to be significantly smaller for a complicated symbol that is used often (for instance, a complicated background used on every page).

The contents of the `<symbol>` element is a single Ipe object.

### 9.4.2 The <preamble> element

See the <preamble> elements inside `<ipe>` elements.

### 9.4.3 The <cmap> element

#### Attributes

font
  (required) The name of a font. The font is marked as being Unicode-encoded. See here for an example.

### 9.4.4 The <textstyle> element

#### Attributes

name
  (required) The symbolic name (to be used in the `style` attribute of `<text>` elements),
begin
  (required) LaTeX code to be placed before the text of the object when it is formatted,
end
  (required) LaTeX code to be placed after the text of the object when it is formatted.

### 9.4.5 The <layout> element

It defines the layout of the frame on the paper and the paper size.

#### Attributes

paper
  (required) The size of the paper.
origin
  (required) The lower left corner of the frame in the paper coordinate system.
frame
  (required) The size of the frame.
skip
  (optional) The default paragraph skip between textboxes.
crop
  (optional) If the value of `crop` is `yes`, Ipe will create a `CropBox` attribute when saving to PDF.

### 9.4.6 The <titlestyle> element

It defines the appearance of the page title on the page.

#### Attributes

pos
  (required) The position of the title reference point in the frame coordinate system.
color
  (required) The color of the title.
size
  (required) The title font size (same as for `<text>` elements).
halign
  (optional) The horizontal alignment (same as for `<text>` elements).
valign
  (optional) The vertical alignment (same as for `<text>` elements).

### 9.4.7 The <pagenumberstyle> element

It defines the appearance of page numbers on the page.

#### Attributes

pos
  (required) The position of the page number on the page.
color
  (required) The color of the page number as an absolute color.
size
  (required) The font size as a number.

### 9.4.8 The <textpad> element

It defines padding around text objects for the computation of bounding boxes. The four required attributes are left, right, top, and bottom.

### 9.4.9 The <pathstyle> element

It defines the default setting for path objects.

#### Attributes

cap
  (optional) Same as for `<path>` elements.
join
  (optional) Same as for `<path>` elements.
fillrule
  (optional) Same as for `<path>` elements.

### 9.4.10 The <opacity> element

The `opacity` element defines a possible opacity value (also known as an alpha-value). All opacity values used in a document must be defined in the style sheet.

#### Attributes

name
  (required) A symbolic name, to be used in the `opacity` attribute of a `text` or `path` element.
value
  (required) An absolute value for the opacity, between 0.001 and 1.000. A value of 1.0 implies that the element is fully opaque.

### 9.4.11 The <gradient> element

The `gradient` element defines a gradient pattern.

#### Attributes of `<gradient>`

name
  (required) The symbolic name (to be used in the `gradient` attribute of `<path>` elements).
type
  (required) Possible values are `axial` and `radial`.
extend
  (optional) `yes` or `no` (the default). Indicates whether the gradient is extended beyond the boundaries.
coords
  (required) For axial shading: the coordinates of the endpoints of the axis (in the order `x1 y1 x2 y2`). For radial shading: the center and radius of both circles (in the order `cx1 cy1 r1 cx2 cy2 r2`).
matrix
  (optional) A transformation that transforms the gradient coordinate system into the coordinate system of the path object using the gradient. The default is the identity matrix.

The contents of the `<gradient>` element are `<stop>` elements defining the color stops of the gradient. There must be at least two stops. Stops must be defined in increasing offset order. It is not necessary that the first offset is 0.0 and the last one is 1.0.

#### Attributes of `<stop>`

offset
  (required) Offset of the color stop (a number between 0.0 and 1.0).
color
  (required) Color at this color stop (three numbers). Symbolic names are not allowed.

### 9.4.12 The <tiling> element

The `tiling` element defines a tiling pattern. Only very simple patterns that hatch the area with a line are supported.

#### Attributes

name
  (required) The symbolic name (to be used in the `tiling` attribute of `<path>` elements).
angle
  (required) Slope of the hatching line in degrees, between -90 and +90 degrees.
width
  (required) Width of the hatching line.
step
  (required) Distance from one hatching line to the next.

Here, `width` and `step` are measured in the y-direction if the absolute value of `angle` is less than 45 degrees, and in the y-direction otherwise.

### 9.4.13 The <effect> element

The `effect` element defines a graphic effect to be used during a PDF page transition. Acrobat Reader supports these effects, but not all PDF viewers do.

#### Attributes

name
  (required) The symbolic name (to be used in the `effect` attribute of `<view>` elements).
duration
  (required) Value must be a real number, indicating the duration of display in seconds.
transition
  (required) Value must be a real number, indicating the duration of the transition effect in seconds.
effect
  (required) a number indicated the desired effect. The value must be an integer between 0 and 16 (see `ipe::Effect::TEffect` for the exact meaning).

### 9.4.14 Other style definition elements

The remaining style definition elements are:

- `<color>` Defines a symbolic color. The value must be an absolute color, that is either a single gray value (between 0 and 1), or three components (red, green, blue) seperated by space.
- `<dashstyle>` Defines a symbolic dashstyle. The value must be a correct dashstyle description, e.g. `[3 5 2 5] 0`.
- `<pen>` Defines a symbolic pen width. The value is a single real number.
- `<textsize>` Defines a symbolic text size. The value is a piece of LaTeX source code selecting the desired font size.
- `<textstretch>` Defines a symbolic text stretch factor. The symbolic name is shared with `<textsize>` elements. The value is a single real number.
- `<symbolsize>` Defines a symbolic size for symbols. The value is a single real number, and indicates the scaling factor used for the symbol.
- `<arrowsize>` Defines a symbolic size for arrows. The value is a single real number.
- `<gridsize>` Defines a grid size. The symbolic name cannot actually be used by objects in the document — it is only used to fill the grid size selector in the user interface.
- `<anglesize>` Defines an angular snap angle. The symbolic name cannot actually be used by objects in the document — it is only used to fill the angle selector in the user interface.

#### Common attributes

name
  (required) A symbolic name, which must start with a letter 'a' to 'z' or 'A' to 'Z'.
value
  (required) A legal absolute value for the type of attribute.