TEX to HTML Translation via Tagged DVI Files

Michael D. Sofka · 1998

This paper describes dvihtml, a program under development for translating a tagged DVI le into HTML. A common problem when translating TEX into an-other format is handling unexpected macros. Fortunately, TEX’s macro language is flexible enough to pass markup information to the DVI le in the form of \\special’s, fonts and small horizontal or vertical movements. Translating the resulting DVI le thus allows TEX itself to serve as the macro parser for transla-tion. This technique can be extended for writing smarter DVI viewing programs, including viewers that can perform common layout editing. A common typesetting request is the ability to place copies of books and articles on the Web in HTML, or to provide les in SGML or common word pro-cessor format. To aid in this task, many translators have been written that read TEX or LATEX les and write the appropriate output. Translators that read TEX les directly, however have the common limi-tation of not understanding TEX’s macro language, or even being fooled by macros that simply redene a common command already known to the transla-tor. Add to this the inconsistency with which some authors (and typographers under the pressure of a deadline) code TEX les, and a uniform and univer-sal translator seems a hopeless task. TEX authors commonly write new macros that generate content or important layout not under-stood by the translator. In order to handle ar-bitrary macros the translator must be updated, or new translation tables supplied. Even then, a macro writer could fool the best translators by redening the input syntax to better suit idiosyncratic work habits. For this reason most TEX translators have targeted specic input languages, usually LATEX. This is the method used by LATEX2html and Sci-enti c Word, which are both discussed elsewhere in these proceedings (Deland, 1998, Moore, 1998). It is also the method used by IBM Techexplorer, which understands LATEX and a wide range of TEX’s I would like to thank Sebastian Rahtz and Eitan Gurari for their helpful comments on an early draft of this paper. I would also like to thank my managers at RPI, Gary Schwartz and Katherine Bursese, for the quiet time at work to nish this article, and for allowing me attend the Northeast TUG

Read the paper · More papers on PaperTik