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.
Since I don't have access to all of the applications that can export RTF, I would suggest that we get some default style sheets for Word for Windows, the Microsoft Help file format, Word Perfect etc. If I get any of these, I will put them ftp://ftp.cray.com/src/cjh/RTF here.
Heading Styles
I use styles with the names "heading 1" .. "heading 6", because Word on the Macintosh uses these for the outlining feature. These map to <h1> .. <h6> in RTF.
Sample heading 2
Text after heading
Sample heading 3
Text after heading
Sample heading 4
Text after heading
Sample heading 5
Text after heading
Sample heading 6
Text after heading
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:
- 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.
- Strip off the bullet or number, and translate those list items to <ol> or <ul>.
- 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 . So, here they are:
Ordered List styles
- 1.
- level zero element - my markers preserved
- 1.1
- level one element - my markers preserved
- 1.1.1
- level two element - my markers preserved
- 1.1.1.1
- level three element - my markers preserved
- 1.1.1.1.1
- level four element - my markers preserved
- 1.1.1.1.1.1
- level five element - my markers preserved
- level zero element - my markers stripped
- level one element - my markers stripped
- level two element - my markers stripped
- level three element - my markers stripped
- level four element - my markers stripped
- level five element - my markers stripped
- level zero element - no markers
- level one element - no markers
- level two element - no markers
- level three element - no markers
- level four element - no markers
- level five element - no markers
Un-Ordered List styles
* level zero element - my markers preserved
[[ring]] level one element - my markers preserved
[[ordmasculine]] level two element - my markers preserved
[[radical]] level three element - my markers preserved
[[apple]] level four element - my markers preserved
+ level five element - my markers preserved
- level zero element - my markers stripped
- level one element - my markers stripped
- level two element - my markers stripped
- level three element - my markers stripped
- level four element - my markers stripped
- level five element - my markers stripped
- level zero element - no markers
- level one element - no markers
- level two element - no markers
- level three element - no markers
- level four element - no markers
- level five element - no markers
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
level three dir item each
is less than 20 chars long
and separated by tabs
level four dir item each
is less than 20 chars long
and separated by tabs
level five dir item each
is less than 20 chars long
but is only two cols
wide
Menu 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.
- 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.
Other Styles
The remaining styles are pre, blockquote, address and hr. These follow:
pre Style
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
1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 1234567 123456 8
12345678 12345678 12345678 12345678 12345678 12345678
Address Style
Here is an address
Blockquote Style
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 Style
The HR tag is a simple device to generate a line across the width of your document. Here comes mine:
Chris Hector