1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
"DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml">
5
<!-- XML file produced from file: manual.tex
6
using Hyperlatex v 2.6 (c) Otfried Cheong
7
on Emacs 21.4.1, Sun Dec 24 00:03:23 2006 -->
9
<title>Ipe Manual -- 7 Style sheets</title>
11
<style type="text/css">
12
.maketitle { align : center }
13
div.abstract { margin-left: 20%; margin-right: 10%; }
14
h3.abstract { align : center }
15
div.verse, div.quote, div.quotation {
21
<meta http-equiv="Content-Type"
22
content="text/html; charset=UTF-8">
24
<body bgcolor="#ffffe6">
25
<table width="100%" cellpadding=0 cellspacing=2><tr><td bgcolor="#99ccff"><a href="manual_29.html"><img border="0" alt="8 Page views" src="next.png"></a></td><td bgcolor="#99ccff"><a href="manual.html"><img border="0" alt="Top" src="up.png"></a></td><td bgcolor="#99ccff"><a href="manual_22.html"><img border="0" alt="6 Snapping" src="previous.png"></a></td><td align="center" bgcolor="#99ccff" width="100%"><b>7 Style sheets</b></td></tr></table>
26
<h1>7 Style sheets</h1>
28
<p>The symbolic attributes appearing in an Ipe document are translated to
29
absolute values for rendering by a <em>style sheet</em> that is attached
30
to the document. Documents can have multiple "cascaded" style
31
sheets, the sheets form a stack, and symbols are looked up from top to
32
bottom. At the bottom of any style sheet cascade is always the
33
<em>standard</em> style sheet, which is built into Ipe. When you create
34
a new empty document, it automatically gets a copy of this standard
36
<p>The style sheet dialog (in the <em>Edit</em> menu under <em>Style
37
sheets</em>) allows you to inspect the cascade of style sheets
38
associated with your document, to add and remove style sheets, and
39
to change their order. You can also save individual style sheets.
40
You can, for instance, save the standard style sheet and use this as
41
a basis for making your own style sheets.
42
<p>The style sheets of your document also determine the choices you have
43
in the Ipe user interface in "symbolic" mode. If you feel that Ipe
44
does not offer you enough choice of colors, line widths, etc., you are
45
ready to make your own style sheet! As an example for defining a
46
style sheet with new colors, <a href="colors.xml">here</a> is a style sheet
47
that defines all the colors of the X11 color database (you should
48
probably make a selection of these for your own use, as this style
49
sheet is rather unwieldy).
50
<p>When a style sheet is "added" to an Ipe document, the contents of
51
the style sheet file is copied into the Ipe document. Subsequent
52
modification of the style sheet file has no effect on the Ipe
53
document. The right way to modify your style sheet is to either
54
"add" it again, and then to delete the <em>old</em> copy from your
55
style sheet cascade (the one further done in the list), or to use the
56
<em>Update style sheets</em> function in the <em>Edit</em> menu. This
57
function assumes that the style sheet file is in the same directory as
58
the document and that the filename coincides with the name of the
60
<p>Ipe will complain if you try to delete a style sheet that will cause
61
symbolic attributes to become undefined. The trick is to first add a
62
style sheet that also defines (and overrides) these same attributes,
63
and then to remove the old style sheet from the document.
64
<p>The style sheet is also responsible for determining the paper and
65
frame size. Ipe's default paper size is the ISO standard A4. If you
66
with to use U.S. letter size paper instead, include this style sheet:
68
<ipestyle name="letterpaper">
69
<layout paper="612 792" origin="0 0" frame="612 792"/>
72
<p>Style sheets can also contain <em>templates</em>, such as background
73
patterns, or logos to be displayed on each page. These are named Ipe
74
objects that can be reused in documents. If your document's style
75
sheets define a template named <em>Background</em>, it will be displayed
76
automatically on all pages. You can create and use templates using
77
the <em>template</em> ipelet. Here is a (silly) example of a style
78
sheet that defines a background template. This template is
79
automatically added to all new pages:
80
<pre><ipestyle name="background">
81
<template name="Background">
82
<text pos="10 10" stroke="black" size="LARGE">
88
<p>Style sheets can also define a piece of LaTeX-preamble for your
89
document. When your text objects are processed by LaTeX, the
90
preamble used consists of the pieces on the style sheet cascade, from
91
bottom to top, followed by the preamble set for the document itself.
92
<p>Here is a style sheet <i>presentation.xml</i> that can be used for
93
presentations. It enlarges all standard sizes by a factor <i>3</i>:
94
<pre><ipestyle name="presentation">
95
<linewidth name="normal" value="1.2"/>
96
<linewidth name="heavier" value="2.4"/>
97
<linewidth name="fat" value="3.6"/>
98
<linewidth name="ultrafat" value="6"/>
99
<marksize name="normal" value="9"/>
100
<marksize name="large" value="15"/>
101
<marksize name="small" value="6"/>
102
<marksize name="tiny" value="3.3"/>
103
<arrowsize name="normal" value="21"/>
104
<arrowsize name="large" value="30"/>
105
<arrowsize name="small" value="15"/>
106
<arrowsize name="tiny" value="9"/>
107
<textstretch name="normal" value="3 3"/>
108
<textstretch name="large" value="3 3"/>
109
<textstretch name="Large" value="3 3"/>
110
<textstretch name="LARGE" value="3 3"/>
111
<textstretch name="huge" value="3 3"/>
112
<textstretch name="Huge" value="3 3"/>
113
<textstretch name="small" value="3 3"/>
114
<textstretch name="footnote" value="3 3"/>
115
<textstretch name="tiny" value="3 3"/>
117
\renewcommand\rmdefault{cmss}
118
\newenvironment{ITEM}{\begin{itemize}\item}{\end{itemize}}
120
<margins tl="72 72" br="72 72"/>
121
<shading type="axial" colora="1 0.9 0.5" colorb="1 0.8 0.75"
122
coords="0 0 0 200" extend="0 1"/>
125
<p>Note the use of the <code><textstretch></code> element to magnify text. The
126
text size you choose from the Ipe user interface (<em>"large"</em>,
127
for instance) is in fact used for <em>two</em> symbolic attributes,
128
namely <code>textsize</code> (where <em>large</em> maps to <code>\large</code>) and
129
<code>textstretch</code> (where it maps to no stretch in the standard style
130
sheet). By setting the text stretch, you can magnify fonts.
131
<p>Also note the <code><margins></code> element--it determines the boundaries
132
of the "standard" text area. The <em>Insert text box</em> function
133
(in the <em>Edit</em> menu) uses these margins.
134
<p>The LaTeX-preamble defined in the <code><preamble></code> element
135
redefines the standard font shape to <code>cmss</code> (Computer Modern Sans
136
Serif). Many people find sans-serif fonts easier to read on a screen.
137
<p>Finally, note the <code><shading></code> element. You can use this to define
138
a shading that will be applied to every page in your PDF/Postscript
139
output, before anything else is drawn on the page. The shading is
140
invisible in the Ipe user interface, so use this it with care.
142
<table width="100%" cellpadding=0 cellspacing=2><tr><td bgcolor="#99ccff"><a href="manual_29.html"><img border="0" alt="8 Page views" src="next.png"></a></td><td bgcolor="#99ccff"><a href="manual.html"><img border="0" alt="Top" src="up.png"></a></td><td bgcolor="#99ccff"><a href="manual_22.html"><img border="0" alt="6 Snapping" src="previous.png"></a></td><td align="center" bgcolor="#99ccff" width="100%"><b>7 Style sheets</b></td></tr></table></body></html>