| 1 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 |
<!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 |
| 3 |
customized like explained in <a class="xref" href="sec-custom.html" title="Chapter 4. Customization">Chapter 4, <em>Customization</em></a>. By default several |
| 4 |
rendering styles are provided, that one can choose by using the option |
| 5 |
<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 |
| 6 |
default if dblatex has been configured without using the option |
| 7 |
<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 |
| 8 |
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 |
| 9 |
<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"> |
| 10 |
dblatex -T db2latex file.xml |
| 11 |
</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> |
| 12 |
directory. You can see the XSL stylesheets under <code class="filename">xsl/</code> |
| 13 |
as the way to produce latex with as little as possible docbook specific things |
| 14 |
(even if a large amount of latex packages are used to do the work). Then, it's |
| 15 |
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). |
| 16 |
</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>). |
| 17 |
These graphics are used by the default output formatting. |
| 18 |
</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 |
| 19 |
<span class="command"><strong>pdflatex</strong></span>. |
| 20 |
</p></dd><dt><span class="term"><code class="filename">specs</code></span></dt><dd><p>Contains all the configuration files describing the available styles. |
| 21 |
A specification file must have the extension .specs, .conf, or .xml to be |
| 22 |
detected as a style description, and its basename is the name of the style. |
| 23 |
For example the style db2latex is described by the configuration file |
| 24 |
<code class="filename">db2latex.xml</code>. |
| 25 |
</p><p>When <span class="command"><strong>dblatex</strong></span> is executed with no parameter, the usage |
| 26 |
is displayed. In particular, the list of the available styles is given, like |
| 27 |
this: |
| 28 |
</p><pre class="programlisting"> |
| 29 |
$ dblatex |
| 30 |
dblatex [options] file.{sgml|xml} |
| 31 |
Options: |
| 32 |
-t {pdf|ps|dvi|tex|xml}: output format |
| 33 |
... |
| 34 |
-T style : available latex styles (db2latex, native, simple) |
| 35 |
</pre><p> |
| 36 |
The list is built by scanning the specs files found under |
| 37 |
<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>. |
| 38 |
</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 |
| 39 |
specific data. We choose to put them under the default |
| 40 |
<span class="command"><strong>dblatex</strong></span> user configuration directory.</p><pre class="programlisting"> |
| 41 |
$ mkdir -p $HOME/.dblatex/mystyle/latex |
| 42 |
$ mkdir -p $HOME/.dblatex/mystyle/xsl |
| 43 |
</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 |
| 44 |
DocBook interface and include some core definitions from the default latex |
| 45 |
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 |
| 46 |
stylesheet if necessary.</p></li><li class="step"><p>Put these files under the appropriate directories:</p><pre class="programlisting"> |
| 47 |
$ mv mytexstyle.sty $HOME/.dblatex/mystyle/latex/. |
| 48 |
$ mv param.xsl $HOME/.dblatex/mystyle/xsl/. |
| 49 |
</pre></li><li class="step"><p>Create a configuration file under the directory |
| 50 |
<code class="filename">$HOME/.dblatex</code>. The configuration file must point to the |
| 51 |
new latex stylesheet, and give the specific parameters. Example:</p><pre class="programlisting"> |
| 52 |
$ cat $HOME/.dblatex/mystyle.conf |
| 53 |
<?xml version="1.0" encoding="utf-8"?> |
| 54 |
<!-- ======================================================= |
| 55 |
Dblatex config file for my new style. |
| 56 |
Note that the directories are relative to mystyle.conf |
| 57 |
======================================================= --> |
| 58 |
<config xmlns="http://dblatex.sourceforge.net/config"> |
| 59 |
<latex> |
| 60 |
<texinputs>mystyle/latex//</texinputs> |
| 61 |
<texstyle use="mytexstyle"/> |
| 62 |
</latex> |
| 63 |
<xslt> |
| 64 |
<stylesheet fileref="mystyle/xsl/param.xsl"/> |
| 65 |
</xslt> |
| 66 |
<options>-f fig</options> |
| 67 |
</config> |
| 68 |
</pre></li><li class="step"><p>That's it. Try to compile your document with your style, and check |
| 69 |
the output. The configuration file basename is the name of the style to |
| 70 |
call.</p><pre class="programlisting"> |
| 71 |
$ dblatex -T mystyle file.xml |
| 72 |
</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> |