![]() | ![]() | ![]() | 14.4 The Ipe style sheet format |
Style sheets can either be embedded in an Ipe document, or reside in
a separate file. Separate files can start with the optional
<?xml> tag.
The style sheet itself consists of the single element
<ipestyle>. It takes the optional attribute name, which
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 style sheet element can consist of the following
elements: template, color, dashstyle,
linewidth, textsize, marksize, arrowsize,
grid, angle, preamble, textstretch,
layout, titlestyle, cmap, pathstyle,
textstyle and shading.
The template element takes a required attribute name,
which identifies the template and must be unique in the style
sheet. Its contents is a single Ipe object.
The textstyle element defines a symbolic text style. Its
attribute name sets the name (to be used in the style
attribute of <text> elements), and the attributes begin
and end contain the LaTeX code to be placed before and after
the text of the object when it is formatted.
The contents of the preamble element defines a (piece of)
LaTeX-preamble.
The layout element defines the layout of the frame on the paper
and the paper size. It takes the required attributes paper,
origin, and frame, and the optional attribute
skip. The origin is the lower left corner of the frame
in the paper coordinate system, frame is the size of the frame,
and paper is the size of the paper. skip is the default
paragraph skip between textboxes.
The titlestyle element defines the appearance of the page title
on the page. It takes the required arguments pos,
color, and size, and the optional arguments
halign and valign. They have the same meaning as for
<text> elements.
The pathstyle element takes the optional attributes cap,
join, and fillrule, with the same meaning as the
attributes to <path> elements. The define the default setting
for path objects.
The shading element sets the background shading of a PDF page.
Its required attributes are type (with the possible values
axial and radial), colora and colorb (the
two extreme colors that are being interpolated), extend (two
integer flags, indicating whether to extend the shading to the full
page), and coords (for axial shading, the coordinates of the
endpoints of the axis, for radial shading, the center and radius of
both circles). The shading will be applied to every PDF page, before
anything else is drawn on it. It is completely invisible in the Ipe
user interface, so use this it with care.
The cmap element defines a Unicode font. It takes the single
required attribute font, which specifies the name of the font.
See here for an example.
All other elements have empty contents and two required attributes,
name and value. name defines a symbolic name,
value an absolute value. The symbolic name must start with a
letter 'a' to 'z' or 'A' to 'Z'. The value for the color and
dashstyle elements must be a legal absolute value for the Ipe
object attributes of the same name. The value for linewidth,
textsize, marksize, arrowsize, grid,
textstretch and angle must be single real number.
Note that the symbolic names for grid and angle cannot
actually be used by objects in the document--they are only used to
fill the grid size and angular snap angle in the user interface with
values.
![]() | ![]() | ![]() | 14.4 The Ipe style sheet format |