~ubuntu-branches/ubuntu/lucid/dblatex/lucid

« back to all changes in this revision

Viewing changes to docs/figure.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Hoenen
  • Date: 2006-05-15 19:59:06 UTC
  • Revision ID: james.westby@ubuntu.com-20060515195906-jg9x08tsfbi35m2x
Tags: upstream-0.1.9
ImportĀ upstreamĀ versionĀ 0.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
  <sect1 id="sec-figinclude">
 
2
   <title>
 
3
   Figure Inclusion
 
4
  </title>
 
5
   <sect2>
 
6
    <title>
 
7
    Presentation
 
8
   </title>
 
9
   <para>
 
10
    The expected format of the included figures depends on the backend driver used:
 
11
   </para>
 
12
   <variablelist>
 
13
    <varlistentry>
 
14
    <term>
 
15
    dvips:
 
16
</term><listitem><para>EPS format is required.
 
17
    </para>
 
18
   </listitem>
 
19
   </varlistentry>
 
20
    <varlistentry>
 
21
    <term>
 
22
    pdftex:
 
23
</term><listitem><para>PDF or PNG format is required.
 
24
    </para>
 
25
   </listitem>
 
26
   </varlistentry>
 
27
   </variablelist>
 
28
   <para>
 
29
    In order to be able to use both backends, it is wise to not write the suffix of the file that references the figure. The suffix will be deduced from the backend used.
 
30
   </para>
 
31
   <para>
 
32
    The figures must either already exists in the expected format, or must be able to be converted on the fly.
 
33
   </para>
 
34
<example><title>Figure inclusion</title>
 
35
   <programlisting>
 
36
<![CDATA[<figure id="fig-exemple1"> 
 
37
]]><![CDATA[  <title>Components</title> 
 
38
]]><![CDATA[  <mediaobject>
 
39
]]><![CDATA[    <imageobject> 
 
40
]]><![CDATA[      <imagedata fileref="path/figure1" align="center" scale="70"> 
 
41
]]><![CDATA[    </imageobject> 
 
42
]]><![CDATA[  </mediaobject>
 
43
]]><![CDATA[</figure>
 
44
]]>   </programlisting>
 
45
</example>
 
46
   </sect2>
 
47
   <sect2 id="sec-figconv">
 
48
    <title>
 
49
    Converting on the fly
 
50
   </title>
 
51
   <para>When it is needed dblatex tries to automatically convert the figures to
 
52
   the expected format (i.e. EPS or PDF). The principle is to detect the original
 
53
   figure format from the suffix of the fileref attribute. If no suffix is given,
 
54
   the tool checks if a file whose basename is conformant with the
 
55
   fileref attribute and with one of the predefined suffixes exists (that is, ".eps",
 
56
   ".fig", ".pdf", or ".png"). If such a file exists, conversion is done from the
 
57
   original format found.
 
58
   </para>
 
59
   <para>
 
60
    The option <option>-f <replaceable>fig_format</replaceable></option> allows to specify the default included figures format (<replaceable>fig_format</replaceable>), that will be used when automatic format scanning gives no result. Then, the tool converts the figures from the specified format to the expected one.
 
61
   </para>
 
62
   <para>
 
63
    If the specified format is unknown, no conversion is done. The supported formats are:
 
64
   </para>
 
65
   <variablelist>
 
66
    <varlistentry>
 
67
    <term>
 
68
    fig:
 
69
</term><listitem><para>native format of the figures produced by XFig.
 
70
    </para>
 
71
   </listitem>
 
72
   </varlistentry>
 
73
    <varlistentry>
 
74
    <term>
 
75
    eps:
 
76
</term><listitem><para>Encapsulated PostScript format. This format shall be specified only when using the pdftex backend.
 
77
    </para>
 
78
   </listitem>
 
79
   </varlistentry>
 
80
   </variablelist>
 
81
<example><title>Figure conversion</title>
 
82
   <para>
 
83
    The following command compiles a document that contains figures produced with XFig.
 
84
   </para>
 
85
   <programlisting>
 
86
<![CDATA[% dblatex -f fig mydoc.sgml
 
87
]]>   </programlisting>
 
88
</example>
 
89
   </sect2>
 
90
   <sect2 id="sec-lookup">
 
91
    <title>
 
92
    Paths Lookup
 
93
   </title>
 
94
   <para>
 
95
    You can use the option <option>-I "<replaceable>path1</replaceable> <replaceable>path2</replaceable> ..."</option> to specify where the figures are. The given paths must be absolute. The paths are added to the doculent root path.
 
96
   </para>
 
97
<example><title>Figures lookup</title>
 
98
   <para>
 
99
    This example shows how figure lookup is done. Let's consider this document source:
 
100
   </para>
 
101
   <programlisting>
 
102
<![CDATA[<figure id="fig-example1"> 
 
103
]]><![CDATA[  <title>Composants</title> 
 
104
]]><![CDATA[  <mediaobject>
 
105
]]><![CDATA[    <imageobject> 
 
106
]]><![CDATA[      <imagedata fileref="rep1/rep2/figure1" align="center" scale="70"> 
 
107
]]><![CDATA[    </imageobject> 
 
108
]]><![CDATA[  </mediaobject>
 
109
]]><![CDATA[</figure>
 
110
]]>   </programlisting>
 
111
   <para>
 
112
    And the document is compiled like this:
 
113
   </para>
 
114
   <programlisting>
 
115
<![CDATA[% dblatex -I "/another/path /last/case" /initial/path/document.sgml
 
116
]]>   </programlisting>
 
117
   <para>
 
118
    The figure1 lookup is done in the following directories, in respect of the order:
 
119
   </para>
 
120
   <itemizedlist>
 
121
    <listitem>
 
122
    <para>
 
123
    <filename>/initial/path/rep1/rep2</filename> ;
 
124
    </para>
 
125
   </listitem>
 
126
    <listitem>
 
127
    <para>
 
128
    <filename>/another/path/rep1/rep2</filename> ;
 
129
    </para>
 
130
   </listitem>
 
131
    <listitem>
 
132
    <para>
 
133
    <filename>/last/case/rep1/rep2</filename>.
 
134
    </para>
 
135
   </listitem>
 
136
   </itemizedlist>
 
137
</example>
 
138
   </sect2>
 
139
  </sect1>