Hi Karl,

(1)
Here is a patch. Hopefully it fixes
compilation failure on first run.
Literate sources are quite complex; not so easy to grasp.
Your lengthy note on \CleanComment in common-info.tex
was really useful, - thanks.

I tested:
$> make info4ht.4ht
$> make infomml.4ht
$> xhlatex tex4ht-info.tex "html,3,sections+"
$> htlatex tex4ht-info-mml.tex "html,sections+"
and
$> make clean
$> make all

It seems that problems with tex4ht-options.tex
are gone too.
$> make tex4ht.ht
$> mk4ht xhlatex tex4ht-options.tex </dev/null


However note that
$>xhlatex tex4ht-info.tex
will fail. It supposed to be
$> xhlatex tex4ht-info.tex "html,3,sections+"
as is in Makefile.
Option "html" is important here, I think.

How do I test if there are no side effects in the generated output files?


(2)
For debugging, I found that making xhlatex (and htlatex) be
        #!/bin/sh -e was helpful, since then it stopped after the first 
(failed) run.

This is very useful. I wonder if it is not a case to put it in a mainstream, 
not just for debugging.
Consider $> xhlatex foo  (foo.tex is non-existent);
I have to type 'x' 3 times to exit latex and then still tex4ht and t4ht is run.
With "-e" xhlatex exists nicely upon first 'x'.

(3)

        There also seems to be a mutual dependency problem wrt tex4ht-4ht.tex
        and tex4ht-cond4ht.tex. The former creates mktex4ht.cnf and then
        \input's cond4ht.4ht. But to make cond4ht.4ht, mktex4ht.cnf needs to
        already exist.

yes, it is. tex4ht-4ht has over 130 derived files.
Setting properly tex4ht_4ht_derived files, Makefile issues that "mktex4ht.cnf 
(and/or some other)"
has two different recipes.
One option I can thing of is combining recipes. (though i am not quite sure if 
it is right thing to do):
That would be something like this in Makefile:

$(tex4ht_4ht_derived) $(tex4ht_cond4ht_derived): tex4ht-4ht.tex 
tex4ht-cond4ht.tex $(common)
    tex $(tex_opts) $<
    tex $(tex_opts) tex4ht-cond4ht
    tex $(tex_opts) cond4ht.4ht
    tex $(tex_opts) $<
    tex $(tex_opts) $<


(4) From Makefile:

        tex4ht_4ht_derived = \
          algorithmic.4ht biblatex.4ht book.4ht frenchb.4ht \
          geometry.4ht graphicx.4ht hyperref.4ht latex.4ht lettrine.4ht 
listings.4ht \
          memoir.4ht multicol.4ht quoting.4ht reading.4ht \
          scrartcl.4ht scrbook.4ht scrreprt.4ht spanish.4ht subscript.4ht \
          titlesec.4ht tocloft.4ht wrapfig.4ht usepackage.4ht
        # xx and many, many more.

There are a lot of derived files from tex4ht-4ht.tex.
Probably I would set them programatically rather than manually.
Something like this (in Makefile):

tex4ht_4ht_derived := $(shell cat tex4ht-4ht.derived)
tex4ht-4ht.derived: tex4ht-4ht.fls
    grep -v $* $< | awk '/OUTPUT/ {print $$2}'  > $@

The idea is to filter FLS file for line with "OUTPUT" rejecting tex4ht-4ht.*
Fls file is created with " -recorder"  for latex.
tex_opts = --interaction=nonstopmode -recorder #--file-line-error

(5)

        Having a reproducible environment would
        be so great.  (E.g., be able to do a checkout and type "make" and it
        just works ...)

I understand. Fixing (xh)latex compilation failures is an important step,
but not the only one, i believe. What would be a TODO list for having a
reproducible environment?:

        - fix (ht)latex compilation errors (hopefully the patch fixes this)
        - fix  mutual dependency problem tex4ht-4ht.tex and tex4ht-cond4ht.tex
        - ...

Perhaps you have some other TODO items or things that do not work...



(6)

In common-info.tex file I read:

        If you modify this program, changing the
        version identification would be appreciated.

I cannot find the version identification in this file.
What I supposed to do?





Kind regards, and sorry for a lengthy message
 -- deimi

Index: common-info.tex
===================================================================
--- common-info.tex	(revision 190)
+++ common-info.tex	(working copy)
@@ -22,7 +22,13 @@
 % version identification would be appreciated.
 
 \expandafter\ifx \csname YES\HTML\endcsname\relax
-    \def\CleanComment{[0]}
+    % begin comment. 21/07/2016 (dg)
+    %   on first run \infoIVht expects \ConfigureHinput
+    %   ( \def\infoIVht#1\ConfigureHinput{..} )
+    %   so we feed it with "\ConfigureHinput" (no expansion here, merely a delimiter)
+    %   the rest is slurped until the "//".
+    % end  
+    \def\CleanComment{[0]\ConfigureHinput\id:gobble}
 \else
     \let\saveCd=\<
     \def\<{\edef\FIRST{\the\inputlineno}\let\<\saveCd \saveCd}
Index: tex4ht-info.tex
===================================================================
--- tex4ht-info.tex	(revision 190)
+++ tex4ht-info.tex	(working copy)
@@ -38,47 +38,10 @@
 \fi
 
 
-%%%%%%%%%%%%%%%%%% definitions %%%%%%%%%%%%%%%%%%%%%%%%%
+\input{common-info}
+\input{common}
 
-\expandafter\ifx \csname YES\HTML\endcsname\relax
-    \def\CleanComment{[0]}
-\else
-    \let\saveCd=\<
-    \def\<{\edef\FIRST{\the\inputlineno}\let\<\saveCd \saveCd}
-    \def\CleanComment#1tex4ht-info#2#3#4.#5>#6//{[#4%     <--jobname
-                  \if,\ifnum \FIRST=#6 .\else ,0\fi\fi]#6//}
-\fi
 
-\Comment{
-
-\string\ifx\string\infoIVht\string\UnDeF\string\def\string\infoIVht#1//{}\string\fi\string\infoIVht\CleanComment}{//
-
-}
-
-
-
-
-
-\def\>>>#1<<<{\bgroup\csname no:catcodes\endcsname0{255}{12}%
-   \csname no:catcodes\endcsname{13}{13}{13}% ^^M
-   \def\temp##1>>>{\egroup
-      \expandafter \def\csname #1\endcsname{##1}}\temp}
-
-\newcount\tmpcnt  \tmpcnt\time  \divide\tmpcnt  60
-\edef\temp{\the\tmpcnt}
-\multiply\tmpcnt  -60 \advance\tmpcnt  \time
-
-\edef\version{\the\year-\ifnum \month<10 0\fi
-  \the\month-\ifnum \day<10 0\fi\the\day
-   -\ifnum \temp<10 0\fi \temp
-   :\ifnum \tmpcnt<10 0\fi\the\tmpcnt}
-
-\def\CopyYear.#1.{%
-   \ifnum #1=\year #1\space\space\space\space\space\space
-    \else          #1--\the\year\fi
-}
-
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{INFO}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: tex4ht-info-html4.tex
===================================================================
--- tex4ht-info-html4.tex	(revision 190)
+++ tex4ht-info-html4.tex	(working copy)
@@ -36,45 +36,10 @@
    \expandafter\next
 \fi
 
+\input{common-info}
+\input{common}
 
-%%%%%%%%%%%%%%%%%% definitions %%%%%%%%%%%%%%%%%%%%%%%%%
 
-\expandafter\ifx \csname YES\HTML\endcsname\relax
-    \def\CleanComment{[0]}
-\else
-    \let\saveCd=\<
-    \def\<{\edef\FIRST{\the\inputlineno}\let\<\saveCd \saveCd}
-    \def\CleanComment#1tex4ht-info-html4#2#3#4.#5>#6//{[#4%  <--jobname
-                  \if,\ifnum \FIRST=#6 .\else ,0\fi\fi]#6//}
-\fi
-
-\Comment{
-
-\string\ifx\string\infoIVht\string\UnDeF\string\def\string\infoIVht#1//{}\string\fi\string\infoIVht\CleanComment}{//
-
-}
-
-
-\def\>>>#1<<<{\bgroup\csname no:catcodes\endcsname0{255}{12}%
-   \csname no:catcodes\endcsname{13}{13}{13}% ^^M
-   \def\temp##1>>>{\egroup
-      \expandafter \def\csname #1\endcsname{##1}}\temp}
-
-\newcount\tmpcnt  \tmpcnt\time  \divide\tmpcnt  60
-\edef\temp{\the\tmpcnt}
-\multiply\tmpcnt  -60 \advance\tmpcnt  \time
-
-\edef\version{\the\year-\ifnum \month<10 0\fi
-  \the\month-\ifnum \day<10 0\fi\the\day
-   -\ifnum \temp<10 0\fi \temp
-   :\ifnum \tmpcnt<10 0\fi\the\tmpcnt}
-
-\def\CopyYear.#1.{%
-   \ifnum #1=\year #1\space\space\space\space\space\space
-    \else          #1--\the\year\fi
-}
-
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{INFO}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: tex4ht-info-javahelp.tex
===================================================================
--- tex4ht-info-javahelp.tex	(revision 190)
+++ tex4ht-info-javahelp.tex	(working copy)
@@ -1,5 +1,6 @@
 % compile 3 times: latex tex4ht-info-javahelp   
 %          or htlatex tex4ht-info-javahelp "html,sections+"
+%          or ht latex tex4ht-info
 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % tex4ht-info-javahelp.tex                               %
@@ -27,7 +28,6 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 \message{(<signature>)}
 
-% Compile with the command `ht latex tex4ht-info'
 
 \ifx \HTML\UnDef
    \def\HTML{infojh}
@@ -38,34 +38,8 @@
 \fi
 
 
-%%%%%%%%%%%%%%%%%% definitions %%%%%%%%%%%%%%%%%%%%%%%%%
+\input{common-info}
 
-\expandafter\ifx \csname YES\HTML\endcsname\relax
-    \def\CleanComment{[0]}
-\else
-    \let\saveCd=\<
-    \def\<{\edef\FIRST{\the\inputlineno}\let\<\saveCd \saveCd}
-%    \def\CleanComment#1tex4ht-info#2#3#4.#5>#6//{[\eatIX#4%     <--jobname
-    \def\CleanComment#1tex4ht-info#2#3#4.#5>#6//{[#4%     <--jobname
-                  \if,\ifnum \FIRST=#6 .\else ,0\fi\fi]#6//}
-    \def\eatIX#1#2#3#4#5#6#7#8#9{}
-\fi
-
-\Comment{
-
-\string\ifx\string\infoIVht\string\UnDeF\string\def\string\infoIVht#1//{}\string\fi\string\infoIVht\CleanComment}{//
-
-}
-
-
-
-
-
-\def\>>>#1<<<{\bgroup\csname no:catcodes\endcsname0{255}{12}%
-   \csname no:catcodes\endcsname{13}{13}{13}% ^^M
-   \def\temp##1>>>{\egroup
-      \expandafter \def\csname #1\endcsname{##1}}\temp}
-
 \newcount\tmpcnt  \tmpcnt\time  \divide\tmpcnt  60
 \edef\temp{\the\tmpcnt}
 \multiply\tmpcnt  -60 \advance\tmpcnt  \time

Reply via email to