Next Previous Contents

## 6. Getting/Using the LinuxDoc Software

You could write a LinuxDoc document without having any LinuxDoc software. However, it's likely that it would contain some errors in the tags (or their use) so that it would be returned to you for correction. Even if there were no errors, the results might not not look quite right. So it's best for you to have the software to convert your source code on your computer.

The Debian distribution of Linux has a linuxdoc-tools package. There is also a rpm package for non-Debian distributions. It was formerly called sgml-tools. Don't use the sgmltools-2 package which is primarily for DocBook-sgml.

To use linuxdoc-tools you run converter programs on the *.sgml files. For example to get text output, type: "sgml2txt --pass="-P-cbou" --blanks=1 my-HOWTO.sgml". To get html output, type: "sgml2html my-HOWTO.sgml". If it shows errors, it will show the line number and the column number where the error is in the source file. Typing "man -k sgml" should show you a number of other programs with a one-line description of each but not all of them are for linuxdoc-sgml.

For sgml2txt, the option --pass="-P-cbou" is needed to get pure text output since otherwise you get text output which puts emphasis on words and letters by the use of escape sequences and overstriking. An example of a bullet made by overstriking is +^Ho which on a printer would type +, then backspace (^H), and then type o over the existing +. This doesn't seem to work on display terminals (they can't overstrike).

In case you are interested, the --pass passes the -P-cbou option to the groff program (used by sgml2txt) and the -P option of groff passes the -cbou options to grotty (a post-processor for groff) forcing grotty to generate just plain text output. See the grotty man page. In brief: -c avoids escape sequences but allows overstrikes but -bou prohibits overstrikes when the -c option is used. The result is no overstrikes and no escape sequences in the output. -b prohibits overstrikes to make a character look bold; -u prevents overstrikes for underlining; and -o prohibits other kinds of overstrikes like the bullet example above. An alternate way to eliminate overstrikes is to use the -f option with sgml2txt but you still have to pass the -c option to grotty to eliminate escape sequences.

What a mess! The default should probably be plain text so that all of this passing of options wouldn't be needed. I've finally got them to fix this so after about mid-2007 you can use just the -f option instead of --pass="-P-cbou". If you don't use this --pass ... option then if you use the Linux "cat" command to display the text, it looks great. But using pagers or editors on the text output file usually results in the escape characters being eaten so you see a bunch of unwanted characters in your text that were supposed to be part of escape sequences. In some cases, pagers can display certain overstrikes OK but editors (like vim) don't. So eliminating all overstrikes permits you to use any editor or pagers to read it.

Next Previous Contents