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
|
<?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.3.1, Mon Nov 22 10:30:52 2004 -->
<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.
<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 added
automatically to all newly created 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><ipestyle name="background">
<template name="background">
<text pos="10 10" stroke="black" size="LARGE">
Background text
</text>
</template>
</ipestyle>
</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 <i>3</i>:
<pre><ipestyle name="presentation">
<linewidth name="normal" value="1.2"/>
<linewidth name="heavier" value="2.4"/>
<linewidth name="fat" value="3.6"/>
<linewidth name="ultrafat" value="6"/>
<marksize name="normal" value="9"/>
<marksize name="large" value="15"/>
<marksize name="small" value="6"/>
<marksize name="tiny" value="3.3"/>
<arrowsize name="normal" value="21"/>
<arrowsize name="large" value="30"/>
<arrowsize name="small" value="15"/>
<arrowsize name="tiny" value="9"/>
<textstretch name="normal" value="3 3"/>
<textstretch name="large" value="3 3"/>
<textstretch name="Large" value="3 3"/>
<textstretch name="LARGE" value="3 3"/>
<textstretch name="huge" value="3 3"/>
<textstretch name="Huge" value="3 3"/>
<textstretch name="small" value="3 3"/>
<textstretch name="footnote" value="3 3"/>
<textstretch name="tiny" value="3 3"/>
<preamble>
\renewcommand\rmdefault{cmss}
\newenvironment{ITEM}{\begin{itemize}\item}{\end{itemize}}
</preamble>
<margins tl="72 72" br="72 72"/>
<shading type="axial" colora="1 0.9 0.5" colorb="1 0.8 0.75"
coords="0 0 0 200" extend="0 1"/>
</ipestyle>
</pre>
<p>Note the use of the <code><textstretch></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
(independently for height and width).
<p>Also note the <code><margins></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><preamble></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><shading></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>
|