January 09, 2003

LaTeX to HTML conversion of my paper

TTH: the TEX to HTML translator. I needed a break from my editing/writing/re-edit positive feedback loop. So I figured, why not write more in my blog? While writing my first paper in LaTeX, I suddenly worried about having it in MS Word format for the slaves to Gates at work. Good thing someone on the pybliographer list suggested I try TTh. It does a fairly exceptional job in converting my LaTeX document to HTML format, which I can open in OpenOffice and convert to MS Word (95 or 97) format. The problems I was having, though, were:

1. Incorrect handling of my \superscript and \subscript LaTeX macros.
2. Didn't use the textcomp package as I had hoped it would for the \textdegree\ command which would show my temperatures as 37° C, and not 37 C.
3. Created links for graphics called on \includegraphics, and not as in-line graphics.
4. BibTeX works too well, with hyperlinks to my references, but the links are in blue and underlined--not what you want if you need to convert to Word format, since that formatting is retained.

Delving into the TTh manual and man pages, I learned how to tweak my LaTeX files (in the preamble) in order for TTh to work properly. The first was to create TTh specific macros that would handle \superscript and \subscript correctly. That meant putting lines like:

%%tth:\def\superscript#1{\special{html:< SUP >}#1\special{html:< /SUP >}}

in the preamble for TTh specific macros. The above line means that \superscript(2) will take number 2 and bind it with < SUP > and < /SUP >when converting to HTML.

For the second problem, a TTh specific macro also did the job:

%%tth:\def\textdegree{\special{html: & deg ;}}

For the third problem, I had to first use the command line switch -e2 to enable in-line graphics, and the used emacs to replace out the incorrect links to my images directory.

Lastly, I wanted to remove all underline formatting for all the links in my document. I could have done it the hard way by putting the text:

style="text-decoration:none"

to the a href HTML command, for each and every link. But by placing the lines:

A:link {text-decoration: none;}
A:visited {text-decoration: none;}

in the cascading style section, I was able to remove underlining for all my links. I guess I could also change the color with a color:#FFFFF.

The point of all this is that you can live without MS Windows and Office and still be able to publish/share your documents with those who are stuck in Bill Gates' box.

I also got my hands on a pendrive/mini-drive at work. It's actually a USB mini-drive called a KanGuru. I tried using it on the Mac (running OS 9.1) and it was recognized without requiring the addition of any drivers! Tried it on both machines at work running Win98, but had to install the included drivers (supposedly, win2k, Me, XP works without additional drivers). But, does it work on Linux Mandrake 9.0? It does, but you have to know what you're doing. In Mandrake 9.0, I didn't have to install any additional modules. Though I suspect, you MUST have usb-ohci or usb-uhci modules installed already, as well as scsi generic modules installed, but since LM 9.0 has these installed by default, I didn't need to do anything other than plug in the mini-drive/pendrive and locate it. Just as with any other drives, when they're installed you still need to "mount" it in a mount point/directory. So I made a /mnt/pendrive directory. Then I went searching for the device. Did a list of /dev/sd* and saw that I had /dev/sda, /dev/sdb, and /dev/sdb1. Hmmm.../dev/sdb1? That must be it. Did a quick "mount -t vfat /dev/sdb1 /mnt/pendrive" as root and voila!, I could access the mini-drive as root in /mnt/pendrive. I guess I could have mounted with permissions to regular users and not just root. Now, if only I had USB ports in my regular linux box (which runs on a dinky Pentium 133 by the way).

Posted by johnvu at January 9, 2003 07:17 PM
Comments
Post a comment