Chapter 5. Tips and examples

Table of Contents

Images
Program listings
HTML stylesheets
The euro character
Creating an index
Please send me examples

This document is an example of a book, and a book generally contains chapters, which may contain sections. A paragraph of text can be put in a para tag. There are lots of examples of that in this book (see Appendix A, DocBook XML source).

When you want text to appear with its layout intact (spaces and newlines kept where they are), you can use the literallayout tag. Note that Tab characters are not expanded. If you also would like a different font for the listed text, you might want to use the programlisting tag.

Images

This shows how to handle images for both print and web display; each format is included in one mediaobject so the stylesheet, when faced with a limited subset of formats for the current output media, can select the best fit.

I have cheated slightly, in that the for-print version is using a PDF format image even though PDF is not an officially allowed format in this version of DocBook XML. Luckily though, the tools I am using allow it through anyway.