Suggestions
Search:

QuickStart Using DB2LaTeX

In order to make it easier the use of the XSL stylesheets for LaTeX, starting from version 0.5.0.1 there exists the possibility of overriding most of the XSL options and to completely specify the LaTeX preamble. This option, “Quick Start”, allows an out-of-the box use of the stylesheets and virtually everything can be done.

Assume you do not want to spend several minutes trying to understand how things work. Assume you do not want to learn how to override XSL templates and variables. Assume you just want to use the LaTeX XSL stylesheets as easy and fast as possible.

Creating your XML document

Create a source document using your favourite editor (it's vim, right?).

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE article SYSTEM "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<article id="ArticleId" lang="en">
<articleinfo>
<title> A short introduction to the XSL LaTeX Stylesheets in the framework of the DocBook DTD. </title>
<authorgroup>
        <author> <surname>Casellas</surname> <firstname>Ramon</firstname> </author>
        <corpauthor>Ecole Nationale Superieure des Telecommunications</corpauthor>
</authorgroup>
</articleinfo>

<abstract><para> Most articles start with a nice abstract, which is usually left for 
the very last moment, and consists of several short sentences cut and
pasted basically from the introduction.  </para></abstract>

<sect1><title>Introduction</title>
<para> This paper.... the purpose of this work... highlights...
Extensive simulations.... Numerical Results ...
</para>
</sect1>

<sect1><title> Mathematical Model</title>
<para> The model proposed is as follows ... most ... simplicity...
analytical....
</para>
</sect1>

<sect1><title>Numerical Results</title>
<para> To illustrate the main purpose of this paper ... </para>
</sect1>

<sect1><title>Conclusion and future work</title>
<para>This paper has given an insight ... </para>
</sect1>

<bibliography><title>Bibliographie</title>
<biblioentry id="PimPum" xreflabel="PimPum">
<abbrev>PimPum</abbrev>
        <title>" Pim Pam Pum"</title>
        <authorgroup>
                <author><firstname>James</firstname><surname>Pim</surname></author>
                <author><firstname>Robert</firstname><surname>Pum</surname></author>
        </authorgroup>
        <publisher>
                <publishername>Get a Life International Editions. ISBN 0-XS-xsxs-1</publishername>
        </publisher>
        <pubdate>2001</pubdate>
</biblioentry>

</bibliography>
</article>

Specify the preamble you would like to use

You will need to create a "driver" file (an XSL stylesheet) that contains your preamble. This is your "customization layer" (see also the customization guide).

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>

<xsl:import href="http://db2latex.sourceforge.net/xsl/docbook.xsl"/>

<xsl:variable name="latex.override">
% -----------------------  Define your Preamble Here 
\documentclass[english,a4]{article}
\usepackage{amsmath,amsthm, amsfonts, amssymb, amsxtra,amsopn}
\usepackage{graphicx}
\usepackage{float}
\usepackage{times}
\usepackage{algorithmic}
\usepackage[dvips]{hyperref}
\DeclareGraphicsExtensions{.eps}
% ------------------------  End of you preamble.
</xsl:variable>
</xsl:stylesheet>
[Note] Note

Completely overriding the DB2LaTeX default preamble is not suggested, and should be done with extreme care since some package dependencies may not be respected. You should consider using the defined XSL variables and parameters.

Process your DocBook source file

The next step is to process your DocBook source file using your favourite XSLT processor (Xalan, xsltproc, saxon,...), and either the default DB2LaTeX XSL stylesheets or your customization layer. See the documentation on your XSLT processor for details. For xsltproc:

xsltproc -o mysb2latex.tex mydb2latex.xsl mydb2latex.xml

The resulting file should look like:

% ----------------------- Preamble
\documentclass[english,a4]{article}
\usepackage{amsmath,amsthm, amsfonts, amssymb, amsxtra,amsopn}
\usepackage{graphicx}
\usepackage{float}
\usepackage{times}
\usepackage{algorithmic}
\usepackage[dvips]{hyperref}
\DeclareGraphicsExtensions{.eps}
\title{A short introduction to the XSL LaTeX Stylesheets in the framework of the DocBook DTD.}
\author{Ramon Casellas}
\begin{document}

\maketitle

% --------------------------------------------
% Abstract
% --------------------------------------------
\begin{abstract}

Most articles start with a nice abstract, which is usually left for
the very last moment, and consists of several short sentences cut and
pasted basically from the introduction.

\end{abstract}

\section{Introduction}
\label{N2624}\hypertarget{N2624}{}

 This paper.... the purpose of this work... highlights...
Extensive simulations.... Numerical Results ...


\section{Mathematical Model}
\label{N2629}\hypertarget{N2629}{}

 The model proposed is as follows ... most ... simplicity...
analytical....


\section{Numerical Results}
\label{N2634}\hypertarget{N2634}{}

 To illustrate the main purpose of this paper ...

\section{Conclusion and future work}
\label{N2639}\hypertarget{N2639}{}

This paper has given an insight ...

% -------------------------------------------
%
%  Bibliography
%
% -------------------------------------------
\bibliography{''}
\begin{thebibliography}{WIDELABEL}

% -------------- biblioentry
\bibitem[PimPum]{PimPum}
James Pim and Robert Pum, \emph{" Pim Pam Pum", } Get a Life International Editions. ISBN 0-XS-xsxs-1, 2001, .
\label{PimPum}\hypertarget{PimPum}{}

\end{thebibliography}

% --------------------------------------------
% End of document
% --------------------------------------------
\end{document}