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.3.2, Sat Jun 5 10:52:30 2004 -->
9
<title>Ipe Manual -- 2 About Ipe files</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_3.html"><img border="0" alt="3 Command line options and auxiliary programs" 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_1.html"><img border="0" alt="1 Introduction" src="previous.png"></a></td><td align="center" bgcolor="#99ccff" width="100%"><b>2 About Ipe files</b></td></tr></table>
26
<h1>2 About Ipe files</h1>
28
<p>Ipe 6.0 creates (Encapsulated) Postscript or PDF files. These files
29
can be used in any way that PDF or Postscript files are used, such as
30
viewed with Ghostview, with Acrobat Reader or Xpdf, edited with
31
Acrobat, or included in Latex/Pdflatex documents. However, Ipe cannot
32
read arbitrary Postscript or PDF files, only files it has created
33
itself. This is because files created by Ipe contain a special hidden
34
stream that describes the Ipe objects. (So if you edit your
35
Ipe-generated PDF file in a different program such as Adobe Acrobat,
36
Ipe will not be able to read the file again afterwards.)
37
<p>You decide in what format to store a figure when saving it for the
38
first time. Ipe gives you the option of saving with extensions "eps"
39
(Encapsulated Postscript), "ps" (Postscript), "pdf" (PDF), and
40
"xml" (XML). Note that only documents of a single page can be
41
stored in Encapsulated Postscript format, as this format doesn't
42
support multi-page documents. Files saved with extension "xml"
43
are--obviously--XML files and contain no Postscript of PDF
44
information. The precise XML format used by Ipe is documented
45
<a href="manual_35.html">later in this manual</a>. XML files can be read by any
46
XML-aware parser, and it is easy for other programs to generate XML
47
output to be read by Ipe. You probably don't want to keep your
48
figures in XML format, but it is excellent for communicating with
49
other programs, and for converting figures between programs.
51
<p>There are perhaps two major uses for Ipe documents. The first is for
52
inclusion into Latex documents, the second is for making
53
presentations. There isn't much to be said about the second use: You
54
create a PDF file with Ipe, and either print it on transparencies or
55
present it using a laptop with Acrobat Reader. You should read the
56
section on <a href="manual_29.html">page views</a> if you
57
plan to make on-line presentations, as Ipe now allows you to create
58
pages that are displayed incrementally in Acrobat Reader.
59
<p>So let's concentrate on the first and original use of Ipe documents,
60
inclusion in Latex documents. Most Latex installations support the
61
inclusion of figures in Encapsulated Postscript (EPS) format (the
62
"Encapsulated" means that there is only a single Postscript page and
63
that it contains a bounding box of the figure).
64
<p>The standard way of including EPS figures is using the <code>graphicx</code>
65
package. If you are not familiar with it, here is a quick overview.
66
In the preamble of your document, add the declaration:
70
One useful attribute to this declaration is <code>draft</code>, which stops
71
LaTeX from actually including the figures--instead, a rectangle
72
with the figure filename is shown:
74
\usepackage[draft]{graphicx}
76
<p>To include the figure "figure1.eps", you use the command:
78
\includegraphics{figs/figure1}
80
Note that it is common <em>not</em> to specify the file extension
81
".eps". The command <code>\includegraphics</code> has various options to
82
scale and rotate the figure. For instance, to scale the same figure
85
\includegraphics[scale=0.5]{figs/figure1}
87
To scale such that the width of the figure becomes 5 cm:
89
\includegraphics[width=5cm]{figs/figure1}
91
Instead, one can specify the required height with <code>height</code>.
92
<p>Here is an example that scales a figure to 200% and rotates it by
93
45 degrees counter-clockwise. Note that the scale argument should be
94
given <em>before</em> the <code>angle</code> argument.
96
\includegraphics[scale=2,angle=45]{figs/figure1}
98
<p>Let's stress once again that these commands are the standard commands
99
for including EPS files in a LaTeX document. Unlike in previous
100
versions of Ipe, Ipe files neither require nor support any special
101
treatment.<sup><a href="manual_44.html#id1">1</a></sup> If you are used to other commands
102
for EPS inclusion, such as the old-fashioned <code>epsfig</code>
103
package,<sup><a href="manual_44.html#id2">2</a></sup>
104
you can use them as well for Ipe figures. If you want to know more
105
about the LaTeX packages for including graphics and producing
106
colour, check the <code>grfguide.tex</code> document that is probably
107
somewhere in your TeX installation.
109
<p>If you are a user of Pdflatex (a version of Latex that produces PDF
110
instead of DVI output), you cannot include EPS files. Instead, save
111
your Ipe figures in PDF format, and include them in the way described
113
<p>Unfortunately, versions of Pdflatex earlier than 1.10 have a problem
114
including PDF figures. Each page of a PDF document can carry several
115
"bounding boxes", such as the <em>MediaBox</em> (which indicates the
116
paper size), the <em>CropBox</em> (which indicates how the paper will by
117
cut), or the <em>ArtBox</em> (which indicates the extent of the actual
118
contents of the page). Ipe automatically saves, for each page, the
119
paper size in the <em>MediaBox</em>, and a bounding box for the drawing
120
in the <em>ArtBox</em>. Versions of Pdflatex earlier than 1.10,
121
however, look at the <em>CropBox</em>, or, if the <em>CropBox</em> is not
122
set, the <em>MediaBox</em>. To include PDF figures using an earlier
123
Pdflatex-version, you therefore have to instruct Ipe to include a
124
<em>CropBox</em> by ticking the <em>Use CropBox</em> checkbox in the
125
<em>Document properties</em> (in the <em>Edit</em> menu). (This is
126
currently the default for new documents. The only disadvantage is that
127
Acrobat Reader will not display full pages in documents saved with
128
this option, so when making PDF presentations you probably want to
130
<p>If you have Pdflatex 1.10 or higher, you can also solve the problem by
131
including this line in the preamble:
133
\expandafter\ifx\csname pdfoptionalwaysusepdfpagebox\endcsname\relax\else
134
\pdfoptionalwaysusepdfpagebox5
137
(Note that this will simply be ignored if you are using normal
138
LaTeX or an older version of Pdflatex.)
139
<p>You can save all your figures in both EPS and PDF format, so that you
140
can run both Latex and Pdflatex on your document--when including
141
figures, Latex will look for the EPS variant, while Pdflatex will look
142
for the PDF variant. (Here it comes in handy that you didn't specify
143
the file extension in the <code>\includegraphics</code> command.)
144
<p>You may find it cumbersome to save an Ipe figure in both formats each
145
time you modify it. If so, you can always save in, say, EPS format,
146
and automate the conversion to PDF by writing a shell script or batch
147
file that calls <a href="manual_3.html">ipetoipe</a> to do the conversion.
149
<p>On the other hand, if you <em>only</em> use Pdflatex, you might opt to
150
exploit a feature of Pdflatex: You can keep all the figures for a
151
document in a single, multi-page Ipe document, with one figure per
152
page. You can then include the figures one by one into your document
153
by using the <code>page</code> argument of <code>\includegraphics</code>.
154
<p>For example, to include page 3 from the PDF file "figures.pdf"
155
containing several figures, you could use
157
\includegraphics[page=3]{figs/figures}
160
<table width="100%" cellpadding=0 cellspacing=2><tr><td bgcolor="#99ccff"><a href="manual_3.html"><img border="0" alt="3 Command line options and auxiliary programs" 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_1.html"><img border="0" alt="1 Introduction" src="previous.png"></a></td><td align="center" bgcolor="#99ccff" width="100%"><b>2 About Ipe files</b></td></tr></table></body></html>