File: manual_28.html

package info (click to toggle)
ipe 6.0pre30-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,100 kB
  • ctags: 5,419
  • sloc: cpp: 30,430; ansic: 1,045; xml: 845; makefile: 78; sh: 5
file content (142 lines) | stat: -rw-r--r-- 7,837 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- XML file produced from file: manual.tex
     using Hyperlatex v 2.6 (c) Otfried Cheong
     on Emacs 21.4.1, Sun Dec 24 00:03:23 2006 -->
<head>
<title>Ipe Manual -- 7 Style sheets</title>

<style type="text/css">
.maketitle { align : center }
div.abstract { margin-left: 20%; margin-right: 10%; }
h3.abstract  { align : center }
div.verse, div.quote, div.quotation {
  margin-left : 10%; 
  margin-right : 10%;
}
</style>

<meta http-equiv="Content-Type" 
        content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffe6">
<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>
<h1>7 Style sheets</h1>

<p>The symbolic attributes appearing in an Ipe document are translated to
absolute values for rendering by a <em>style sheet</em> that is attached
to the document.  Documents can have multiple "cascaded" style
sheets, the sheets form a stack, and symbols are looked up from top to
bottom.  At the bottom of any style sheet cascade is always the
<em>standard</em> style sheet, which is built into Ipe.  When you create
a new empty document, it automatically gets a copy of this standard
style sheet.
<p>The style sheet dialog (in the <em>Edit</em> menu under <em>Style
  sheets</em>) allows you to inspect the cascade of style sheets
associated with your document, to add and remove style sheets, and
to change their order.  You can also save individual style sheets.
You can, for instance, save the standard style sheet and use this as
a basis for making your own style sheets.
<p>The style sheets of your document also determine the choices you have
in the Ipe user interface in "symbolic" mode.  If you feel that Ipe
does not offer you enough choice of colors, line widths, etc., you are
ready to make your own style sheet!  As an example for defining a
style sheet with new colors, <a href="colors.xml">here</a> is a style sheet
that defines all the colors of the X11 color database (you should
probably make a selection of these for your own use, as this style
sheet is rather unwieldy).
<p>When a style sheet is "added" to an Ipe document, the contents of
the style sheet file is copied into the Ipe document.  Subsequent
modification of the style sheet file has no effect on the Ipe
document.  The right way to modify your style sheet is to either
"add" it again, and then to delete the <em>old</em> copy from your
style sheet cascade (the one further done in the list), or to use the
<em>Update style sheets</em> function in the <em>Edit</em> menu.  This
function assumes that the style sheet file is in the same directory as
the document and that the filename coincides with the name of the
style sheet.
<p>Ipe will complain if you try to delete a style sheet that will cause
symbolic attributes to become undefined.  The trick is to first add a
style sheet that also defines (and overrides) these same attributes,
and then to remove the old style sheet from the document.
<p>The style sheet is also responsible for determining the paper and
frame size.  Ipe's default paper size is the ISO standard A4.  If you
with to use U.S. letter size paper instead, include this style sheet:
<pre>
   &lt;ipestyle name="letterpaper"&gt;
   &lt;layout paper="612 792" origin="0 0" frame="612 792"/&gt;
   &lt;/ipestyle&gt;
</pre>
<p>Style sheets can also contain <em>templates</em>, such as background
patterns, or logos to be displayed on each page.  These are named Ipe
objects that can be reused in documents. If your document's style
sheets define a template named <em>Background</em>, it will be displayed
automatically on all pages.  You can create and use templates using
the <em>template</em> ipelet.  Here is a (silly) example of a style
sheet that defines a background template. This template is
automatically added to all new pages:
<pre>&lt;ipestyle name="background"&gt;
&lt;template name="Background"&gt;
&lt;text pos="10 10" stroke="black" size="LARGE"&gt;
Background text
&lt;/text&gt;
&lt;/template&gt;
&lt;/ipestyle&gt;
</pre>
<p>Style sheets can also define a piece of LaTeX-preamble for your
document.  When your text objects are processed by LaTeX, the
preamble used consists of the pieces on the style sheet cascade, from
bottom to top, followed by the preamble set for the document itself.
<p>Here is a style sheet <i>presentation.xml</i> that can be used for
presentations.  It enlarges all standard sizes by a factor&nbsp;<i>3</i>:
<pre>&lt;ipestyle name="presentation"&gt;
&lt;linewidth name="normal" value="1.2"/&gt;
&lt;linewidth name="heavier" value="2.4"/&gt;
&lt;linewidth name="fat" value="3.6"/&gt;
&lt;linewidth name="ultrafat" value="6"/&gt;
&lt;marksize name="normal" value="9"/&gt;
&lt;marksize name="large" value="15"/&gt;
&lt;marksize name="small" value="6"/&gt;
&lt;marksize name="tiny" value="3.3"/&gt;
&lt;arrowsize name="normal" value="21"/&gt;
&lt;arrowsize name="large" value="30"/&gt;
&lt;arrowsize name="small" value="15"/&gt;
&lt;arrowsize name="tiny" value="9"/&gt;
&lt;textstretch name="normal" value="3 3"/&gt;
&lt;textstretch name="large" value="3 3"/&gt;
&lt;textstretch name="Large" value="3 3"/&gt;
&lt;textstretch name="LARGE" value="3 3"/&gt;
&lt;textstretch name="huge" value="3 3"/&gt;
&lt;textstretch name="Huge" value="3 3"/&gt;
&lt;textstretch name="small" value="3 3"/&gt;
&lt;textstretch name="footnote" value="3 3"/&gt;
&lt;textstretch name="tiny" value="3 3"/&gt;
&lt;preamble&gt;
\renewcommand\rmdefault{cmss}
\newenvironment{ITEM}{\begin{itemize}\item}{\end{itemize}}
&lt;/preamble&gt;
&lt;margins tl="72 72" br="72 72"/&gt;
&lt;shading type="axial" colora="1 0.9 0.5" colorb="1 0.8 0.75" 
         coords="0 0 0 200" extend="0 1"/&gt;
&lt;/ipestyle&gt;
</pre>
<p>Note the use of the <code>&lt;textstretch&gt;</code> element to magnify text.  The
text size you choose from the Ipe user interface (<em>"large"</em>,
for instance) is in fact used for <em>two</em> symbolic attributes,
namely <code>textsize</code> (where <em>large</em> maps to <code>\large</code>) and
<code>textstretch</code> (where it maps to no stretch in the standard style
sheet).  By setting the text stretch, you can magnify fonts.
<p>Also note the <code>&lt;margins&gt;</code> element--it determines the boundaries
of the "standard" text area.  The <em>Insert text box</em> function
(in the <em>Edit</em> menu) uses these margins.
<p>The LaTeX-preamble defined in the <code>&lt;preamble&gt;</code> element
redefines the standard font shape to <code>cmss</code> (Computer Modern Sans
Serif).  Many people find sans-serif fonts easier to read on a screen.
<p>Finally, note the <code>&lt;shading&gt;</code> element. You can use this to define
a shading that will be applied to every page in your PDF/Postscript
output, before anything else is drawn on the page.  The shading is
invisible in the Ipe user interface, so use this it with care.
<hr />
<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>