Next Previous Contents

3. Some examples

Here are examples of things that you'll be using in the source. First, let's decend into a subsection:

3.1 This is a subsection

As the header says. Note that you need to use the p command to start the body of the section, after the sect1 command. Here's a subsubsection:

This is a subsubsection

Right. 5 levels of sections are available. Use the commands sect, sect1, sect2, sect3, and sect4 to get them. This document uses the article document style, which is appropriate for HOWTOs and other docs; the report style (which includes the chapt sectioning command) should be used for the LDP docs.

3.2 Example text

All right, so you're typing along, and you want to show some example code, or example I/O with a program, whatever. Use the code or verb ``environments'' for this, wrapped in a tscreen environment, as so:

This is an example verb environment.
As well as:

This is an example code environment.

The tscreen environment just sets the font to small type and indents it nicely. It's not required for using verb or code, but I suggest that you do.

The Linuxdoc-SGML User's Guide explains what special characters you can and can't use in the verb and code environments.

3.3 Cross references

What about cross-references? This section has been marked with the label command; using ref will provide a cross reference, as in ``See Section test-ref '' for more.

Right now cross-references don't work in the groff translation for plain ASCII. They do work when generating LaTeX or HTML output.

3.4 Using fonts

You want fonts, we got fonts. Of course these won't show up in the plain ASCII text, but they all map into the various output formats: boldface, emphasis, sans serif, slanted, typewriter, and italics.

3.5 Lists

Lists are easy as well. Just use the itemize element with the item commands, seen here:

This is just about everything that you need to get started with writing SGML docs using the linuxdoc-sgml DTD. Please let me know if you think something should be changed or added to this document.


Next Previous Contents