{"id":297,"date":"2010-09-05T17:06:25","date_gmt":"2010-09-05T11:36:25","guid":{"rendered":"http:\/\/www.cvr.cc\/?p=297"},"modified":"2010-09-05T17:06:25","modified_gmt":"2010-09-05T11:36:25","slug":"tex4ht-overview-of-the-process","status":"publish","type":"post","link":"https:\/\/cvr.cc\/?p=297","title":{"rendered":"TeX4ht: Overview of the Process"},"content":{"rendered":"<p>\nT<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht system has the ability to translate any T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X or L<span style=\"position: relative; bottom: 0.3ex; margin-left: -0.36em; margin-right: -0.15em; text-transform: uppercase\"><small>a<\/small><\/span>T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X document into other markup formats such as <small>SGML, HTML, XML, M<\/small>ath<small>ML<\/small>, OpenOffice format, Braille, etc. <!--more-->  The system has an extensive load of T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X packages, hypertext fonts, a post-processor for <code>dvi<\/code> and another post-processor to generate <small>CSS<\/small> and image files of math formulae and equations. It works in three different stages. Given below is the summary (extracted from T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht&#8217;s documentation by Eitan), of how the translation process works.<\/p>\n<p>The system can be activated with a sequence of commands of the following form, typically embedded within a script.<\/p>\n<pre>\n       latex      x            (or \u2018tex x\u2019)\n       latex      x\n       latex      x\n       tex4ht     x\n       t4ht       x\n<\/pre>\n<\/p>\n<p>The three compilations with L<span style=\"position: relative; bottom: 0.3ex; margin-left: -0.36em; margin-right: -0.15em; text-transform: uppercase\"><small>a<\/small><\/span>T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X (or T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X) are needed to ensure proper links. The approach is illustrated in the following picture. <\/p>\n<figure id=\"attachment_307\" aria-describedby=\"caption-attachment-307\" style=\"width: 450px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/cvr.cc\/wp-content\/uploads\/2010\/09\/tex4ht-process2.png\"><img decoding=\"async\" src=\"https:\/\/cvr.cc\/wp-content\/uploads\/2010\/09\/tex4ht-process2.png\" alt=\"Translation process\" title=\"tex4ht-process\" width=\"450\"  class=\"size-full wp-image-307\" \/><\/a><figcaption id=\"caption-attachment-307\" class=\"wp-caption-text\">The schematic diagram of the translation process.<\/figcaption><\/figure>\n<ul>\n<li><code>x.tex<\/code>: This is a source T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X or L<span style=\"position: relative; bottom: 0.3ex; margin-left: -0.36em; margin-right: -0.15em; text-transform: uppercase\"><small>a<\/small><\/span>T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X or other T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X file that imports the style files <code>tex4ht.sty<\/code> and <code>*.4ht<\/code>. (The name is arbitrarily chosen for the purpose of our discussion here.) The style files define the features for the output.<\/li>\n<li><code>tex4ht<\/code>: The output of T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X is a standard <code>dvi<\/code> file interleaved with special instructions for the post-processor namely, <code>tex4ht<\/code> to use. The special instructions come from implicit and explicit requests made in the source file through commands of T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht.\n<p>The utility <code>tex4ht<\/code>, which is a binary program, translates the <code>dvi<\/code> code into standard text, while obeying the requests it gets from the special instructions. The special instructions may request the creation of files, insertion of <small>HTML<\/small> code, filtering of pictures, and so forth.<\/p>\n<p>In the extreme case that the source code contains no commands of T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht, <code>tex4ht<\/code> gets pure <code>dvi<\/code> code and it outputs (almost) plain text with no hypertext elements in it.<\/p>\n<p>The special (<code>special<\/code>) instructions seeded in the <code>dvi<\/code> code are not understood by <code>dvi<\/code> processors other than those of T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht.<\/p>\n<\/li>\n<li><code>x.idv<\/code>: This is a <code>dvi<\/code> file extracted from <code>x.dvi<\/code>, and it contains the images needed in the <small>HTML<\/small> files.<\/li>\n<li><code>x.lg<\/code>: This is a log file listing the pictures of <code>x.idv<\/code>, the png files that should be created, <small>CSS<\/small> information, and user directives introduced through the <code>Needs{...}<\/code> command.<\/li>\n<li><code>t4ht<\/code>: This is an interpreter for executing the requests made in the <code>x.lg<\/code> script.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>TeX4ht system has the ability to translate any TeX or LaTeX document into other markup formats such as SGML, HTML, XML, MathML, OpenOffice format, Braille, etc.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,15,16],"tags":[],"class_list":["post-297","post","type-post","status-publish","format-standard","hentry","category-process","category-tex","category-tex4ht"],"_links":{"self":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts\/297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=297"}],"version-history":[{"count":0,"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts\/297\/revisions"}],"wp:attachment":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}