Next: Finding tag names   Previous: The whole picture   Contents: Contents

Tag definition

It's up to you to define your tag meanings. Tags are usually used to mark up text. This may be a logical markup (index entry, code sequence, ...) or a formatting one (bold, italics, ...), for example.


  \B<something> marks "something" to
  be formatted bold.

  The pp2html tag \X declares index entries
  like \X<here>.

Note that the common (and recommended) way of markup is to expect the marked text part in the tags body. However, it is also possible to declare begin and end tags which enclose the marked parts, like the builtin \TABLE and \END_TABLE do. This allows to enclose even empty lines (and therefore several paragraphs).


  \TABLE

  Column   | Column
  contents | contents

  \END_TABLE

Note that a tag does note necessarily need to have a body part. \END_TABLE, for example, has not.

Depending on the tag meaning (or "semantics"), a tag may need options. These are parameters passed to the tag, specifying how it shall be evaluated. Tag options can be optional or mandatory.


  The \IMAGE tag uses options to specify
  what file should be loaded, as in

  \IMAGE{src="image.png"}

As a general rule, tag options control tag processing, while the tag body contains parts of the document. Keep in mind that your tags might be processed by other converters as well which do not handle them. In such a case, only the tag body will remain a visible part of the source.

The same is true vice versa:


  Theoretically, the image tag could use the
  tags body as well to declare the image file:

  \IMAGE<image.png>

  But if a converter ignores \IMAGE, this
  would result in the text "image.png" which
  will usually make no sense to a reader.

So, when you design your tags, make sure that nothing of them remains visible in the result in case they will be ignored.

Next: Finding tag names   Previous: The whole picture   Contents: Contents