~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to doc/manual_28.html

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2009-12-11 21:22:35 UTC
  • mfrom: (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091211212235-5iio4nzpra64snab
Tags: 7.0.10-1
* New upstream.  Closes: #551192.
  - New build-depends: libcairo2-dev, liblua5.1-0-dev, gsfonts
  - patches/config.diff: Remove.  Upstream build system replaced.
  - Runtime lib package changed to libipe7.0.10 from libipe1c2a
  - Devel package renamed to libipe-dev (from libipe1-dev)
  - Package ipe depends on lua5.1 due to ipe-update-master.

* rules: Re-write to use dh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 -->
8
 
<head>
9
 
<title>Ipe Manual -- 7 Style sheets</title>
10
 
 
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 {
16
 
  margin-left : 10%; 
17
 
  margin-right : 10%;
18
 
}
19
 
</style>
20
 
 
21
 
<meta http-equiv="Content-Type" 
22
 
        content="text/html; charset=UTF-8">
23
 
</head>
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>
27
 
 
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
35
 
style sheet.
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
59
 
style sheet.
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:
67
 
<pre>
68
 
   &lt;ipestyle name="letterpaper"&gt;
69
 
   &lt;layout paper="612 792" origin="0 0" frame="612 792"/&gt;
70
 
   &lt;/ipestyle&gt;
71
 
</pre>
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>&lt;ipestyle name="background"&gt;
81
 
&lt;template name="Background"&gt;
82
 
&lt;text pos="10 10" stroke="black" size="LARGE"&gt;
83
 
Background text
84
 
&lt;/text&gt;
85
 
&lt;/template&gt;
86
 
&lt;/ipestyle&gt;
87
 
</pre>
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&nbsp;<i>3</i>:
94
 
<pre>&lt;ipestyle name="presentation"&gt;
95
 
&lt;linewidth name="normal" value="1.2"/&gt;
96
 
&lt;linewidth name="heavier" value="2.4"/&gt;
97
 
&lt;linewidth name="fat" value="3.6"/&gt;
98
 
&lt;linewidth name="ultrafat" value="6"/&gt;
99
 
&lt;marksize name="normal" value="9"/&gt;
100
 
&lt;marksize name="large" value="15"/&gt;
101
 
&lt;marksize name="small" value="6"/&gt;
102
 
&lt;marksize name="tiny" value="3.3"/&gt;
103
 
&lt;arrowsize name="normal" value="21"/&gt;
104
 
&lt;arrowsize name="large" value="30"/&gt;
105
 
&lt;arrowsize name="small" value="15"/&gt;
106
 
&lt;arrowsize name="tiny" value="9"/&gt;
107
 
&lt;textstretch name="normal" value="3 3"/&gt;
108
 
&lt;textstretch name="large" value="3 3"/&gt;
109
 
&lt;textstretch name="Large" value="3 3"/&gt;
110
 
&lt;textstretch name="LARGE" value="3 3"/&gt;
111
 
&lt;textstretch name="huge" value="3 3"/&gt;
112
 
&lt;textstretch name="Huge" value="3 3"/&gt;
113
 
&lt;textstretch name="small" value="3 3"/&gt;
114
 
&lt;textstretch name="footnote" value="3 3"/&gt;
115
 
&lt;textstretch name="tiny" value="3 3"/&gt;
116
 
&lt;preamble&gt;
117
 
\renewcommand\rmdefault{cmss}
118
 
\newenvironment{ITEM}{\begin{itemize}\item}{\end{itemize}}
119
 
&lt;/preamble&gt;
120
 
&lt;margins tl="72 72" br="72 72"/&gt;
121
 
&lt;shading type="axial" colora="1 0.9 0.5" colorb="1 0.8 0.75" 
122
 
         coords="0 0 0 200" extend="0 1"/&gt;
123
 
&lt;/ipestyle&gt;
124
 
</pre>
125
 
<p>Note the use of the <code>&lt;textstretch&gt;</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>&lt;margins&gt;</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>&lt;preamble&gt;</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>&lt;shading&gt;</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.
141
 
<hr />
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>