File: sec-figinclude.html

package info (click to toggle)
dblatex 0.3.12py3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,684 kB
  • sloc: xml: 102,889; python: 8,259; makefile: 119; sh: 48
file content (86 lines) | stat: -rw-r--r-- 7,010 bytes parent folder | download | duplicates (3)
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Figure Inclusion</title><link rel="stylesheet" type="text/css" href="manual.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="home" href="index.html" title="DocBook to LaTeX Publishing" /><link rel="up" href="ch03.html" title="Chapter 3. Using dblatex" /><link rel="prev" href="sec-section-num.html" title="Chapter and Section numbering" /><link rel="next" href="sec-table.html" title="Creating Tables" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
   Figure Inclusion
  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-section-num.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using dblatex</th><td width="20%" align="right"> <a accesskey="n" href="sec-table.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-figinclude"></a>
   Figure Inclusion
  </h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="sec-figinclude.html#idp1044">
    Presentation
   </a></span></dt><dt><span class="section"><a href="sec-figinclude.html#sec-figconv">
    Converting on the fly
   </a></span></dt><dt><span class="section"><a href="sec-figinclude.html#sec-lookup">
    Paths Lookup
   </a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idp1044"></a>
    Presentation
   </h3></div></div></div><p>
    The expected format of the included figures depends on the backend driver used:
   </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
    dvips:
</span></dt><dd><p>EPS format is required.
    </p></dd><dt><span class="term">
    pdftex:
</span></dt><dd><p>PDF or PNG format is required.
    </p></dd></dl></div><p>
    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.
   </p><p>
    The figures must either already exists in the expected format, or must be able to be converted on the fly.
   </p><div class="example"><a id="idp1058"></a><p class="title"><strong>Example 3.4. Figure inclusion</strong></p><div class="example-contents"><pre class="programlisting">
&lt;figure id="fig-exemple1"&gt; 
  &lt;title&gt;Components&lt;/title&gt; 
  &lt;mediaobject&gt;
    &lt;imageobject&gt; 
      &lt;imagedata fileref="path/figure1" align="center" scale="70"&gt; 
    &lt;/imageobject&gt; 
  &lt;/mediaobject&gt;
&lt;/figure&gt;
   </pre></div></div><br class="example-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="sec-figconv"></a>
    Converting on the fly
   </h3></div></div></div><p>When it is needed dblatex tries to automatically convert the figures to
   the expected format (i.e. EPS or PDF). The principle is to detect the original
   figure format from the suffix of the fileref attribute. If no suffix is given,
   the tool checks if a file whose basename is conformant with the
   fileref attribute and with one of the predefined suffixes exists (that is, ".eps",
   ".fig", ".pdf", or ".png"). If such a file exists, conversion is done from the
   original format found.
   </p><p>
    The option <code class="option">-f <em class="replaceable"><code>fig_format</code></em></code> allows to specify the default included figures format (<em class="replaceable"><code>fig_format</code></em>), 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.
   </p><p>
    If the specified format is unknown, no conversion is done. The supported formats are:
   </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
    fig:
</span></dt><dd><p>native format of the figures produced by XFig.
    </p></dd><dt><span class="term">
    eps:
</span></dt><dd><p>Encapsulated PostScript format. This format shall be specified only when using the pdftex backend.
    </p></dd></dl></div><div class="example"><a id="idp1078"></a><p class="title"><strong>Example 3.5. Figure conversion</strong></p><div class="example-contents"><p>
    The following command compiles a document that contains figures produced with XFig.
   </p><pre class="programlisting">
% dblatex -f fig mydoc.sgml
   </pre></div></div><br class="example-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="sec-lookup"></a>
    Paths Lookup
   </h3></div></div></div><p>
    You can use and cumulate the option <code class="option">-I <em class="replaceable"><code>path</code></em></code> to specify where the figures are. The given paths can be absolute or relative.
    The paths are added to the document root path.
   </p><div class="example"><a id="idp1087"></a><p class="title"><strong>Example 3.6. Figures lookup</strong></p><div class="example-contents"><p>
    This example shows how figure lookup is done. Let's consider this document source:
   </p><pre class="programlisting">
&lt;figure id="fig-example1"&gt; 
  &lt;title&gt;Composants&lt;/title&gt; 
  &lt;mediaobject&gt;
    &lt;imageobject&gt; 
      &lt;imagedata fileref="rep1/rep2/figure1" align="center" scale="70"&gt; 
    &lt;/imageobject&gt; 
  &lt;/mediaobject&gt;
&lt;/figure&gt;
   </pre><p>
    And the document is compiled like this:
   </p><pre class="programlisting">
% dblatex -I /another/path -I /last/case /initial/path/document.sgml
   </pre><p>
    The figure1 lookup is done in the following directories, in respect of the order:
   </p><div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: disc; "><li class="listitem"><p>
    <code class="filename">/initial/path/rep1/rep2</code> ;
    </p></li><li class="listitem"><p>
    <code class="filename">/another/path/rep1/rep2</code> ;
    </p></li><li class="listitem"><p>
    <code class="filename">/last/case/rep1/rep2</code>.
    </p></li></ul></div></div></div><br class="example-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-section-num.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sec-table.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter and Section numbering </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Creating Tables</td></tr></table></div></body></html>