File: sec-style.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 (72 lines) | stat: -rw-r--r-- 8,629 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
<?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>Output Formatting Style</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="ref-dblatex.html" title="dblatex" /><link rel="next" href="sec-pub-output.html" title="Publishing Outputs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Output Formatting Style</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref-dblatex.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using dblatex</th><td width="20%" align="right"> <a accesskey="n" href="sec-pub-output.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-style"></a>Output Formatting Style</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="sec-style.html#idp853">How it works</a></span></dt><dt><span class="section"><a href="sec-style.html#idp895">Adding a New Formatting Style</a></span></dt></dl></div><p>The output rendering done by <span class="command"><strong>dblatex</strong></span> can be widely
customized like explained in <a class="xref" href="sec-custom.html" title="Chapter 4. Customization">Chapter 4, <em>Customization</em></a>. By default several
rendering styles are provided, that one can choose by using the option
<code class="option">-T</code> (see <a class="xref" href="sec-style.html#eg-style" title="Example 3.1. Choosing the DB2LaTeX style">Example 3.1, “Choosing the DB2LaTeX style”</a>). The available styles are:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">native</span></dt><dd><p>The rendering uses the default LaTeX stylesheets. It is the style used by
default if dblatex has been configured without using the option
<code class="option">--style</code>.</p></dd><dt><span class="term">simple</span></dt><dd><p>The rendering is very close to original latex rendering. The wrapper
around the default latex packages is very thin.</p></dd><dt><span class="term">db2latex</span></dt><dd><p>The rendering tries to be as close as possible to the
<a class="ulink" href="http://db2latex.sourceforge.net" target="_top">DB2LaTeX</a> formatting.</p></dd></dl></div><div class="example"><a id="eg-style"></a><p class="title"><strong>Example 3.1. Choosing the DB2LaTeX style</strong></p><div class="example-contents"><pre class="programlisting">
dblatex -T db2latex file.xml
</pre></div></div><br class="example-break" /><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idp853"></a>How it works</h3></div></div></div><p>The rendering style stuff is under the <code class="filename">latex/</code>
directory. You can see the XSL stylesheets under <code class="filename">xsl/</code>
as the way to produce latex with as little as possible docbook specific things
(even if a large amount of latex packages are used to do the work). Then, it's
up to LaTeX stylesheets to format the document as you wish.</p><p>The organization under <code class="filename">latex/</code> is as follow:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">contrib</code></span></dt><dd><p>Contains the non-default available LaTeX stylesheets (simple and db2latex).
</p></dd><dt><span class="term"><code class="filename">graphics</code></span></dt><dd><p>Default graphics used in the admonitions (e.g. <code class="sgmltag-element">warning</code>).
These graphics are used by the default output formatting.
</p></dd><dt><span class="term"><code class="filename">scripts</code></span></dt><dd><p>Scripts used to compile with <span class="command"><strong>latex</strong></span> or
<span class="command"><strong>pdflatex</strong></span>.
</p></dd><dt><span class="term"><code class="filename">specs</code></span></dt><dd><p>Contains all the configuration files describing the available styles.
A specification file must have the extension .specs, .conf, or .xml to be
detected as a style description, and its basename is the name of the style.
For example the style db2latex is described by the configuration file
<code class="filename">db2latex.xml</code>.
</p><p>When <span class="command"><strong>dblatex</strong></span> is executed with no parameter, the usage
is displayed. In particular, the list of the available styles is given, like
this:
</p><pre class="programlisting">
$ dblatex
dblatex [options] file.{sgml|xml}
Options:
-t {pdf|ps|dvi|tex|xml}: output format
...
-T style               : available latex styles (db2latex, native, simple)
</pre><p>
The list is built by scanning the specs files found under
<code class="filename">specs/</code>. The spec file syntax is described in <a class="xref" href="sec-specs.html" title="Dblatex Configuration File">the section called “Dblatex Configuration File”</a>.
</p></dd><dt><span class="term"><code class="filename">style</code></span></dt><dd><p>Default LaTeX stylesheets.</p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idp895"></a>Adding a New Formatting Style</h3></div></div></div><p>To add a new formatting style, do the following steps:</p><div class="procedure"><ol class="procedure" type="1"><li class="step"><p>Let's create the style directories that will contain all the
specific data. We choose to put them under the default
<span class="command"><strong>dblatex</strong></span> user configuration directory.</p><pre class="programlisting">
$ mkdir -p $HOME/.dblatex/mystyle/latex
$ mkdir -p $HOME/.dblatex/mystyle/xsl
</pre><p>Note that you could choose another configuration directory (see <a class="xref" href="sec-specs.html#sec-conf-path" title="Style Paths">the section called “Style Paths”</a> for more details).</p></li><li class="step"><p>Create the latex stylesheets you need. It must define the expected
DocBook interface and include some core definitions from the default latex
stylesheets (cf. <a class="xref" href="sec-custom-latex.html" title="Customized LaTeX style">the section called “Customized LaTeX style”</a>). Create also your XSL
stylesheet if necessary.</p></li><li class="step"><p>Put these files under the appropriate directories:</p><pre class="programlisting">
$ mv mytexstyle.sty $HOME/.dblatex/mystyle/latex/.
$ mv param.xsl $HOME/.dblatex/mystyle/xsl/.
</pre></li><li class="step"><p>Create a configuration file under the directory
<code class="filename">$HOME/.dblatex</code>. The configuration file must point to the
new latex stylesheet, and give the specific parameters. Example:</p><pre class="programlisting">
$ cat $HOME/.dblatex/mystyle.conf
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- =======================================================
     Dblatex config file for my new style.
     Note that the directories are relative to mystyle.conf
     ======================================================= --&gt;
&lt;config xmlns="http://dblatex.sourceforge.net/config"&gt;
  &lt;latex&gt;
    &lt;texinputs&gt;mystyle/latex//&lt;/texinputs&gt;
    &lt;texstyle use="mytexstyle"/&gt;
  &lt;/latex&gt;
  &lt;xslt&gt;
    &lt;stylesheet fileref="mystyle/xsl/param.xsl"/&gt;
  &lt;/xslt&gt;
  &lt;options&gt;-f fig&lt;/options&gt;
&lt;/config&gt;
</pre></li><li class="step"><p>That's it. Try to compile your document with your style, and check
the output. The configuration file basename is the name of the style to
call.</p><pre class="programlisting">
$ dblatex -T mystyle file.xml
</pre></li></ol></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref-dblatex.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-pub-output.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">dblatex </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Publishing Outputs</td></tr></table></div></body></html>