{\rtf1\defformat\mac\deff2 {\fonttbl{\f0\fswiss Chicago;}{\f2\froman New York;}{\f3\fswiss Geneva;}{\f4\fmodern Monaco;}{\f5\fscript Venice;}{\f6\fdecor London;}{\f8\fdecor San Francisco;}{\f11\fnil Cairo;}{\f16\fnil Palatino;}{\f20\froman Times;}{\f21\fswiss Helvetica;} {\f22\fmodern Courier;}{\f23\ftech Symbol;}{\f34\fnil New Century Schlbk;}{\f1724\fnil Kashmir;}{\f2515\fnil MT Extra;}{\f2853\fnil BobGothic;}{\f2944\fnil Handwriting;}}{\colortbl\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255; \red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;}{\stylesheet{\s243\li360\brdrt\brdrs \tx2700\tqc\tx4320\tqr\tx9720 \b\f20 \sbasedon0\snext243 footer;}{\s245\li360 \f20\fs18\up6 \sbasedon0\snext0 footnote reference;}{\s246\li360 \f20\fs20 \sbasedon0\snext246 footnote text;}{\s250\li360\sb120\sa120\keepn \b\f20\fs28 \sbasedon251\snext0 heading 6;}{\s251\li360\sb120\sa120\keepn \b\f20\fs28 \sbasedon252\snext0 heading 5;}{ \s252\li360\sb120\sa120\keepn \b\f20\fs28 \sbasedon253\snext0 heading 4;}{\s253\li360\sb120\sa120\keepn \b\f20\fs28 \sbasedon254\snext0 heading 3;}{\s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 \sbasedon255\snext0 heading 2;}{ \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 \sbasedon0\snext0 heading 1;}{\li360 \f20 \sbasedon222\snext0 Normal;}{\s1\fi-720\li1080\tx1440 \f20 \sbasedon0\snext1 ol;}{\s2\li360 \i\f20 \sbasedon0\snext2 address;}{\s3\fi-720\li1440\tx1440 \f20 \sbasedon1\snext3 ol 1;}{\s4\fi-720\li1800\tx1800 \f20 \sbasedon3\snext4 ol 2;}{\s5\li1440\ri1440 \i\f20 \sbasedon0\snext5 blockquote;}{\s6\fi-900\li2340\tx2340 \f20 \sbasedon4\snext6 ol 3;}{\s7\fi360\tx360\tx3600\tx4320\tx7200\tx10700 \f20 \sbasedon8\snext7 dir;}{\s8\fi-3960\li4320\tx4320 \f20 \sbasedon1\snext8 glossary;}{\s9\fi-1080\li2880\tx2880 \f20 \sbasedon6\snext9 ol 4;}{\s10\fi-1260\li3420\tx3420 \f20 \sbasedon9\snext10 ol 5;}{\s11\fi-720\li1080\tx1440 \f20 \sbasedon1\snext11 menu;}{ \s12\fi-3960\li4680\tx4680 \f20 \sbasedon8\snext12 glossary 1;}{\s13\fi-3960\li5040\tx5040 \f20 \sbasedon12\snext13 glossary 2;}{\s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 \sbasedon0\snext14 pre;}{ \s15\fi-3960\li5400\tx5400 \f20 \sbasedon13\snext15 glossary 3;}{\s16\fi-3960\li5760\tx5760 \f20 \sbasedon15\snext16 glossary 4;}{\s17\fi-3960\li6120\tx6120 \f20 \sbasedon16\snext17 glossary 5;}{\s18\fi-720\li1080\tx1440 \f20 \sbasedon1\snext18 numbered list;}{\s19\fi-720\li1440\tx1440 \f20 \sbasedon3\snext19 numbered list 1;}{\s20\fi-720\li1800\tx1800 \f20 \sbasedon4\snext20 numbered list 2;}{\s21\fi-900\li2340\tx2340 \f20 \sbasedon6\snext21 numbered list 3;}{\s22\fi-1080\li2880\tx2880 \f20 \sbasedon9\snext22 numbered list 4;}{\s23\fi-1260\li3420\tx3420 \f20 \sbasedon10\snext23 numbered list 5;}{\s24\fi-180\li540\tx540 \f20 \sbasedon18\snext24 bullet list;}{\s25\fi-180\li900\tx900 \f20 \sbasedon19\snext25 bullet list 1;}{ \s26\fi-180\li1260\tx1260 \f20 \sbasedon20\snext26 bullet list 2;}{\s27\fi-180\li1620\tx1620 \f20 \sbasedon21\snext27 bullet list 3;}{\s28\fi-180\li1980\tx1980 \f20 \sbasedon22\snext28 bullet list 4;}{\s29\fi-180\li2340\tx2340 \f20 \sbasedon23\snext29 bullet list 5;}{\s30\fi360\li360\tx720\tx3960\tx4320\tx7560\tx10700 \f20 \sbasedon7\snext30 dir 1;}{\s31\fi360\li720\tx1080\tx4320\tx7920\tx10700 \f20 \sbasedon30\snext31 dir 2;}{\s32\fi360\li1080\tx1440\tx4680\tx8280\tx10700 \f20 \sbasedon31\snext32 dir 3;}{\s33\fi360\li1440\tx1800\tx5040\tx8640\tx10700 \f20 \sbasedon32\snext33 dir 4;}{\s34\fi360\li1800\tx2160\tx5400\tx10700 \f20 \sbasedon33\snext34 dir 5;}{\s35\fi-720\li1440\tx1440 \f20 \sbasedon3\snext35 menu 1;}{\s36\fi-720\li1800\tx1800 \f20 \sbasedon4\snext36 menu 2;}{\s37\fi-900\li2340\tx2340 \f20 \sbasedon6\snext37 menu 3;}{\s38\fi-1080\li2880\tx2880 \f20 \sbasedon9\snext38 menu 4;}{\s39\fi-1260\li3420\tx3420 \f20 \sbasedon10\snext39 menu 5;}{\s40\fi-720\li1080\tx1440 \f20 \sbasedon18\snext40 small gloss;}{\s41\fi-720\li1440\tx1440 \f20 \sbasedon19\snext41 small gloss 1;}{\s42\fi-720\li1800\tx1800 \f20 \sbasedon20\snext42 small gloss 2;}{\s43\fi-900\li2340\tx2340 \f20 \sbasedon21\snext43 small gloss 3;}{ \s44\fi-1080\li2880\tx2880 \f20 \sbasedon22\snext44 small gloss 4;}{\s45\fi-1260\li3420\tx3420 \f20 \sbasedon23\snext45 small gloss 5;}{\s46\fi-180\li540\tx540 \f20 \sbasedon24\snext46 ul;}{\s47\fi-180\li900\tx900 \f20 \sbasedon25\snext47 ul 1;}{ \s48\fi-180\li1260\tx1260 \f20 \sbasedon26\snext48 ul 2;}{\s49\fi-180\li1620\tx1620 \f20 \sbasedon27\snext49 ul 3;}{\s50\fi-180\li1980\tx1980 \f20 \sbasedon28\snext50 ul 4;}{\s51\fi-1260\li3420\tx3420 \f20 \sbasedon0\snext51 ul 5;}{\s52\li360\sb120\sa120 \brdrb\brdrth \f20 \sbasedon0\snext0 hr;}}{\info{\title rtftohtml Users Guide}{\author Chris Hector cjh@cray.com}}\widowctrl\ftnbj\fracwidth \sectd \sbknone\linemod0\linex0\cols1\endnhere \pard\plain \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 rtftohtml Users Guide\par \pard\plain \li360 \f20 This document contains directions for using the {\i rtftohtml} filter. \par \pard \li360 There are two ways that the rtftohtml filter may be used. You can take existing documents and translate them to HTML, or write new documents explicitly for the World Wide Web. This filter should accomodate both uses.\par \pard\plain \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 An Overview of rtftohtml\par \pard\plain \li360 \f20 rtftohtml reads up RTF format documents and translates them to HTML. In processing text, the filter chooses HTML markup based on three characteristics. These are\par \pard\plain \s18\fi-720\li1080\tx1440 \f20 1)\tab The destination of the text. Example destinations are header, footer, nootnote, picture.\par \pard \s18\fi-720\li1080\tx1440 2)\tab The paragraph style. Paragraph styles are user-definable entities, but some are pre-defined by the word processing package. For Microsoft Word (on the Macintosh) examples are "Normal" and "heading 1". \par \pard \s18\fi-720\li1080\tx1440 3)\tab The text attributes. Examples of text styles are bold, courier, 12 point.\par \pard\plain \li360 \f20 \par \pard \li360 The filter has built-in rules for dealing with destinations. For paragraph and text styles, the rules for translation are contained in a file called html-trans. By modifying this file, you can train rtftohtml to perform the correct translations for your do cuments. The most common change that you will need to make is to add your own paragraph styles to html-trans.\par \pard \li360 \par \pard \li360 rtftohtml should produce reasonable HTML output for most documents. Here is what you can expect:\par \pard\plain \s24\fi-180\li540\tx540 \f20 \bullet \tab Your output should appear in a file called "xx.html" where "xx" or "xx.rtf" was your input file name.\par \pard \s24\fi-180\li540\tx540 \bullet \tab Bold, italic and underlined text should appear with , and markup\par \bullet \tab Courier font text should appear with markup\par \bullet \tab Tables will be formatted using
 markup (only plain text is supported in tables.)\par 
\bullet \tab Footnotes will appear at the end of your document with hypertext links to them.\par 
\bullet \tab Table of contents, indexes, headers and footers are discarded.\par 
\pard \s24\fi-180\li540\tx540 \bullet \tab All paragraph styles use in your document must appear in the file "html-trans". This allows you to create a mapping from any paragraph style to any HTML markup. 
There are many pre-defined styles in html-trans, including "heading 1..6". (If a paragraph style is not found, a warning will be generated and the text will be written to the HTML file with no special markup.)\par 
\pard \s24\fi-180\li540\tx540 \bullet \tab Each graphic in your file will be written out to a separate file. The filename will be "xxn.ext" where "xx" or "xx.rtf" was your input, "n" is a unique number and "ext" will be either "pict"
 for Macintosh PICT format graphics  or "wmf" for Windows Meta-Files format graphics. The HTML file will create links to these files, using either ", 
    which describe the paragraph.s, and tags like and which describe text. I call these "paragraph" markup and "text" markup respectively.}} markup to use. Using the HTML paragraph" markup name, the filter (using the .PTag table) knows what tags to generate for the text. \par \pard \s18\fi-720\li1080\tx1440 5)\tab If the text was not SPECIAL, process the text styles again. The filter compares the text style information to see if it matches any entries in the .TMatch table (in html-trans). In this step, it is possible to match more than one entry. For each matched entry in the .TMatch table, the filter uses the HTML "text" markup name, the filter (using the .TTag table) knows what tags to generate for the text. \par \pard\plain \li360 \f20 \par \pard \li360 Using this process, the filter can generate any HTML markup for any combination of paragraph style and text style. \par \pard \li360 \par \pard\plain \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 What about Graphics?\par \pard\plain \li360 \f20 Graphics are imbedded in RTF in either a binary format or an (ASCII) hex dump of that binary. I have never seen a binary format graphic - I don't think that the filter will process binary correctly. It does handle the hex format of graphics, by converting the hex back into binary and writing the binary to a file. The file extension is chosen by looking at the original type of the graphic. The following list shows the file types and their extensions:\par \pard \li360 \par \pard\plain \s8\fi-3960\li4320\tx4320 \f20 Macintosh PICT \tab .pict - also, 256 bytes of nulls are prepended to the graphic. This is to conform to the PICT file format.\par \pard \s8\fi-3960\li4320\tx4320 Windows Meta-files\tab .meta \tab - ???? Is this ok???\par Windows Bit-map\tab .bmp\tab - ???? Is this ok???\par \pard\plain \li360 \f20 \par \pard \li360 In addition, the filter produces a link to the file containing the graphic. Now, since the above graphic formats are not very portable, the filter assumes that you will convert these files to something more useful, like GIF. So the format of the link is: \par \pard \li360 {\f22 Click here for a Picture\par }where \par \pard\plain \s24\fi-180\li540\tx540 \f20 \bullet \tab {\f22 basename} is the name of the input document (without the .rtf extension)\par \bullet \tab {\f22 N} is a unique number (starting at 1)\par \pard \s24\fi-180\li540\tx540 \bullet \tab {\f22 ext} is an extension. This defaults to GIF, but can be overidden with the -P command line option.\par \pard \s24\fi-180\li540\tx540 \par \pard\plain \li360 \f20 You can also change the link to an IMG form. If you specify the -I command line option, all links to graphics will be of the form:\par \pard \li360 {\f22 }\par \par \pard \li360 There is one other special case. If a graphic is encountered when the filter is in the process of generating a link, the IMG form of the link is used even without the -I command line option.\par \pard\plain \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 Special Processing\par \pard\plain \li360 \f20 In the following discussion of SPECIAL processing, I will assume that rtftohtml has not been customized. If it has, the text styles used to create special effects may be different. \par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Making a Named Anchor\par \pard\plain \li360 \f20 To make a named anchor, you simply enter the name in the document where you would like the anchor to appear. Then format the text using Outline and Hidden. Be careful in formatting the text that you format ONLY the name - be careful not to format leading and trailing spaces or paragraph marks. As an example, if the text - Named Anchor Example - were formatted with Outline and Hidden, it would produce the HTML output :\par \pard \li360 \par \par \pard \li360 To change the formatting that produces named anchors, you need to modify the entry in html-trans that specifies "_Name" formatting.\par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Footnote/Endnote Processing\par \pard\plain \li360 \f20 If your RTF document contains footnotes or endnotes, the filter will place the text of the footnote at the end of the HTML do cument. At the footnote reference mark, the filter will generate a hypertext link to the text of the footnote. This works with either automatically numbered footnotes{\fs18\up6 \chftn {\footnote \pard\plain \s246\li360 \f20\fs20 {\fs18\up6 \chftn }\tab Look, there is one now!}}, or user supplied footnote reference marks{\fs18\up6 +{\footnote \pard\plain \s246\li360 \f20\fs20 {\fs18\up6 +} \tab There is my mark.}} . \par \pard \li360 This processing has one special requirement. The rtftohtml filter requires that footnote reference marks be formatted as Superscript, and that NO other text be formatted with Superscript. If your footnote reference marks are not formatted as Superscript, y ou must identify some formatting that is unique to footnote reference marks and then specify this in html-trans in the entry describing "_Footnote".\par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Discarding Unwanted Text\par \pard\plain \li360 \f20 If you have text that you do not want to appear in the HTML output, simply format the text as Hidden and Plain (that is, no underline, outline...). \par If you wish to modify the formatting that discards text, you need to change the entry in html-trans that specifies "_Discard".{\b \par }\pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Imbedding HTML in a Document\par \pard\plain \li360 \f20 Normally, if your RTF document contained the text "hello", t he translator would output this as: "<cite>hello</cite>". This ensures that the text would appear in your HTML output exactly as it appeared in the original RTF document. If, however, you want the to be interpreted as HTML markup, you must format the tags using Hidden and Shadow. The filter will then send the tags through without translation. \par \pard \li360 When the rtftohtml filter produces HTML markup, it keeps track of the nesting level of tags to ensure that you don't get something like < cite>hello which would be incorrect markup. If you imbed HTML markup in your document, the filter will NOT be aware of it. You must ensure that your markup appears correctly nested.\par \pard \li360 If you wish to modify the formatting for imbedded HTML, you need to change the entry in html-trans that specifies "_Literal".{\b \par }\pard \li360 {\b \par }\par \par \pard\plain \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 Customizing rtftohtml\par \pard\plain \li360 \f20 Some customizations of rtftohtml require a little understanding of how the filter work, others require a lot. All of the customizations involve editing either html-trans or one of the character translation files. \par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 html-trans File Format\par \pard\plain \li360 \f20 In html-trans there are four tables. They are .PT ag, .TTag, .PMatch and .TMatch. These tables begin with the name (in column one) and continue until the next table starts. All blank lines and lines beginning with a '#' are discarded. '#' lines a re typically used for comments. The tables themselves are composed of records containing a fixed number of fields which are separated by commas. The fields are either strings (which should be quoted) integers or bitmasks.\par \pard \li360 \par \pard\plain \s253\li360\sb120\sa120\keepn \b\f20\fs28 .PTag Table\par \pard\plain \li360 \f20 Each entry in the .PTag table describes an HTML paragraph markup. The format is: \par .PTag\par \pard \li360 #"name","starttag","endtag","col2mark","tabmark","parmark",allowtext,cannest,DeleteCol1,fold\par \pard\plain \s8\fi-3960\li4320\tx4320 \f20 {\b name}\tab A unique name for this entry. These names are referenced in the .PMatch table.\par {\b starttag}\tab This string will be output once at the beginning of any text for this markup.\par {\b endtag}\tab This string will be output once at the end of any text for this markup.\par {\b col2mark}\tab This string will be output in place of the first tab in every paragraph (used for lists)\par {\b parmark}\tab This string will be output in place of each paragraph mark. (usually
    or

    )\par \pard \s8\fi-3960\li4320\tx4320 {\b allowtext}\tab If 0, no text markup will be allowed within this markup. (for example

     or 

    don't format well if they contain additional markup.\par \pard \s8\fi-3960\li4320\tx4320 {\b cannest}\tab If 1, other paragraph markup will be allowed to nest within this markup. (used for nesting lists)\par \pard \s8\fi-3960\li4320\tx4320 {\b DeleteCol1}\tab If 1, all text up to the first tab in a paragraph will be deleted. (used to strip out bullets that when going to unordered lists (
      ).\par {\b fold}\tab If 1, the filter will add newlines to the HTML to keep the number of characters in a line to less than 80. For
       or  elements, this should be set to 0.\par 
      \pard\plain \li360 \f20 \par 
      \par 
      \pard\plain \s252\li360\sb120\sa120\keepn \b\f20\fs28 Sample .PTag Entries\par 
      \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 "h1","

      \\n","

      \\n","\\t","\\t","
      \\n",0,0,0\par \pard\plain \li360 \f20 This is a level 1 heading. The "\\n" in the start and end-tag fields forcesa newline in the HTML markup. Since newlines are ignored in HTML (except in
      ) it's only effect is to make the HTML output more readable.
       There is no difference between the first tab and any other. They both translate to a tab mark. Paragraph marks generate "
      " followed by a newline (just for looks). Text markup (like ) is not allowed within

      text , because we leave that up to the HTML client. No nesting is allowed - (see the discussion on nested styles). No text is deleted.\par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 \par "Normal","","\\n","\\t","\\t","

      \\n",1,0,0\par \pard\plain \li360 \f20 This is the default for normal text. Regular text in HTML has no required start and end-tags. The "\\ n" in the end-tag field forces a newline in the HTML markup. Since newlines are ignored in HTML (except in

      ) it's only effect is to make the HTML output more readable.
       There is no difference between the first tab and any other. They both translate to a tab mark. Paragraph marks generate "

      " followed by a newline (just for looks). Text markup (like ) is allowed within Normal text. No nesting is allowed - (see the discussion on nested styles). No text is deleted.\par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 \par \pard \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 "ul","

        \\n
      • ","
      ","\\t","\\t","\\n
    • ",1,1,0\par \pard\plain \li360 \f20 This is the entry for unordered lists. This generates a "
        \\n
      • " at the start of the list and "
      /n" at the end. There is no difference between the first tab and any other. They both translate to a tab mark. Paragraph marks generate "
    • " preceded by a newline (just for looks). Text mark up (like ) is allowed, and this entry may be nested - and it allows others to be nested within it. This allows nested lists. No text is deleted.\par \pard \li360 \par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 "ul-d","
        \\n
      • ","
      ","\\t","\\t","\\n
    • ",1,1,1\par \pard\plain \li360 \f20 This entry is identical to the previous except that the DeleteCol1 field is set to 1. This is used to remove bullets (which really appear in the RTF) because we don't want to see them in the HTML.\par \pard \li360 \par \pard\plain \s253\li360\sb120\sa120\keepn \b\f20\fs28 .TTag Table\par \pard\plain \li360 \f20 Each entry in the .TTag table describes an HTML text markup. The format is: \par .TTag\par "name","starttag","endtag"\par \pard\plain \s8\fi-3960\li4320\tx4320 \f20 {\b name}\tab A unique name for this entry. These names are referenced in the .PMatch table.\par {\b starttag}\tab This string will be output once at the beginning of any text for this markup.\par {\b endtag}\tab This string will be output once at the end of any text for this markup.\par \pard\plain \li360 \f20 Note that unlike the .PTag table, no text markup should appear more than once. (Of course there is no good reason that it should appear.) If you have two entries with start and end tags, it would be possible to get HTML of the form text. I don 't know if this is invalid markup, but it sure is ugly.\par \pard \li360 \par \pard\plain \s253\li360\sb120\sa120\keepn \b\f20\fs28 .PMatch Table\par \pard\plain \li360 \f20 Each entry in the .PMatch correlates a paragraph style name to some entry in the .PTag table. The format is: \par .PMatch\par "Paragraph Style",nesting_level,"PTagName"\par \pard\plain \s8\fi-3960\li4320\tx4320 \f20 {\b Paragraph Style}\tab The paragraph style name that appears in the RTF input.\par {\b nesting_level}\tab The nesting level. This should be zero except for nested list entries.\par {\b PTagName}\tab The name of the .PTag entry that should be used for paragraphs with this paragraph style. \par \pard\plain \li360 \f20 \par \par \pard\plain \s252\li360\sb120\sa120\keepn \b\f20\fs28 Sample .PMatch Entries\par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 "heading 1",0,"h1"\par \pard\plain \li360 \f20 This is a level 1 heading. Any paragraphs with this paragraph style will be mapped to the entry in the .PTag table named "h1".\par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 \par \pard \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 "numbered list",0,"ol-d"\par \pard\plain \li360 \f20 This is used for numbered lists. Any paragraphs with this paragraph style will be mapped to the entry in the .PTag table named "ol-d". \par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 \par \pard \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 "numbered list 2",2,"ol-d"\par \pard\plain \li360 \f20 This is an entry for a nested paragraph style. The nesting level of two is used to indicate that this paragraph should appear in the HTML nested within two levels of paragraph markups. The paragraph marked with this style may only appear after a paragraph style that has a nesting level of 1 or greater.\par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 \par \pard\plain \li360 \f20 \par \pard\plain \s253\li360\sb120\sa120\keepn \b\f20\fs28 .TMatch Table\par \pard\plain \li360 \f20 Each entry in the .TMatch table describes processing for text styles. The format is: \par .TMatch\par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 "Font",FontSize,Match,Mask,"TextStyleName"\par \pard\plain \s8\fi-3960\li4320\tx4320 \f20 {\b Font}\tab The name of a Font, or "" if all fonts match this entry.\par {\b FontSize}\tab The point-size of the font, or 0 if all point sizes match this entry.,\par {\b Match}\tab A bit-mask, where each bit represents a text attribute. These bits are compared to the attributes of the style being output. They must match for this entry to be matched. One in a bit position means that the text style is set, a zero is not set.\par {\b Mask}\tab A bit-mask, where each bit represents a text attribute. In comparing the style of the text being processed, to the Match bit-mask, this field is used to select the bits that matter. If a zero appears in a bit-position, then that style attribute is ignored (for the purpose of matching this entry.) Only 1 bits are used in the above comparision.\par {\b TextStyleName}\tab This is either the name of an entry in the .TTag table indicating the HTML markup to use, or it is one of "_Discard", "_Name", "_HRef", "_Hot", or "_Literal".\par \pard\plain \li360 \f20 \par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 The order of bits in the Match and Mask bit-maps are:\par # v^bDWUHACSOTIB - Bold\par # v^bDWUHACSOTI - Italic\par # v^bDWUHACSOT - StrikeThrough\par # v^bDWUHACSO - Outline\par # v^bDWUHACS - Shadow\par # v^bDWUHAC - SmallCaps\par # v^bDWUHA - AllCaps\par # v^bDWUH - Hidden\par # v^bDWU - Underline\par # v^bDW - Word Underline\par # v^bD - Dotted Underline\par # v^b - Double Underline\par # v^ - SuperScript\par # v - SubScript\par \pard\plain \li360 \f20 \par \par \pard\plain \s252\li360\sb120\sa120\keepn \b\f20\fs28 Sample .PTag Entries\par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 # double-underline/not hidden -> hot text\par # double-underline/hidden -> href\par # v^bDWUHACSOTIB,v^bDWUHACSOTIB\par "",0,00100000000000,00100010000000,"_Hot"\par "",0,00100010000000,00100010000000,"_HRef"\par \pard\plain \li360 \f20 The first entry will match any text formatted with double underline EXCEPT if it is hidden text. This is accomplished by using those two bits to compare (the MASK field) and having a 1 in the double underline bit and a zero for the hidden text bit. The sec ond entry will match any text formatted with BOTH double und erline and hidden text. Any text that matches the first will be treated as the hot text of a link. Any text that matches the second will be taken as the href itself. (The filter requires that the HRef text immediately precede the Hot text.) \par \pard \li360 \par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 # Regular matches - You can have multiple of these active\par # monospace fonts -> tt\par "Courier",0,00000000000000,00000000000000,"tt"\par \pard\plain \li360 \f20 This will match any text that uses the Courier font and mark it using the HTML text markup appearing in the .TTag table with the entry name "tt".\par \par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 # bold -> bold\par # v^bDWUIACSOTIB,v^bDWUIACSOTIB\par "",0,00000000000001,00000000000001,"b"\par \pard\plain \li360 \f20 This will match any text that has bold attributes and will mark it using the HTML text markup appearing in the .TTag table with the entry name "b". Note that bold text using the Courier font would match both this entry and the previous. This will yeild markup of the form hi. Note that "b" is the name of an entry in the .TTag table, not the HTML markup that is used! \par \pard \li360 \par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Adding Paragraph Styles\par \pard\plain \li360 \f20 To add a new paragraph style, simply go to the .PMatch table and add an entry to the end. Put the name of the paragraph style (quoted), the nesting level (usually zero) and the name of the .PTag entry that should be used. \par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Modifying HTML "Paragraph" Markup\par \pard\plain \li360 \f20 This section in progress\par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Changing SPECIAL Markup\par \pard\plain \li360 \f20 This section in progress\par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Changing Text Style Markup\par \pard\plain \li360 \f20 This section in progress\par \pard\plain \s254\li360\sb120\sa120\keepn\brdrb\brdrs \b\f20\fs28 Changing Text Translation\par \pard\plain \li360 \f20 This section in progress\par \pard\plain \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 Command Line Options\par \pard\plain \li360 \f20 The syntax of the rtftohtml command is as follows:\par \pard\plain \s14\li360\ri880\keep\tx1320\tx2280\tx3240\tx4200\tx5180\tx6140\tx7100\tx8060\tx9000 \f22\fs20 rtftohtml [-i] [-o filename] [-P extension] [file]\par \pard\plain \s8\fi-3960\li4320\tx4320 \f20 {\b -i}\tab Indicates that imbedded graphics should be linked into the main document using an IMG tag. The default is to use an HREF style link.\par \pard \s8\fi-3960\li4320\tx4320 {\b -o filename}\tab Indicates that the output file name should be "filename". If any other files are cre ated (such as for graphics,) the basename of the other files will be "filename" without ".rtf" if it is present in the name.\par \pard \s8\fi-3960\li4320\tx4320 {\b -P extension}\tab Use "extension" as the extension for any links to graphics files. The default for this is "gif".\par \pard \s8\fi-3960\li4320\tx4320 {\b "file"}\tab The file name to be processed. If no f ile is given, standard input is used. If standard input is used, the body of the document will be written to standard output (unless overridden by the -o option.) If a file name appears, the output is written to "filename" with ".html" as an extension. (If ".rtf" appears as an extension on the original input file, it is stripped before appending the ".html") \par \pard\plain \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 Nested Paragraph Styles\par \pard\plain \li360 \f20 This section in progress\par \pard\plain \s255\li360\sb240\sa240\keepn\brdrb\brdrs \b\f20\fs36 Errors\par \pard\plain \li360 \f20 This section in progress\par \pard\plain \s18\fi-720\li1080\tx1440 \f20 \par }