1
1
<?xml version="1.0" encoding="iso-8859-1"?>
2
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
2
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3
3
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
4
<sect1 id="sec-style"><title>Output Formatting Style</title>
4
<section id="sec-style"><title>Output Formatting Style</title>
5
5
<para>The output rendering done by <command>dblatex</command> can be widely
6
6
customized like explained in <xref linkend="sec-custom"/>. By default several
7
7
rendering styles are provided, that one can choose by using the option
95
<sect2><title>Adding a New Formatting Style</title>
95
<section><title>Adding a New Formatting Style</title>
96
96
<para>To add a new formatting style, do the following steps:</para>
98
<step><para>Let's create the style directores that will contain all the specific
99
data. We choose to put them under the default <command>dblatex</command>
100
user configuration directory.</para>
101
<programlisting><![CDATA[
102
$ mkdir -p $HOME/.dblatex/mystyle/latex
103
$ mkdir -p $HOME/.dblatex/mystyle/xsl
105
<para>Note that you could choose another configuration directory (see <xref
106
linkend="sec-conf-path"/> for more details).</para>
98
108
<step><para>Create the latex stylesheets you need. It must define the expected DocBook
99
109
interface and include some core definitions from the default latex
100
stylesheets (cf. <xref linkend="sec-custom-latex"/>).</para></step>
101
<step><para>Put the latex stylesheets under a directory located under
102
<filename>contrib/</filename>.</para>
110
stylesheets (cf. <xref linkend="sec-custom-latex"/>). Create also your XSL
111
stylesheet if necessary.</para></step>
112
<step><para>Put these files under the appropriate directories:</para>
103
113
<programlisting><![CDATA[
104
$ mkdir latex/contrib/mystyle
105
$ mv mytexstyle.sty latex/contrib/mystyle
114
$ mv mytexstyle.sty $HOME/.dblatex/mystyle/latex/.
115
$ mv param.xsl $HOME/.dblatex/mystyle/xsl/.
106
116
]]></programlisting>
108
<step><para>If needed, create an XSL parameter file (e.g.
109
<filename>param.xsl</filename>) that tunes the XSL production, and
110
put it under <filename>mystyle/</filename>.
112
<step><para>Create a specification file under the directory
113
<filename>specs/</filename>. The specification file must point to the new latex
114
stylesheet, and give the specific parameters. Example:</para>
118
<step><para>Create a configuration file under the directory
119
<filename>$HOME/.dblatex</filename>. The specification file must point to the new
120
latex stylesheet, and give the specific parameters. Example:</para>
115
121
<programlisting><![CDATA[
116
$ cat latex/specs/mystyle.specs
118
# Dblatex spec file for my new style
120
TexInputs: ../contrib/mystyle//
122
$ cat $HOME/.dblatex/mystyle.conf
124
# Dblatex config file for my new style.
125
# Note that the directories are relative to mystyle.conf
127
TexInputs: mystyle/latex//
121
128
TexStyle: mytexstyle
122
XslParam: ../contrib/mystyle/param.xsl
129
XslParam: mystyle/param.xsl
124
131
]]></programlisting>
126
133
<step><para>That's it. Try to compile your document with your style, and check the