diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/tex4ht/mn-commands.html')
-rw-r--r-- | Master/texmf-dist/doc/generic/tex4ht/mn-commands.html | 794 |
1 files changed, 794 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/tex4ht/mn-commands.html b/Master/texmf-dist/doc/generic/tex4ht/mn-commands.html new file mode 100644 index 00000000000..8a612ca054c --- /dev/null +++ b/Master/texmf-dist/doc/generic/tex4ht/mn-commands.html @@ -0,0 +1,794 @@ +<?xml version="1.0" encoding="iso-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd--> +<html xmlns="http://www.w3.org/1999/xhtml" +> +<head><title>calling commands</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)" /> +<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)" /> +<!-- xhtml,th4,index --> +<meta name="src" content="mn.tex" /> +<link rel="stylesheet" type="text/css" href="mn.css" /> +</head><body +> + <p class="rightline"><a + href="mn.html#mn-commands.html" >up</a></p> + <h2 class="ChapterHead"><a + name="QQ1-9-33"></a>Calling Commands</h2><div class="TableOfContents"><span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-34" name="QQ2-9-34">From LaTeX to HTML</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-35" name="QQ2-9-35">Available Values for the Options</a></span> +<span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-36" name="QQ2-9-36">XHTML and Unicode</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-37" name="QQ2-9-37">XHTML with MathML</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-38" name="QQ2-9-38">OpenDocument, OpenOffice, and +MS Word</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-39" name="QQ2-9-39">DocBook and TEI</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-40" name="QQ2-9-40">JavaHelp</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-41" name="QQ2-9-41">Private Configuration Files</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-42" name="QQ2-9-42">Creating +Private Command Lines</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-43" name="QQ2-9-43">An Insight into the Commands</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-44" name="QQ2-9-44">A Deeper Insight</a></span> +<span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-45" name="QQ2-9-45">TeX, ConTeXt, and TeXi</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-47" name="QQ2-9-47">Other Options</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-48" name="QQ2-9-48">Validation</a></span> <span class="DocChapter"><span +class="cmsy-10">∙</span> <a + href="#QQ1-9-49" name="QQ2-9-49">Recommendations</a></span> + </div> + <h2 class="ChapterHead"><a + name="QQ1-9-34"></a>From LaTeX to HTML</h2> +<!--l. 4258--><p class="noindent" ><a + name="features"></a>The translation of a LaTeX source file into HTML involves of loading <span +class="cmtt-10">tex4ht.sty </span>and *.4ht style files, choosing the +desirable options for the translation, compiling the source into <span +class="cmtt-10">dvi </span>code with the native LaTeX engine, and +postprocessing the outcome with the <span +class="cmtt-10">tex4ht </span>and <span +class="cmtt-10">t4ht </span>programs (see <a + href="mn39.html" >overview</a>). +</p><!--l. 4267--><p class="indent" > <a + name="index9-34001"></a>The <span +class="cmtt-10">htlatex </span>command loads a script which takes on itself to invoke the different steps of the process, without +user intervention. The command assumes the form +</p> + <div +class="centerline"><span +class="cmtt-10">htlatex filename "</span><span +class="cmti-10">options1</span><span +class="cmtt-10">" "</span><span +class="cmti-10">option2</span><span +class="cmtt-10">" "</span><span +class="cmti-10">options3</span><span +class="cmtt-10">" "</span><span +class="cmti-10">options4</span><span +class="cmtt-10">"</span></div> +<!--l. 4276--><p class="noindent" >where the first set of options is for the <span +class="cmtt-10">tex4ht.sty </span>and <span +class="cmtt-10">*.4ht </span>style files, the second set is for the <span +class="cmtt-10">tex4ht</span> +postprocessor, the third for the <span +class="cmtt-10">t4ht </span>postprocessor, and the last one is for the LaTeX compiler. For +instance, +</p><!--l. 4290--><p class="indent" > +</p><dl > <dt><span +class="cmtt-10">htlatex filename</span></dt><dd> +This command requests a translation according to the default conditions, which are set to produce HTML +transitional 4.0 code. + </dd><dt><span +class="cmtt-10">htlatex filename "html,2,info"</span></dt><dd> +This command is equivalent to the previous one, specifying explicitly the option <span +class="cmtt-10">html </span>for <span +class="cmtt-10">tex4ht.sty </span>instead of +doing so implicitly. +<!--l. 4300--><p class="indent" > In addition, the command requests a break up of the output into separate web pages, in accordance to the two +top sectioning levels of the document. +</p><!--l. 4304--><p class="indent" > Moreover, it asks for a listing in the log file of the information available for the style files in use. +That information, among other things, also introduces additional values available for the first list of +options. +</p> + </dd><dt><span +class="cmtt-10">htlatex filename "" "dbcs/!"</span></dt><dd> +This command requests the loading of the dbcs branch of Chinese hypertext fonts (on top of those already requested +by the default setting). + </dd><dt> <a + name="index9-34002"></a> <a + name="index9-34003"></a> <a + name="index9-34004"></a> <a + name="index9-34005"></a> <a + name="index9-34006"></a><span +class="cmtt-10">htlatex filename "foo,frames" "" "-p"</span></dt><dd> +This command requests LaTeX to load a private configuration file, named <span +class="cmtt-10">foo.cfg</span>, and to place the +content and table of contents in separate frames. In addition, it asks <span +class="cmtt-10">t4ht </span>not to produce bitmaps for +pictures. + </dd><dt><span +class="cmtt-10">htlatex filename "" " -ciso2htf" "" "-translate-file=il2-pl"</span></dt><dd> +This command invokes the LaTeX compiler with the instruction ‘<span +class="cmtt-10">latex -translate-file=il2-plfilename</span>’. + </dd></dl> + + <h2 class="ChapterHead"><a + name="QQ1-9-35"></a>Available Values for the Options</h2> +<!--l. 4343--><p class="noindent" ><a + name="index9-35001"></a>The fields of <span +class="cmti-10">option1 </span>should be separated by commas. An ‘<span +class="cmtt-10">info</span>’ field requests a listing in the .log file of many of the +the available values. If the list is not empty, it must start with the entry ‘<span +class="cmtt-10">html</span>’, ‘<span +class="cmtt-10">xhtml</span>’, or a name of a private +configuration file. +</p><!--l. 4350--><p class="indent" > The fields of <span +class="cmti-10">option2 </span>and <span +class="cmti-10">options3 </span>should be separated by spaces. The available values can be listed by +executing the postprocessors <span +class="cmtt-10">tex4ht.c </span>and <span +class="cmtt-10">t4ht.c</span>, respectively, without arguments (or with wrong sets of +arguments). +</p><!--l. 4355--><p class="indent" > The first field of <span +class="cmti-10">option2 </span>should be empty or a subdirectory of <span +class="cmtt-10">ht-fonts </span>(typically augmented with an +exclamation mark ‘<span +class="cmtt-10">!</span>’). A space should separate the first field from the second one, also when the first field is +empty. +</p><!--l. 4360--><p class="indent" > The underlying output formats of available <span +class="cmtt-10">htlatex</span>-like commands are tailored into the commands through +fields of <span +class="cmti-10">option1</span>. The names of these fields are defined in <span +class="cmtt-10">tex4ht.4ht </span>and <span +class="cmtt-10">tex4ht.usr </span>(see <a + href="mn11.html#confFiles">General Configuration +Files</a>). These values should be of little interest to most users. +</p><!--l. 4368--><p class="indent" > <a + name="index9-35002"></a> <a + name="index9-35003"></a>Different variants of the <span +class="cmtt-10">htlatex </span>command may be invoked by introducing the commands as +arguments to a driver named <span +class="cmtt-10">mk4ht</span>. When provided without arguments, the driver lists the commands it +recognizes. +</p> + <table id="TBL-1" +><tr style="vertical-align:top;" > +<td style="white-space: nowrap; margin-right:2em;" +> <span +class="cmtt-10">mk4ht mzlatex filename "html,3" </span></td><td +><span +class="cmtt-10">(htlatex filename "html,3,xhtml,mozilla" "</span><span +class="cmtt-10"> -cmozhtf")</span> +</td></tr><tr style="vertical-align:top;" > +<td style="white-space: nowrap; margin-right:2em;" +> <span +class="cmtt-10">mk4ht oolatex filename </span></td><td +><span +class="cmtt-10">(htlatex filename "xhtml,ooffice" "ooffice/!</span><span +class="cmtt-10"> -cmozhtf" "-coo")</span> +</td></tr></table> +<!--l. 4382--><p class="indent" > <a + name="index9-35004"></a>Alternatively, a compilation ‘<span +class="cmtt-10">latex mkht-scripts.4ht</span>’ produces different named scripts of similar +functionality. +</p> + <h2 class="ChapterHead"><a + name="QQ1-9-36"></a>XHTML and Unicode</h2> <a + name="index9-36001"></a> <a + name="index9-36002"></a> <a + name="index9-36003"></a> <a + name="index9-36004"></a>The ‘<span +class="cmtt-10">xhlatex</span>’ command is a variant of the ‘<span +class="cmtt-10">htlatex</span>’ command requesting XHTML +output. It consists just of a call to ‘<span +class="cmtt-10">htlatex</span>’ with the entry ‘<span +class="cmtt-10">xhtml</span>’ in the first list of options and ‘<span +class="cmtt-10">-cvalidate</span>’ in +the third list. For instance, ‘<span +class="cmtt-10">xhlatex filename</span>’ or ‘<span +class="cmtt-10">htlatex filename "xhtml"</span>’. +<!--l. 4400--><p class="noindent" >To request a Unicode representation of symbols, the first list of options should include the ‘<span +class="cmtt-10">uni-html4</span>’ entry, and +the second list should include the ‘<span +class="cmtt-10">-cunihtf</span>’ entry preceded by space. For instance, ‘<span +class="cmtt-10">xhlatex filename</span> +<span +class="cmtt-10">"xhtml,uni-html4" " -cunihtf"</span>’. +</p><!--l. 4406--><p class="indent" > Unicode representations of symbols in UTF-8 encoding may be requested with the entry ‘<span +class="cmtt-10">-utf8</span>’ +added to the second list. For instance, ‘<span +class="cmtt-10">xhlatex filename "xhtml,charset=utf-8" " -cunihtf</span> +<span +class="cmtt-10">-utf8"</span>’. +</p><!--l. 4413--><p class="indent" > To request expanded usage of unicode values in iso-8859-1 output employ commands similar to +</p> + <div +class="centerline"><span +class="cmtt-10">htlatex file "" "iso8859/1/charset/uni/!"</span></div> +<!--l. 4419--><p class="noindent" >or introduce a similar charset path in tex4ht.env. Otherwise, non iso-8859-1 characters might obtain bitmap +representations. +</p> + <h2 class="ChapterHead"><a + name="QQ1-9-37"></a>XHTML with MathML</h2> +<!--l. 4428--><p class="noindent" ><a + name="index9-37001"></a> <a + name="index9-37002"></a> <a + name="index9-37003"></a> <a + name="index9-37004"></a> <a + name="index9-37005"></a> <a + name="index9-37006"></a>TeX4ht has different configurations for different modes of output. It is distributed with pre-tailored base +configurations for translating LaTeX math into MathML, and extra configurations for adjusting the outcome to +Mozilla, MathPlayer, and PMathML CSS. Only presentational MathML is supported. +</p><div class="Verbatim"><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> mzlatex</span><span +class="cmtt-10"> filename</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> mzlatex</span><span +class="cmtt-10"> filename</span><span +class="cmtt-10"> "html,pmathml"</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> mzlatex</span><span +class="cmtt-10"> filename</span><span +class="cmtt-10"> "html,mathml-"</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> mzlatex</span><span +class="cmtt-10"> filename</span><span +class="cmtt-10"> "html,mathplayer"</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> xhmlatex</span><span +class="cmtt-10"> filename</span><span +class="cmtt-10"> </span> +<br /></div> +<!--l. 4452--><p class="indent" > For XHTML+MathML to be served both by Mozilla and MSIE+MathPlayer use the command line option +‘mathplayer’. +</p><!--l. 4456--><p class="indent" > The <span +class="cmtt-10">mzlatex </span>command is a short cut representation for the command ‘<span +class="cmtt-10">htlatex filename "xhtml,mozilla"</span> + +<span +class="cmtt-10">" -cmozhtf" "-cvalidate"</span>’. It take into account special needs of browsers. The <span +class="cmtt-10">xhmlatex </span>command is a short cut +representation for the command ‘<span +class="cmtt-10">htlatex filename "xhtml,mathml" " -cunihtf" "-cvalidate"</span>’; it does not +make any compromizes toward browsers. +</p><!--l. 4464--><p class="indent" > It might be worthwhile to notice some of the more <a + href="mml.html#mml-prob">common sources of problems</a> for MathML. <a + name="index9-37007"></a>The ‘<span +class="cmtt-10">mathml-</span>’ +options asks for a degraded MathML output that sidetracks some of the problems. +</p> + <h2 class="ChapterHead"><a + name="QQ1-9-38"></a>OpenDocument, OpenOffice, and MS Word</h2> +<!--l. 4475--><p class="noindent" ><a + name="index9-38001"></a> <a + name="index9-38002"></a> <a + name="index9-38003"></a> <a + name="index9-38004"></a> <a + name="index9-38005"></a> <a + name="index9-38006"></a>A translation for an OpenDocument format can be requested by the ‘<span +class="cmtt-10">\oolatex</span>’ command. The command is a +variant of <span +class="cmtt-10">htlatex </span>in which the first list of options holds the entries ‘<span +class="cmtt-10">xhtml,ooffice</span>’, the second list holds the +entry ‘<span +class="cmtt-10">-cmozhtf</span>’ preceded by a space, and the third list contains ‘<span +class="cmtt-10">-coo</span>’ (<span +class="cmtt-10">htlatex filename "xhtml,ooffice"</span> +<span +class="cmtt-10">"ooffice/!</span><span +class="cmtt-10"> -cmozhtf" "-coo -cvalidate"</span>). The output of a command ‘<span +class="cmtt-10">oolatex filename</span>’ is a zipped file +named with a ‘<span +class="cmtt-10">.odt</span>’ extension. +</p><!--l. 4495--><p class="indent" > The OpenDocument code employs MathML for formulas, and XSL-FO for formatting. It can be viewed by the +<a + href="http://www.openoffice.org/" >OpenOffice</a> word processor which, in turn, can export RTF and other MicroSoft-based formats (see also, Maarten +Wisse, “Hacking TeX4ht for XML Output: The Road toward a TeX to Word Convertor”, <a + href="http://www.ntg.nl/maps/electromaps.html" >MAPS</a> 28 (2002), +pp. 28-35). +</p><!--l. 4507--><p class="indent" > A command of the form ‘<span +class="cmtt-10">htlatex filename "html,word" "symbol/!" "-cvalidate"</span>’ asks for HTML +output tuned toward MicroSoft Word. Such a format, however, relies on bitmaps for mathematical +formulas. +</p> + <h2 class="ChapterHead"><a + name="QQ1-9-39"></a>DocBook and TEI</h2> +<!--l. 4516--><p class="noindent" ><a + name="index9-39001"></a> <a + name="index9-39002"></a> <a + name="index9-39003"></a> <a + name="index9-39004"></a> <a + name="index9-39005"></a> <a + name="index9-39006"></a> <a + name="index9-39007"></a> <a + name="index9-39008"></a> <a + name="index9-39009"></a> <a + name="index9-39010"></a>The following commands may be used for requesting DocBook and TEI output. +</p> + <table id="TBL-2" +><tr > +<td +><span +class="cmtt-10">dbmlatex: </span></td><td +><span +class="cmtt-10">htlatex </span><span +class="cmti-10">filename </span><span +class="cmtt-10">"xhtml,docbook-mml" " -cunihtf" "-cdocbk"</span></td></tr><tr > +<td +><span +class="cmtt-10">dblatex:</span></td><td +><span +class="cmtt-10">htlatex </span><span +class="cmti-10">filename </span><span +class="cmtt-10">"xhtml,docbook" " -cunihtf" "-cdocbk"</span></td></tr><tr > +<td +><span +class="cmtt-10">teimlatex:</span></td><td +><span +class="cmtt-10">htlatex </span><span +class="cmti-10">filename </span><span +class="cmtt-10">"xhtml,tei-mml" " -cunihtf" "-cdocbk"</span></td></tr><tr > +<td +><span +class="cmtt-10">teilatex:</span></td><td +><span +class="cmtt-10">htlatex </span><span +class="cmti-10">filename </span><span +class="cmtt-10">"xhtml,tei" " -cunihtf" "-cdocbk" </span></td></tr></table> + <h2 class="ChapterHead"><a + name="QQ1-9-40"></a>JavaHelp</h2> +<!--l. 4547--><p class="noindent" ><a + name="index9-40001"></a> <a + name="index9-40002"></a><a + href="http://java.sun.com/products/javahelp/index.jsp" >JavaHelp</a> is an online documentation system for use by Java-based applications. Such documents can be +produced from LaTeX files through commands similar to ‘<span +class="cmtt-10">jhlatex </span><span +class="cmti-10">filename</span>’ for JavaHelp version +2.0. +</p><!--l. 4554--><p class="indent" > The above invocation stands for ‘<span +class="cmtt-10">htlatex </span><span +class="cmti-10">filename </span><span +class="cmtt-10">"html,3.2,xml,javahelp,unicode" " -cmozhtf</span> +<span +class="cmtt-10">-u10" "-dfilename-doc/ -cjavahelp"</span>’. The ‘<span +class="cmtt-10">-u10</span>’ asks for entity references in base 10—JavaHelp +doesn’t seem to support hexadecimal representations. The <span +class="cmtt-10">-cjavahelp </span>invokes the JavaHelp indexer to +produce the search database at ‘jobname-doc/jobname-jhs’ with a command similar to ‘<span +class="cmtt-10">java -jar</span> +<span +class="cmtt-10">${HOME}/jh2.0/javahelp/bin/jhindexer.jar -db jobname-doc/jobname-jhs jobname*.html</span>’. +</p><!--l. 4566--><p class="indent" > The Java program is to be distributed with the jobname-doc directory. +</p> + <h2 class="ChapterHead"><a + name="QQ1-9-41"></a>Private Configuration Files</h2> +<!--l. 4715--><p class="noindent" ><a + name="index9-41001"></a><a + name="prvCfgFiles"></a>The leading entry, in the first list of options of the <span +class="cmtt-10">htlatex</span>-like commands, can equal ‘<span +class="cmtt-10">html</span>’ or ‘<span +class="cmtt-10">xhtml</span>’. If this is not +the case, the entry is assumed to be the name of a configuration file. The extension ‘<span +class="cmtt-10">cfg</span>’ is assumed for names of +configuration files that are listed without their extension. +</p><!--l. 4723--><p class="indent" > A configuration file should take the following form for LaTeX files. +</p> + <div class="Template"> <span +class="cmtt-10">...</span><span +class="cmti-10">early definitions</span><span +class="cmtt-10">...</span><br /> +<span +class="cmtt-10">\Preamble{</span><span +class="cmti-10">options</span><span +class="cmtt-10">}</span><br /> +<span +class="cmtt-10">...</span><span +class="cmti-10">definitions</span><span +class="cmtt-10">...</span><br /> +<span +class="cmtt-10">\begin{document}</span><br /> +<span +class="cmtt-10">...</span><span +class="cmti-10">insertions into the header of the html file</span><span +class="cmtt-10">...</span><br /> +<span +class="cmtt-10">\EndPreamble </span></div> +<!--l. 4737--><p class="indent" > It is up to the user to decide the distribution of entries between the <span +class="cmtt-10">\Preamble </span>and the <span +class="cmtt-10">htlatex</span>-like +commands. + +</p> + <div class="EXAMPL"><span +class="cmbx-10">Example </span>The command ‘<span +class="cmtt-10">htlatex myfile "mycfg,2"</span>’ requests the compilation of a file named myfile.tex, in +the presence of a configuration file named mycfg.cfg. The configuration file might have the following +content. +<div class="Verbatim"><span +class="cmtt-10">\Preamble{html}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10">\begin{document}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> \Css{body</span><span +class="cmtt-10"> {</span><span +class="cmtt-10"> color</span><span +class="cmtt-10"> :</span><span +class="cmtt-10"> red;</span><span +class="cmtt-10"> }}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10">\EndPreamble</span><span +class="cmtt-10"> </span> +<br /></div> + </div> + <div class="Notes"><span +class="cmbx-10">Notes</span> +<ul > +<li>Notice that for a LaTeX file the <span +class="cmtt-10">\begin{document} </span>instruction should be present both in the configuration file and +the source file. +<!--l. 4760--><p class="noindent" ></p></li> +<li>Instructions defined within a source file may be redefined in a configuration file. Such a feature enables to keep +source files intact for compilation to different formats by different tools. +<!--l. 4765--><p class="indent" > For instance, a definition of the form <span +class="cmtt-10">\renewcommand\mycommand{...} </span>within a configuration file provided for +the following LaTeX source. +</p><div class="Verbatim"><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> \documentclass{...}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> \newcommand\mycommand{...}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> \begin{document}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> Use</span><span +class="cmtt-10"> \mycommand{...}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> \end{document}</span><span +class="cmtt-10"> </span> +<br /></div> + </li></ul> + </div> + <h2 class="ChapterHead"><a + name="QQ1-9-42"></a>Creating Private Command Lines</h2> +<!--l. 4789--><p class="noindent" ><a + name="index9-42001"></a> <a + name="index9-42002"></a> +</p><!--l. 4792--><p class="indent" > A htlatex-like script <span +class="cmtt-10">foolatex.bat </span>can be obtained from the compilation under LaTeX of a file similar to the +following one. +</p><div class="Verbatim"><span +class="cmtt-10"> \def\script{bat}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> \input</span><span +class="cmtt-10"> mkht.4ht</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> \one{,html,next,3}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> \two{-ic:\tex4ht\texmf\tex4ht\ht-fonts\#1</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> </span><span +class="cmtt-10"> -ic:\tex4ht\texmf\tex4ht\ht-fonts\symbol\!}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> \three{#1</span><span +class="cmtt-10"> -dc:\my\dir}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> \make{foo}</span><span +class="cmtt-10"> </span> +<br /><span +class="cmtt-10"> \end{document}</span><span +class="cmtt-10"> </span> +<br /></div> +<!--l. 4806--><p class="indent" > A call of the form +</p> + <div +class="centerline"><span +class="cmtt-10">foolatex filename</span></div> +<!--l. 4810--><p class="indent" > is then equivalent to a call of the following form. +</p> + <div +class="centerline"><span +class="cmtt-10">htlatex filename "html,next,3" "symbol/!" "-dc:\my\dir"</span></div> +<!--l. 4816--><p class="indent" > Scripts obtained in such a manner can embed parameters within their bodies instead of expecting the +parameters to be provided in command lines. +</p><!--l. 4819--><p class="indent" > Details regarding the available options can be found by compiling under LaTeX a file of the following +form. +</p> + <div +class="centerline"><span +class="cmtt-10">\input mkht.4ht \end{document}</span></div> + +<!--l. 4825--><p class="indent" > The compilation requires the <span +class="cmtt-10">ProTex.sty </span>and <span +class="cmtt-10">AlProTex.sty </span>files available at +<a + href="http://www.cse.ohio-state.edu/~gurari/systems.html." ><span +class="cmtt-10">http://www.cse.ohio-state.edu/~gurari/systems.html</span></a>. +</p> + <h2 class="ChapterHead"><a + name="QQ1-9-43"></a>An Insight into the Commands</h2> +<!--l. 4843--><p class="noindent" >Given a LaTeX file + </p><div class="ShowCode"> + <br /> <span +class="cmtt-10">\documentclass{article}</span> + <br /> <span +class="cmtt-10">\begin{document}</span> + <br /> <span +class="cmtt-10">..................</span> + <br /> <span +class="cmtt-10">\end{document}</span> +</div> +<!--l. 4853--><p class="noindent" >the ‘<span +class="cmtt-10">htlatex </span><span +class="cmti-10">filename</span>’ command produces a call ‘<span +class="cmtt-10">latex </span><span +class="cmti-10">filename</span>’ to LaTeX on an implicit file of the following +form. + </p><div class="ShowCode"> + <br /> <span +class="cmtt-10">\documentclass{article}</span> + <br /> <span class="showcode"><span +class="cmtt-10">\usepackage{tex4ht}</span></span> + <br /> <span +class="cmtt-10">\begin{document}</span> + <br /> <span +class="cmtt-10">..................</span> + <br /> <span +class="cmtt-10">\end{document}</span> +</div> +<!--l. 4867--><p class="noindent" >Similarly, the command ‘<span +class="cmtt-10">htlatex </span><span +class="cmti-10">filename </span><span +class="cmtt-10">"</span><span +class="cmti-10">options</span><span +class="cmtt-10">"</span>’ produces a call to a ‘<span +class="cmtt-10">latex </span><span +class="cmti-10">filename</span>’ command on an +implicit file of the following form. + </p><div class="ShowCode"> + <br /> <span +class="cmtt-10">\documentclass{article}</span> + <br /> <span +class="cmtt-10">\usepackage[</span><span class="showcode"><span +class="cmtt-10">options</span></span><span +class="cmtt-10">]{tex4ht}</span> + <br /> <span +class="cmtt-10">\begin{document}</span> + <br /> <span +class="cmtt-10">..................</span> + <br /> <span +class="cmtt-10">\end{document}</span> +</div> + <a + name="index9-43001"></a>The command ‘<span +class="cmtt-10">ht latex </span><span +class="cmti-10">filename </span>’ may be used, instead of the ‘<span +class="cmtt-10">htlatex </span><span +class="cmti-10">filename </span><span +class="cmtt-10">"</span><span +class="cmti-10">options</span><span +class="cmtt-10">"</span>’ command, in +cases that the <span +class="cmtt-10">\usepackage </span>instruction is explicitly introduced into the source files. + <h2 class="ChapterHead"><a + name="QQ1-9-44"></a>A Deeper Insight</h2> +<!--l. 4893--><p class="noindent" >From the perspective of TeX4ht, the <span +class="cmtt-10">htlatex</span>-like commands, and the <span +class="cmtt-10">\usepackage</span>, are indirect approaches for +getting LaTeX files of the following form. Such files can be explicitly provided for compilations requested through +the ‘<span +class="cmtt-10">ht latex </span><span +class="cmti-10">filename</span>’ command. + </p><div class="ShowCode"> + <br /> <span +class="cmtt-10">\documentclass{article}</span> + <br /> <span +class="cmtt-10">.....</span> + <br /> <span +class="cmtt-10">\input</span> <span +class="cmtt-10">tex4ht.sty</span> + <br /> <span +class="cmtt-10">.....</span> + <br /> <span +class="cmtt-10">\Preamble{</span><span class="showcode"><span +class="cmtt-10">options</span></span><span +class="cmtt-10">}</span> + <br /> <span +class="cmtt-10">.....</span> + <br /> <span +class="cmtt-10">\begin{document}</span> + <br /> <span +class="cmtt-10">.....</span> + <br /> <span +class="cmtt-10">\EndPreamble</span> + <br /> <span +class="cmtt-10">..................</span> + <br /> <span +class="cmtt-10">\end{document}</span> +</div> + <h2 class="ChapterHead"><a + name="QQ1-9-45"></a>TeX, ConTeXt, and TeXi</h2> +<!--l. 4923--><p class="noindent" ><a + name="index9-45001"></a> <a + name="index9-45002"></a> <a + name="index9-45003"></a> <a + name="index9-45004"></a>Commands similar to those offered for LaTeX are also offered for TeX (dbmtex, dbtex, ht, httex, mztex, ootex, +t4ht, teimtex, teitex, tex4ht, xhmtex, xhtex) and TeXi (dbmtexi, dbtexi, httexi, mztexi, ootexi, teimtexi, teitexi, +xhmtexi, xhtexi). In the case of TeX, the fragment of code ‘<span +class="cmtt-10">\csname tex4ht\endcsname</span>’ should be introduced + +by the user into the source file, after the preamble of the file where the document definitions reside +(<a + href="mn10.html" name="mn10.html" >example</a>). In the case of TeXi, such a code fragment is introduced implicitly. +</p><!--l. 4951--><p class="indent" > The private configuration files are similar to those of LaTeX, with the instruction ‘<span +class="cmtt-10">\begin{document}</span>’ +excluded. +</p> + <div class="Template"> <span +class="cmtt-10">...</span><br /> +<span +class="cmtt-10">\Preamble{</span><span +class="cmti-10">options</span><span +class="cmtt-10">}</span><br /> +<span +class="cmtt-10">...</span><br /> +<span +class="cmtt-10">\begin{document}</span><br /> +<span +class="cmtt-10">...</span><br /> +<span +class="cmtt-10">\EndPreamble</span><br /> +<span +class="cmtt-10">... </span></div> + The ‘<span +class="cmtt-10">ht tex </span><span +class="cmti-10">filename </span>’ and ‘<span +class="cmtt-10">ht texi </span><span +class="cmti-10">filename </span>’ commands may apply for TeX and TeXi sources that embed +such code fragments in their body. The embeded code should replace the ‘<span +class="cmtt-10">\csname tex4ht\endcsname</span>’ fragment in +TeX sources, be palces at the strat of the files in TeXi sources, and not include the <span +class="cmtt-10">\begin{document}</span> +instruction. +<!--l. 4975--><p class="indent" > <a + name="index9-46001"></a> <a + name="index9-46002"></a>For <a + href="http://www.pragma-ade.com/" >ConTeXt</a> similar instructions apply with suffixes ‘<span +class="cmtt-10">context</span>’ instead of ‘<span +class="cmtt-10">latex</span>’, ‘<span +class="cmtt-10">tex</span>’, or ‘<span +class="cmtt-10">texi</span>’. For +instance, ‘<span +class="cmtt-10">htcontext’ </span>. +</p> + <h2 class="ChapterHead"><a + name="QQ1-9-47"></a>Other Options</h2> +<!--l. 4988--><p class="noindent" > +</p><ul > +<li> <a + name="index9-47001"></a>XeTeX files can be compiled with htlatex-like instructions (e.g., htxelatex, htxetex, mzxelatex). Currently only +partial support is provided and only TeX-based fonts are handled. </li> +<li> <a + name="index9-47002"></a>A <a + href="http://www.math.union.edu/~dpvc/jsMath/welcome.html" >jsMath</a> mode of output may be requested with instructions similar to the following one. + <div +class="centerline"><span +class="cmtt-10">htlatex file "xhtml,jsmath" " -cmozhtf"</span></div> +<!--l. 5001--><p class="noindent" ></p></li> +<li> <a + name="index9-47003"></a>The dvipng utility might be activated for bitmap constructions through a request ‘-cdvipng’ in the third options +list. For instance, + <div +class="centerline"><span +class="cmtt-10">htlatex file "" "" "-cdvipng"</span></div> +<!--l. 5008--><p class="indent" > This utility is reported to produce fast high quality output with much smaller files than other +convertors. +</p><!--l. 5011--><p class="noindent" ></p></li> +<li> <a + name="index9-47004"></a>TeX4ht offers also <a + href="http://www.cse.ohio-state.edu/~gurari/laspeak" >speech</a> output formats. + </li></ul> + <h2 class="ChapterHead"><a + name="QQ1-9-48"></a>Validation</h2> +<!--l. 5023--><p class="noindent" ><a + name="index9-48001"></a>The outcome of the translations should be checked by validators for proper syntax. Typically, with the presence of +validators, errors are easy to detect and correct, but they require human intervention. +</p><!--l. 5028--><p class="indent" > TeX4ht doesn’t offer a built-in parser to verify the correctness of the outcome. However, external validator(s) +can quite easily be integrated into the compilation process. +</p> + <h2 class="ChapterHead"><a + name="QQ1-9-49"></a>Recommendations</h2> +<!--l. 5037--><p class="noindent" >To keep with the spirit of LaTeX and hypertext, in which style is assumed to be separated from content, the users +are encouraged to avoid inserting TeX4ht code into their source files. Instead, they should place their +modifications, to the default settings, within private configuration files to be loaded by htlatex-like +commands. +</p><!--l. 5044--><p class="indent" > On the other hand, it should be noted that hypertext markings should adhere to strict rules specified by +different standards. Consequently, it is strongly advised to check the output obtained from the default +configurations, before trying to tailor new ones. + +</p> + +</body></html> |