For my second assignment I had to convert my Bachelor’s Project Report from LaTeX to DocBook.
How I did it
Here are a few examples of how certain formatting and referencing is done in DocBook (version 4.3).
Chapters and Sections
To separate different chapter and sections in DocBook you use indentically named tags <chapter>
and <section>
.
Each of those sections can also have a title, marked by a similarly named <title>
tag. Each paragraphs of a section
should be marked with <para>
tag. An example of a structured file could look like this:
|
|
Inserting Pictures or Figures
Here’s an example of an inserted picture:
|
|
Here the most important parts are the fileref
arg, which contains the address of the picture, and the <textobject>
tag
allowing us to caption the image.
Cross-referencing
To reference something in DocBook, you need to mark it using an id
args. The actual referencing is then done using either
<link>
or <xref/>
tags, which contain linkend
args pointing to the id
of the referenced item. The difference is that
<xref/>
automatically generates the reference text and <link>
just makes its content point to the target. Here’s an example:
|
|
Bibliography and citations
Bibliography is a list of multiple <biblioentry>
or <bibliomixed>
objects placed in one < bibliography>
object, which can have a <title>
.
Citations are done the same way as cross-references, using a <xref/>
, which points to an id in the entry.
Auto-generated content
Index
To index a term, add an <indexterm>
on its page. To generate the index, place an <index/>
tag in the desired location.
Here’s an example:
|
|
Table of Content/Figures
.xsl
to generate ToC/ToF:
|
|