For a general overview of what markup is all about, please read Chapter 5, Markup
An editor capable of inserting elements according to the DTD will help a lot since it will enforce the DTD. This way you can be sure that no invalid elements were added anywhere in your document.
In order to ensure that future changes are as easy as possible, authors should try to keep compatibility with the XML version of the DocBook DTD. This means keeping element names in lower case, using double quotes in all attributes, and not omitting end tags. Most tools that automatically insert elements (like psgml+emacs) follow these rules automatically or with some fine tuning.
Each type of document created has a specific structure. This document is in “book” format. Most authors, however, will want to use the shorter “article” format instead. Templates are available from Appendix A, Templates.
Table D.1, “Useful markup” shows some markup that is useful for generating generic documents. Remember that some elements are valid only on some contexts.
Sometimes the appearance of a particular tag changes from one conversion format to another. As a beginner in DocBook writing, you may wish to see how your document looks in several formats before you publish them. You are advised to look at how your document is presented in HTML, PDF and PostScript, since these formats will be made available by TLDP once you publish your document.
Since the formatting depends on the output style chosen, it's recommended to use as much markup as possible. Even if the appearance of the output doesn't seem to change with the standard output style, there may be specific output formats that will make these tags stand out.
Table D.1. Useful markup
Description | Sample markup | Result | ||||||
---|---|---|---|---|---|---|---|---|
E-mail address | <email> address@domain</email> | <address@domain> | ||||||
About the author | <author> ...</author> | (see example below) | ||||||
Author's name |
| |||||||
Keys' name (printings on the keyboard) | <keycap> F1</keycap> | F1 | ||||||
Symbol represented by the keys | <keysym> KEY_F1</keysym> | KEY_F1 | ||||||
Key's code | <keycode> 0x3B</keycode> | 0x3B | ||||||
Combinations or sequences of keys |
| Ctrl+S | ||||||
Program Menus | <guimenu> File</guimenu> | |||||||
Menu Items | <guimenuitem> Save</guimenuitem> | |||||||
Menu Sequences |
| Ctrl+S) | → (||||||
Mouse Button | <mousebutton> left</mousebutton> | |||||||
Application Names | <application> application</application> | application | ||||||
Text Bibliographical Reference | <citation> reference</citation> | [reference] | ||||||
Quote |
|
| ||||||
Index | (NA) | See Section 4, “Encoding Indexes”. | ||||||
File Names |
| file | ||||||
Directories |
| directory/ | ||||||
Emphasize Text[a] |
| text | ||||||
Footnotes |
| (See note at the end of this table for an example) | ||||||
URLs |
| Conectiva S.A. | ||||||
Itemized (unnumbered) List |
|
| ||||||
Ordered (numbered) List |
|
| ||||||
Segmented List |
| Binary to Decimal Conversion Binary: 00 Decimal: 0 Binary: 01 Decimal: 1 Binary: 10 Decimal: 2 | ||||||
Variable List |
|
| ||||||
Simple Lists |
|
| ||||||
Pictures | (NA) | See Section 5, “Inserting Pictures” | ||||||
Glossary |
| (See the glossary at the end of this document) | ||||||
Crossed References |
| (NA) | ||||||
[a] Text can be emphasized in a few ways. The most common ways are italics and bold. DocBook, however, supports only italics. The use of bold requires additional settings on the style sheet used. |