Sample rtftohtml Style Sheet

This is a sample style sheet produced by Microsoft Word on the Macintosh. It is designed to demonstrate the various styles that I use. Of course, you can define your own style sheets and use your own style names - but this should be a useful example to get you started.

Paragraph Markup
<H1>This is a Level1 heading

<H2>This is a Level2 heading

<H3>This is a Level3 heading

<H4>This is a Level4 heading

<H5>This is a Level5 heading
<H6>This is a Level6 heading

<pre> Following is pre-formatted text

This is pre-formatted text
tab	stops	are 	supposed 	to be	about 	8 chars wide
need a total width of 80 columns and a fixed width font like Courier
0        1         2         3         4         5        6         7         8
1234567890123456789012345678901234567890123456789023456789012345678901234567890
        x       x       x       x       x       x       x       x       x
	x	x	x	x	x	x	x	x	x

<address>Following is address text

Here is an address

<blockquote>Following is blockquote text

Here is a block quote. Just how long do you thing this should be? I don't know - just keep typing until eventually you fill up several lines.

<hr> Following is a paragraph containing no text - it generates an <hr> markup


Text markup

Bold

Italic

Underline

Hidden Text - the text between the parenthesis will be discarded by the filter ()

Monospaced fonts like courier will go to <tt>

Features

This is a footnote[1] ..

This is a Picture which will be either inlined or linked to by an HREF.

This is a picture that will be used as the "HOT" part of a hypertext link.

This is a manually generated hypertext link to an external document.

This is a hypertext link to a target somewhere else within the same document. This was created with a copy/paste-link.

This is another hypertext link to a target somewhere else within the same document. This was created manually and the target name must be as well.

This is a table          This table has four      right justified  centered      
                         columns and each                          text          
                         column will be                                          
                         translated into a                                       
                         <pre> block that                                        
                         roughly approximates                                    
                         this layout                                             
This is the second row   Hows it look?            Good?            Bad?          
of the same table.                                                               

The following text will be copied directly to the HTML output file - with markup included.

This is Literal HTML as well - but uses the HTMLparagraph style, and is therefore more readable.

Lists

In order to create the illusion of nesting within an RTF document, we need to create a separate style for each level of indentation. I chose 6 as the maximum level of nesting that I care about, but rtftohtml can support as many as you want. This yeilds "ol", "ol 1", "ol 2", ... ,"ol 5". Now, in addition we have another issue with lists. The HTML bullet and numbered lists will prepend a bullet or number to your text. If you already have a bullet or number, you have three options:
  1. Translate your list elements to the HTML <dl> markup, which allows you to preserve the numbers or bullets that you are using in the RTF form of the document. This results in some pretty ugly display using Mosaic.
  2. Strip off the bullet or number, and translate those list items to <ol> or <ul>. This is the recommended option.
  3. Don't use any markers in the RTF form of the document and translate to <ol> and <ul>.

Both of these options exist with the rtftohtml filter, and I have default styles for each. In order that the filter can decide where a bullet or number ends, we need a separator. The filter expects a tab character to be used. It is REALLY important that if you are using styles that remove you markers that a tab be present (or you will lose the whole list element.) You also MUST have a tab character for styles (like the <dl>) that have two parts .

Another technique for lists (particularly glossaries) to be entered with the TERM on one line, and an indented definition on the following line. These are discussed below.

Here are the sample TAB separated lists:

Ordered List styles

  1. level zero element - my markers stripped - This is the recommended style.
    1. level one element - my markers stripped - This is the recommended style.
      1. level two element - my markers stripped - This is the recommended style.

Un-Ordered List styles

Glossary styles

This is areasonably large term
Here is the definition of the term. Of course this format is used for more than just definitions.
This is areasonably large term
Here is the definition of the term. Of course this format is used for more than just definitions.
This is areasonably large term
Here is the definition of the term. Of course this format is used for more than just definitions

Dir styles

  • level zero dir item each
  • is less than 20 chars long
  • and separated by tabs or
  • parmarks
  • and these show up
  • in my docs as three
  • columns
  • level one dir item each
  • is less than 20 chars long
  • and separated by tabs
  • level two dir item each
  • is less than 20 chars long
  • and separated by tabs
  • Menu styles

  • level zero element
  • level one element
  • level two element
  • Multi-Line lists

    In some cases, you want lists to span lines. An example of this is glossaries, where the term appears on one line and the definition on another. In this case, the TERM will be defined with one style, and the DEFinition with another.

    Here are some samples:

    The first TERM
    The definition for the first term
    A nested TERM
    The definition for the nested term
    A level two TERM
    The corresponding definition.
    Thanks for the click! It brought you here.

    This is the target of a hypertext link. This target was created by copying the text and pasting a link to it.

    This is another target of a hypertext link.. This was created by formatting some text as hidden/outline.