
TEX4ht: HTML Production Eitan M. Gurari Ohio State University USA [email protected] http://www.cse.ohio-state.edu/~gurari Abstract TEX4ht is a highly configurable system for producing hypertext from TEX-based sources. The system is distributed with a large set of configuration files. The most commonly used configurations are those supporting LATEX inputs and HTML, MathML, OpenOffice, and DocBook targets. The first part of the presentation will describe how the system can be used for different applications. ConTEXt is a new addition to the style files being supported by TEX4ht. The second part of the presentation will describe the work done to provide TEX4ht configurations for ConTEXt, with the objective of offering an insight into the inner working of TEX4ht. 1 From LATEX to Hypertext command output comment htlatex abc abc.html HTML, bitmap math Reports authored in LAT X may be converted into E xhlatex abc abc.html XHTML, bitmap math hypertext through the T X4ht system [1]. The sys- E mzlatex abc abc.xml XHTML, MathML math tem offers an assortment of basic commands for in- oolatex abc abc.sxw OpenOffice XML voking translations to different target mark-up lan- (uses MathML math) guages, provides switches for requesting predefined dbmlatex abc abc.xml DocBook, MathML math variations to the default configurations, and lets the users tailor configurations of their own. Figure 1: Requests to compile abc.tex. 1.1 Basic Translations To activate a translation relying on a default con- their browsers. Yet, bitmap representations are vis- figuration, one needs just to invoke an appropri- ually inferior with respect to their surrounding text, ate command and provide it with the LAT X file E as they do not scale in size. In addition, non-visual name. Figure 1 lists a few examples. Most users of applications can make little use of these representa- the T X4ht system are probably familiar just with E tions. the htlatex option. However, the mzlatex option MathML introduces a markup language for ex- seems also to be quite popular. pressing mathematics, in a manner compatible with From the perspective of a user, the process is HTML support of regular text. Currently, not many similar to that employed in requesting a standard browsers come with built-in support for MathML. translation to DVI or PDF. In such cases, typically Mozilla is an example of a browser which supports the translations are requested through a command MathML. For Microsoft Internet Explorer, an easily named latex or pdflatex, respectively. installed plug-in program named MathPlayer offers HTML devotes very little support to mathe- similar capabilities [2]. Stylesheets are also available matics, providing only simple superscript and sub- to render MathML through XSLT and CSS code [3]. script elements. Bitmap representations are offered for mathematical expressions to try to address this 1.2 Available Adjustments shortcoming. Such representations are commonly The distribution of T X4ht provides configurations employed as most users are able to view them in E for default behavior, as well as configurations for This material is based upon work supported by the National achieving alternative outcomes. The latter configu- Science Foundation under Award No. IIS-0312487. Any opin- rations can be requested by referring to their named ions, findings, and conclusions or recommendations expressed in this publication are those of the author and do not neces- options through generalized invocation commands sarily reflect the views of the National Science Foundation. of the following form: TUGboat, Volume 25 (2004), No. 1 — Proceedings of the Practical TEX 2004 Conference 39 Eitan M. Gurari \documentclass{article} A Title \usepackage{makeidx} An Author \makeindex July 19, 2004 \title{A Title} \author{An Author} Contents \date{July 19, 2004} 1 First Section \begin{document} 2 Second Section \maketitle \tableofcontents 2.1 A Subsection 2.2 Another Subsection \section{First Section} Some text. 1 First Section Some text. \section{Second Section} \subsection{A Subsection} 2 Second Section Put \index{this}this 2.1 A Subsection and \cite{bib-1}. \subsection{Another Subsection} Put this and [1]. Put \index{this}this 2.2 Another Subsection and \index{that}that Put this and that and one, two, three. and \index{one}one, \index{two}two, References \index{three}three. [1] A bib entry. [2] Another bib entry. \begin{thebibliography}{99} \bibitem{bib-1} Index A bib entry. one, 1 \bibitem{bib-2} Another bib entry. that, 2 \end{thebibliography} this, 3, 4 \printindex three, 5 \end{document} two, 6 (a) (b) Figure 2: (a) A LATEX file source.tex. (b) A view of the HTML outcome of ‘htlatex source’. command-name file-name "html,options" direction. Navigation between siblings is possible through ‘next’ and ‘prev’ buttons. For instance, Figure 2(a) lists an example source LATEX file the ‘next’ button on the web page of the Second source.tex which requests standard logical struc- Section leads to the web page of the References. tures, including a title segment, sectioning blocks, A somewhat similar organization of content can table of contents, bibliography, and index. A com- be achieved with pilation of this file with the command htlatex source "html,index=2,3,next" htlatex source Figure 4 shows the result. Here, however, due to the produces the default outcome for HTML code. Fig- ‘next’ option, the ‘next’ and ‘prev’ navigation but- ure 2(b) shows a possible rendering of this outcome. tons assume a different ordering of pages in which A compilation of the same LATEX file with the document content is visited sequentially. For in- htlatex source "html,index=2,3" stance, under this option the ‘next’ button of the sets the index in two columns, and partitions the root web page leads to the web page of the table document into web pages based on the sectioning of contents. Similarly, the ‘next’ button of the web units to a depth of three levels. Figure 3 shows a page of Second Section leads to the web page of sub- possible rendering of the different web pages and section 2.1. On the other hand, the ‘next’ button their hierarchy in a tree structure. The tables of of the web page of subsection 2.2 leads to the web contents enable navigation down the tree levels, and page of the References. the ‘up’ buttons enable navigation in the opposite 40 TUGboat, Volume 25 (2004), No. 1 — Proceedings of the Practical TEX 2004 Conference TEX4ht: HTML Production [next] [tail] [up] Contents 1 First Section 2 Second Section 2.1 A Subsection 2.2 Another Subsection [next] [front] [up] [next] [prev] [prev-tail] [tail] [up] 1 First Section Some text. [next] [tail] [up] A Title [next] [prev] [prev-tail] [front] [up] 2.1 A Subsection An Author [next] [prev] [prev-tail] [tail] [up] Put this and [1]. July 19, 2004 [next] [front] [up] Contents 2 Second Section 1 First Section [prev] [prev-tail] [tail] 2.1 A Subsection [up] 2 Second Section 2.2 Another Subsection 2.1 A Subsection [next] [prev] [prev-tail] [front] [up] 2.2 Another Sub- 2.2 Another Subsection section References [next] [prev] [prev-tail] [tail] [up] Put this and that Index and one, two, three. References [prev] [prev-tail] [1] A bib entry. [front] [up] [2] Another bib entry. [next] [prev] [prev-tail] [front] [up] [prev] [prev-tail] [tail] [up] Index one, 1 three, 5 that, 2 two, 6 this, 3, 4 [prev] [prev-tail] [front] [up] Figure 3: A view of the HTML outcome of ‘htlatex source "html,index=2,3"’. This produces the index in two columns, and separates sections to the third level into their own files. TUGboat, Volume 25 (2004), No. 1 — Proceedings of the Practical TEX 2004 Conference 41 Eitan M. Gurari [next] [prev] [prev-tail] [tail] [up] Contents 1 First Section 2 Second Section 2.1 A Subsection 2.2 Another Subsection [next] [prev] [prev-tail] [front] [up] [next] [prev] [prev-tail] [tail] [up] 1 First Section [next] [prev] Some text. [prev-tail] [tail] [up] A Title [next] [prev] [prev-tail] [front] [up] 2.1 A Subsection An Author Put this and [1]. July 19, 2004 [next] [prev] [prev-tail] [tail] [up] [next] [prev] Contents 2 Second Section [prev-tail] [front] [up] 1 First Section 2 Second Section 2.1 A Subsection [next] [prev] 2.1 A Subsection 2.2 Another Subsection [prev-tail] [tail] [up] 2.2 Another Subsection [next] [prev] [prev-tail] [front] [up] 2.2 Another Sub- References section Index [next] [prev] [prev-tail] [tail] [up] Put this and that [next] References and one, two, three. [next] [prev] [1] A bib entry. [prev-tail] [front] [up] [2] Another bib entry. [next] [prev] [prev-tail] [front] [up] [prev] [prev-tail] [tail] [up] Index one, 1 three, 5 that, 2 two, 6 this, 3, 4 [prev] [prev-tail] [front] [up] Figure 4: A view of the HTML outcome of ‘htlatex source "html,index=2,3,next"’. Similar to the previous figure, but with sequential navigation, due to the next option. 42 TUGboat, Volume 25 (2004), No. 1 — Proceedings of the Practical TEX 2004 Conference TEX4ht: HTML Production /.../texmf/tex/generic/tex4ht/tex4ht.sty \documentclass{article} version 2004-05-26-22:19 \def\greeting{Hi} -- Note -- for automatic sectioning pagination, use \begin{document} the command line option ‘1’, ‘2’, or ‘3’ \greeting{} from \LaTeX{}! \end{document} -- Note -- for i-columns index, use the command line (a) option ‘index=i’ (e.g., index=2) \Preamble{html} -- Note -- for linear crosslinks of pages, use the \begin{document} command line option ‘next’ \def\greeting{Hello} -- Note -- for inline footnotes use \def\LaTeX{}{\TeX4ht{}} command line option ‘fn-in’ \EndPreamble (b) -- Note -- for content and toc in 2 frames, use the command line option ‘frames’ Figure 6: (a) A LATEX file src.tex.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages9 Page
-
File Size-