<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
</p>
<div class="moz-text-html" lang="x-unicode"> Hi Karl, <br>
<br>
Sorry for taking so long to get back.<br>
<div>
<div><font class="Apple-style-span" color="#000000"><br>
</font><br>
<blockquote> How do I test if there are no side
effects in the generated output files?<br>
</blockquote>
</div>
<br>
<div><br>
My ad-hock testing approach:</div>
<div>0. set \version macro to a fixed string in common.tex. <br>
</div>
<div><br>
</div>
<div>1. (before patch)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>run
make all</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>commit
all files to git</div>
<div>2. apply patch</div>
<div><br>
</div>
<div>3. <br>
run clean + cleaning manually<br>
run make all</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>git
diff</div>
<div><br>
</div>
<div>I did not try to diff against TeX Live, but against the
version before a patch.</div>
<div>To minimize the noise, I set \version to \versionDebug
(fixed string) in common.tex. </div>
<div>To exit from Makefile upon first error, I set
"errorstopmode" in Makefile and "-e" switch for shell scripts
(xhlatex, etc.)</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<div><br>
<blockquote> "mktex4ht.cnf (and/or some other)"<br>
has two different recipes.<br>
<br>
<br>
It would be much nicer if we could separate out the
content so that the<br>
mutual recursion was removed. I.e., a new file that
generates<br>
mktex4ht.cnf separately -- run that first, then cond4ht,
then tex4ht.<br>
Except that doesn't look possible. But the current setup
just seems<br>
fundamentally wrong.<br>
</blockquote>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>In current setup tex4ht-4ht.tex generates mktex4ht.cnf
file.</div>
<div>It is possible to "detach" mktex4ht.cnf from
tex4ht-4ht.tex </div>
<div>and keep it separately. </div>
<div><br>
</div>
<div>mktex4ht.cnf is a list of \AddFile instructions.</div>
<div>It is possible to keep it as a plain tex file under VC;</div>
<div>other option would be, as you say, a new literate file.</div>
<div><br>
</div>
<div>Disadvantage of detaching the mktex4ht.cnf file</div>
<div>is that new 4ht configuration in tex4ht-4ht file, </div>
<div>will require manually introducing entries in
mktex4ht.cnf. </div>
<div><br>
</div>
<div>Advantages of separate mktex4ht.cnf are</div>
<div>- setup becomes more clear</div>
<div>- it would be possible to have 4ht configuration in
several smaller files, instead of one huge tex4h-4ht.tex</div>
<div>Cfr. in ChangeLog:</div>
<div>
<div><font class="Apple-style-span" size="2">2016-06-15
Michal Hoftich <<a href="mailto:michal.h21@gmail.com">michal.h21@gmail.com</a>></font></div>
<div><font class="Apple-style-span" size="2"><br>
</font></div>
<div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>*
tex4ht-4ht.tex,</font></div>
<div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>*
tex4ht-misc.tex: move definitions for lettrine to
tex4ht-4ht.tex.</font></div>
<div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>*
Makefile: don't compile tex4ht-misc.tex, it causes
overwritting of</font></div>
<div><font class="Apple-style-span" size="2"><span class="Apple-tab-span" style="white-space:pre"> </span>mktex4ht.cnf.</font></div>
<div><font class="Apple-style-span" size="2"><br>
</font></div>
<div><font class="Apple-style-span" size="2"><br>
</font></div>
<div>We can also have an another approach for mktex4ht.cnf. </div>
<div>If we have several literate source files for 4ht
configuration (e.g., tex4ht-4ht-foo1, tex4ht-4ht-foo2,
tex4ht-4ht-misc, etc.),</div>
<div>each of them can generate <jobname>.mktexcnf (or
any other extension) which can contain blocks of \AddFile
instructions.</div>
<div>mktex4ht.cnf could be generated from *.mktexcnf files
combining them (as a rule in Makefile)</div>
<div><br>
</div>
</div>
<div>Meanwhile, my patch uses separate mktex4ht-cnf.tex file,
which is a renamed mktex4ht.cnf file.</div>
<div><br>
</div>
<br>
<blockquote>
<blockquote type="cite">
<div>I remain unclear as to why all those different
\AddFile's exist in the<br>
first place. What does that number mean, and how does one
choose what<br>
number to use? Argh.<br>
</div>
</blockquote>
</blockquote>
<div><br>
</div>
<div>The number is supposed to be some kind of
sorting/classifying. </div>
<div>I call it class number.</div>
<div>From tex4ht-cond4ht.tex:</div>
<div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>
<font class="Apple-style-span" size="2">%\AddFile{i}{name}</font></div>
<div><font class="Apple-style-span" size="2">
% where i stands for a priority number</font></div>
<div><font class="Apple-style-span" size="2">
% in the range 0--9, and name stands for</font></div>
<div><font class="Apple-style-span" size="2">
% for a sty/cls file name. </font></div>
<div><font class="Apple-style-span" size="2"><br>
</font></div>
</div>
<div>It is a mess in those numbers now.</div>
<div>Probably it would be right to define clear rules for
assigning class numbers:</div>
<div>E.g.</div>
<div><br>
</div>
<div>0 - configuration for tex4ht system itself: Preamble,
tex4ht, tex4ht2, etex4ht, etc.</div>
<div>1 - configuration for format files: latex, elatex, etex,
etc</div>
<div>2 - configuration for cls files: book, article, report, etc</div>
<div>3 - configuration for graphics files: graphicx, graphics,
etc</div>
<div>4 - configuration for input /font encodings</div>
<div>5 - configuration for ams*packages, </div>
<div>6 - config for bibliography: biblatex, natbib, etc, ..</div>
<div>7 - config for latex packages ...</div>
<div>8 - config for non-latex packages (luatex)...</div>
<div>9 - config for misc</div>
<div><br>
</div>
<div>List of classes can be easily extended if needed. </div>
<div><br>
</div>
<div>After processing \AddFile entries become \lit{} entries in
mktex4h.4ht sorted</div>
<div>according class number; and \LitRow{} entries in
mktex4ht.4ht sorted alphabetically </div>
<div>by config name.</div>
<div><br>
</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<blockquote>
<div> Perhaps you have some other TODO items or things
that do not work...<br>
<br>
The ones mentioned are the ones that have been on my mind.
But it's<br>
easy to test: do a clean svn checkout in a new directory,
type make, and<br>
see what error messages result, or what fails to get made
(correctly).<br>
</div>
</blockquote>
</blockquote>
<div><br>
</div>
<div>I set up a new linux-mint v.18 machine in virtualbox,
installed TL2016 (full-scheme) from </div>
<div>DVD, did a clean svn checkout.</div>
<div>Running make I got:</div>
<div>-1-</div>
<div>[error] </div>
<div><font class="Apple-style-span" face="'Andale Mono'">/bin/sh:
xhlatex: command not found</font></div>
<div><br>
</div>
<div>Add-hoc Makefile fix is to alter PATH variable:</div>
<div>
<div><font class="Apple-style-span" face="'Andale Mono'">extra_bin
:= ./</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'">ht_bin
:= ../bin/ht/unix</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'">PATH
:= $(shell echo $$PATH)</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'">export
PATH:=$(ht_bin):$(extra_bin):$(PATH)</font></div>
<div><br>
</div>
</div>
<div>This also fixes issue with xmllint, that takes a lot time
to run.</div>
<div>(perhaps it's better to put xmllint in some subfolder
(./extra-bin) or into parent folder (../extra-bin)?)</div>
<div><br>
</div>
<div>-2-</div>
<div>[warning]</div>
<div>
<div><font class="Apple-style-span" face="'Andale Mono'">System
call: cp tex4ht-docbook.html ./.</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'">cp:
././tex4ht-docbook.html and tex4ht-docbook.html are
identical (not copied).</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'">---
Warning --- System return: 256</font></div>
<div><br>
</div>
<div>This warrning is issued with "-d./" option for xhlatex
call.</div>
<div>The fix is to replace "-d./" with "" in Makefile:</div>
<div><font class="Apple-style-span" face="'Andale Mono'">xhlatex
$< "html,3" "" "-d./" $(tex_1opt)</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'"><span
class="Apple-style-span" style="font-family: Helvetica;
">replaced with</span></font></div>
<div><font class="Apple-style-span" face="'Andale Mono'">xhlatex
$< "html,3" "" "" $(tex_1opt)</font></div>
</div>
<div> </div>
<div>-3-</div>
<div>[error]</div>
<div>
<div><font class="Apple-style-span" face="'Andale Mono'">sh:
line 0: cd: /home/4/gurari/xtpipes.dir: No such file or
directory</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'">mv:
rename tex4ht.jar to
/home/4/gurari/tex4ht.dir/texmf/tex4ht/bin/.: No such file
or directory</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'">cp:
/home/4/gurari/xtpipes.dir/xtpipes/lib/*: No such file or
directory</font></div>
<div><font class="Apple-style-span" face="'Andale Mono'"><br>
</font></div>
<div><br>
<font class="Apple-style-span" face="'Andale Mono'">
<div style="font-family: Helvetica; ">I don't think that
using an absolute path like /home/4/gurari/xtpipes.dir <br>
is a good idea. I would like to put the files locally
(in a subfolders, e.g. ./xtpipes.dir and ./tex4ht.dir)<br>
<br>
<font class="Apple-style-span" face="'Andale Mono'"><span
class="Apple-style-span" style="font-family:
Helvetica; "></span></font></div>
</font></div>
</div>
<br>
<blockquote type="cite">
<blockquote>
<div>One other thing, not about a clean checkout but about a
clean<br>
environment, is that it would be wonderful if *all*
derived files were<br>
written to a different directory, not ".". Right now,
just figuring out<br>
what is a source file and what is a derived file is far
from obvious.<br>
</div>
</blockquote>
</blockquote>
<div><br>
</div>
<div>
<div>I introduced new targets "deriveddir" for the derived
(*.4ht, etc) files and </div>
<div>'htmldir' for the generated html (and *.css, *.png) files
<br>
<br>
<br>
</div>
<div><br>
</div>
<div>targets "deriveddir and "htmldir" should be run after
"make all-debug"</div>
<div><br>
</div>
</div>
<br>
<blockquote type="cite">
<blockquote><br>
<div> There is a trace of my initial attempts with the wd=
variable in the<br>
Makefile; right now, the Java files get written there but
nothing else.<br>
</div>
</blockquote>
</blockquote>
<div><br>
</div>
<div>Can I replace "work.dir" with "xtpipes.dir" for the
clarity?<br>
Now I got html.dir, derived.dir.<br>
</div>
<br>
<div><br>
<br>
I'm attaching a new set of patches:<br>
<br>
common-info.diff<br>
Fix for \CleanComment. <br>
<br>
common.diff<br>
\versionDebug introduced. This serves only for debugging.<br>
Can be ignored.<br>
<br>
tex4ht-4ht.diff<br>
Detaching mktex4ht.cnf<br>
Defining \Skipmkfilename which removes mktex4ht.4ht
(double) generation<br>
<br>
tex4ht-cond4ht.diff<br>
Load mktex4ht-cnf.tex (detached) instead of mktex4ht.cnf.<br>
Define \ifFirstPass<br>
Skip executing ''\GetLit\HTML" on first pass<br>
<br>
tex4ht-info-html4.diff<br>
Code unification. Input common.tex and common-info.tex<br>
instead of dublicating the code.<br>
<br>
tex4ht-info-javahelp.diff<br>
Code unification. <br>
<br>
tex4ht-info-mml.diff<br>
Code unification.<br>
<br>
tex4ht-info.diff<br>
Code unification.<br>
<br>
mktex4ht-cnf.tex (new file)<br>
It is a copy of mktex4ht.cnf<br>
<br>
I see 3 options detaching the mktex4ht.cnf file.<br>
(1) plain text file under VC maintained manually<br>
(2) separate literate source (do not see big difference
with option 1)<br>
(3) accumulated from *.mktexncf as described above<br>
<br>
<br>
Makefile (not a patch but the one I used)<br>
set SHELL variable<br>
set PATH variable<br>
set -recorder and errorstopmode in tex_opts variable<br>
define HTTEX so that tex_opts variable is in effect<br>
replace "-d./' with "" for xhlatex calls<br>
<br>
define target "targets-debug-ord" which is a list of phony
targets in a right order.<br>
</div>
<div> amend target "clean"<br>
<br>
new targets:<br>
"htmldir" - move generated html files to html.dir folder<br>
"deriveddir" - move derived files to derived.dir folder<br>
</div>
<div><br>
run: <br>
make all-debug-ord<br>
make htmldir<br>
make deriveddir <br>
<br>
(See folders html.dir and derived.dir)<br>
<br>
</div>
<div><br>
</div>
</div>
<br>
kind regards, -- deimi<br>
</div>
<br>
<br>
</body>
</html>