For the most part, writing documents using LinuxDoc-Tools is very
simple, and rather like writing HTML. However, there are some caveats to
watch out for. In this section we'll give an introduction on writing
SGML documents. See the file example.sgml
for a SGML example
document (and tutorial) which you can use as a model when writing your
own documents. Here we're just going to discuss the various features
of LinuxDoc-Tools, but the source is not very readable as an example. Instead,
print out the source (as well as the formatted output) for
example.sgml
so you have a real live case to refer to.
Looking at the source of the example document, you'll notice right off
that there are a number of ``tags'' marked within angle brackets
( and
). A tag simply specifies the beginning or end
of an element, where an element is something like a section, a paragraph,
a phrase of italicized text, an item in a list, and so on. Using a tag
is like using an HTML tag, or a LaTeX command such as
item
or
section{...}
.
As a simple example, to produce this boldfaced text, you would type
As a simple example, to produce <bf>this boldfaced text</bf>, ...
in the source. bf>
begins the region of bold text, and
</bf>
ends it. Alternately, you can use the abbreviated form
As a simple example, to produce <bf/this boldfaced text/, ...
which encloses the bold text within slashes. (Of course, you'll need to
use the long form if the enclosed text contains slashes, such as the
case with Unix filenames).
There are other things to watch out with respect to special characters (that's why you'll notice all of these bizarre-looking ampersand expressions if you look at the source; I'll talk about those shortly).
In some cases, the end-tag for a particular element is optional. For
example, to begin a section, you use the sect>
tag,
however, the end-tag for the section (which could appear at the end of
the section body itself, not just after the name of the section!)
is optional and implied when you start another section of the same depth.
In general you needn't worry about these details; just follow the model
used in the tutorial (example.sgml
).
Obviously, the angle brackets are themselves special characters in the
SGML source. There are others to watch out for. For example, let's say
that you wanted to type an expression with angle brackets around it,
as so: foo
. In order to get the left angle bracket, you
must use the lt;
element, which is a ``macro'' that expands
to the actual left-bracket character. Therefore, in the source, I typed
angle brackets around it, as so: <tt><foo></tt>.
Generally, anything beginning with an ampersand is a special
character. For example, there's percnt;
to produce
, verbar;
to produce , and so on. For every
special character that might otherwise confuse LinuxDoc-Tools if typed by
itself, there is an ampersand "entity" to represent it. The most
commonly used are:
amp;
for the ampersand (), lt;
for a left bracket (),gt;
for a right bracket (),etago;
for a left bracket with a slash
(</
)dollar;
for a dollar sign (),num;
for a hash (),percnt;
for a percent (),tilde;
for a tilde (),``
and ''
for quotes, or use
dquot;
for ".shy;
for a soft hyphen (that is, an indication
that this is a good place to break a word for horizontal justification). Here is a complete list of the entities recognized by 0.1. Note that not all back-ends will be able to make anything useful from every entity -- if you see parantheses with nothing between them in the list, it means that the back-end that generated what you're looking at has no replacement for the entity. The ``common'' ones listed above are pretty reliable.
vertical 1/2 fraction
typeset 1/2 fraction
typeset 1/4 fraction
typeset 3/4 fraction
typeset 1/8 fraction
typeset 3/8 fraction
typeset 5/8 fraction
typeset 7/8 fraction
superscript 1
superscript 2
superscript 3
plus sign
plus-or-minus sign
less-than sign
equals sign
greater-than sign
division sign
multiplication sign
currency symbol
symbol for ``pounds''
dollar sign