Suggestions
Search:
 

Custom Mappings

Introduction

You can modify the ‘beginnings’ and ‘ends’ of some templates through the DB2LaTeXmapping’ system. This is commonly used to commence and environment or section-type component. The steps to do this are the following:

  1. Create an XML file that contains your mappings. This is called your ‘mapping file’.

  2. Override an XSL parameter in your driver file so that your mapping file can be found.

  3. Process your DocBook source document with your favourite XSL processor.

The availability of mappings is indicated in Chapter 1 of the Reference and may be found in latex.mapping.xml.

Create an XML file that contains your mappings

Create a text file, e.g. mydb2latex.map, like this:

<?xml version='1.0'?>
<!DOCTYPE latexbindings SYSTEM "http://db2latex.sourceforge.net/xsl/latex.mapping.dtd">
<latexbindings>
  <latexmapping role="begin">
    <mapping key="glossary" text="">
      <line>\section{%title}&#10;</line>
    </mapping>
  </latexmapping>
  <latexmapping role="end">
    <mapping key="glossary" text="\hrulefill &#10;"/>
  </latexmapping>
</latexbindings>

Configure your driver file

DB2LaTeX lets you specify your mappings via the latex.mapping.xml parameter:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
  <xsl:import href="http://db2latex.souceforge.net/xsl/docbook.xsl"/>
  <xsl:param name="latex.mapping.xml" select="document('mydb2latex.map')"/>
</xsl:stylesheet>

Further LaTeX Customization

A large number of customizations are possible if you have some knowledge of LaTeX. For example, you could change the way chapter headings are formatted. You may wish to refer to our LaTeX guide: