Re: [tex4ht] debugging tex4ht bootstrap

2016-09-30 Thread Michal Hoftich
Hi Deimi,

> This fixes latex compilation error(s)
> on first pass (when there are no *.xref files).
>
> The mutual dependency problem
> wrt tex4ht-options.tex and tex4ht-cond4ht.tex
> should be fixed too.
>

that's great! Thank you very much.

Best regards,
Michal


[tex4ht] debugging tex4ht bootstrap

2016-09-30 Thread Deimantas Galcius

Hi Karl, Michal

I've updated svn repo with a fix.

This fixes latex compilation error(s)
on first pass (when there are no *.xref files).

The mutual dependency problem
wrt tex4ht-options.tex and tex4ht-cond4ht.tex
should be fixed too.


kind regards,
-- deimi


Re: [tex4ht] debugging tex4ht bootstrap

2016-08-11 Thread Karl Berry
Hi Deimi - wow, thank you for all the work.  It all sounds excellent.
Unfortunately I am going to be tied up producing the TUG conference
proceedings for some time.  But I will come back to this as soon as I
can.  For now, a couple of quick replies.

Re the separate mktex4ht.cnf, yes.  Except manual maintenance doesn't
sound good.  Seems like we could generate the separate file outside of
TeX, e.g., by grep/sed/perl whatever of the source files?  Then we'd
avoid the mutual dependency, I think.  Agreed on no benefit to literate
version of the .cnf.

Also really like the idea of being able to split up tex4ht-4ht.  As you
saw, we had to disable our tiny attempt at beginning that with lettrine
because of the mktex4ht.cnf problem.  Having a different file for each
"class" (and defining the classes more clearly) sounds right to me.

Alternatively, if (since, I guess) the classes are essentially arbitrary,
I wonder about doing it alphabetically (one file for a*.4ht, one file
for b*.4ht, etc.), to avoid making random judgements.  But maybe that is
worse than trying to impose some kind of semantics.

Thanks again, so much.  -karl


Re: [tex4ht] debugging tex4ht bootstrap

2016-07-29 Thread Deimantas Galcius

Hi Karl,

Unfortunately the patch I send you, introduces changes in few html files (links 
are lost).
So please, disregard the patch.

I'll try to fix this in a couple of days.

Regards, -- deimi






Title: index
 
  
  
 

   infoht42up-8859-6-CJK-IEEEtran- JHEP-Preamble-ProTex-SIunits- TextBook-aa-abidir-accents-
acm-proc-article-sp-afterpage-alatex-algorithm- algorithmic-algorithmicx-alltt-alphanum-
amsart*amsbook-amsbsy-amscd-
amsdtx-amsfonts-amsldoc-amsmath- amsopn-amsppt-amsproc-amssymb-
amstex-amstex1-amstext-amsthm- aoutput-apa-apa-a-apacite-
aps-arabicore-array-article*
austrian-babel-beamer-beamerbasefont- beamerbasetoc-beton-biblatex-bibtopic-
bm-book*booktabs-boxedminipage-
byname-caption-catalan-cgloss4e- chapterbib-chicago-color-colortbl-
combine-context-covington-cp1250- cp1252-cp1256-cp437-cp437de- cp850-cp852-cp862-cp865-
croatian-curve-czech-danish- dcolumn-debug-diagram-diagrams- doc-dratex-dsfont-dutch-
dvipdf-dvips-dvipsnam-dvipsone- elsart-emulateapj-endfloat-endnotes-
english-enumerate-enumitem-epigraph- eplain-epsf-epsfig-errata-
esperant-esperanto-estonian-etex4ht- eucal-euler-europecv-eurosym-
everyshi-exam-exerquiz-extarticle- extbook-extletter-extproc-extreport-
fancybox-fancyvrb-fig4tex-finnish- fleqn-float-floatflt-foils- fontmath-footmisc-footnote-dw-francais-
french-frenchb-g-brief-galician- gauss-geometry-german-germanb-
gloss-glossaries-glossary-go- graphics-graphicx-greek-harvard-
hebrew-hebtex-hewrite-holtxdoc- hypcap-hyperref-ifthen-index- inputenc-italian-jeep-jurabib-
koi8-r-latex*latex209-latex2man-
latin1-latin2-lb-letter- lettrine-lfeenc-lineno-linguex- listings-llncs-llncs-a-lncse-
lncse-a-longdiv-longtable-ltugboat- ltugboat-a-ltugproc-ltugproc-a-ltxguide-
makeidx-manju-manmac-mathtools- mdwlist-mdwtab-memoir-mempatch-
mex-mfpic-microtype-minitoc- mktex4ht-mla-mls-moreverb- multicol-multind-multirow-mwart-
mwbk-mwrep-nameref-natbib- ngerman-ngermanb-nicefrac-nomencl-
norsk-ntheorem-osudeG-ot4enc- overcite-overpic-paralist-path-
pb-diagram-pctable-pctex32-pd1enc- pgf-picins-pictex-pifont- plain-polish-polski-portuges-
powerdot-powerdot-a-prosper-prosper-a- psfig-pst-all-pst-jtree-pstricks-
quoting-reading-report*res- res-a-resume-revsymb-revtex4-
rlbabel-romanian-rotating-russianb- scottish-scrartcl-scrbook-scrreprt-
seminar-seminar-a-seslideb-sig-alternate- sistyle-slides-slidesec-slovak-
slovene-soul-spanish-splitidx- srcltx-subeqnarray-subfigure-subscript-
supertabular-sverb-svgnam-swedish- syntax-t2benc-tabularx-tabulary-
tabulary-a-tcilatex-tex4ht*tex4ht2-
texinfo-texpower-textures-th4- theorem-titlesec-tocloft-tugboat- turkish-ucs-ukraineb-ulem-
url-ushort-usorbian-utf8- utf8x-vanilla-varioref-verbatim- verbatimfiles-verse-vowel-web-
welsh-wrapfig-writer-xcolor- xr-xr-hyper-xy- 
[exit index]


 
Title: index
 
  
  
 

   infoht42up-8859-6-CJK-IEEEtran- JHEP-Preamble-ProTex-SIunits- TextBook-aa-abidir-accents-
acm-proc-article-sp-afterpage-alatex-algorithm- algorithmic-algorithmicx-alltt-alphanum-
amsart*amsbook-amsbsy-amscd-
amsdtx-amsfonts-amsldoc-amsmath- amsopn-amsppt-amsproc-amssymb-
amstex-amstex1-amstext-amsthm- aoutput-apa-apa-a-apacite-
aps-arabicore-array-article*
austrian-babel-beamer-beamerbasefont- beamerbasetoc-beton-biblatex-bibtopic-
bm-book*booktabs-boxedminipage-
byname-caption-catalan-cgloss4e- chapterbib-chicago-color-colortbl-
combine-context-covington-cp1250- cp1252-cp1256-cp437-cp437de- cp850-cp852-cp862-cp865-
croatian-curve-czech-danish- dcolumn-debug-diagram-diagrams- doc-dratex-dsfont-dutch-
dvipdf-dvips-dvipsnam-dvipsone- elsart-emulateapj-endfloat-endnotes-
english-enumerate-enumitem-epigraph- eplain-epsf-epsfig-errata-
esperant-esperanto-estonian-etex4ht- eucal-euler-europecv-eurosym-
everyshi-exam-exerquiz-extarticle- extbook-extletter-extproc-extreport-
fancybox-fancyvrb-fig4tex-finnish- fleqn-float-floatflt-foils- fontmath-footmisc-footnote-dw-francais-
french-frenchb-g-brief-galician- gauss-geometry-german-germanb-
gloss-glossaries-glossary-go- graphics-graphicx-greek-harvard-
hebrew-hebtex-hewrite-holtxdoc- hypcap-hyperref-ifthen-index- inputenc-italian-jeep-jurabib-
koi8-r-latex*latex209-latex2man-
latin1-latin2-lb-letter- lettrine-lfeenc-lineno-linguex- listings-llncs-llncs-a-lncse-
lncse-a-longdiv-longtable-ltugboat- ltugboat-a-ltugproc-ltugproc-a-ltxguide-
makeidx-manju-manmac-mathtools- mdwlist-mdwtab-memoir-mempatch-
mex-mfpic-microtype-minitoc- mktex4ht-mla-mls-moreverb- multicol-multind-multirow-mwart-
mwbk-mwrep-nameref-natbib- ngerman-ngermanb-nicefrac-nomencl-
norsk-ntheorem-osudeG-ot4enc- overcite-overpic-paralist-path-
pb-diagram-pctable-pctex32-pd1enc- pgf-picins-pictex-pifont- plain-polish-polski-portuges-
powerdot-powerdot-a-prosper-prosper-a- psfig-pst-all-pst-jtree-pstricks-
quoting-reading-report*res- res-a-resume-revsymb-revtex4-
rlbabel-romanian-rotating-russianb- scottish-scrartcl-scrbook-scrreprt-

Re: [tex4ht] debugging tex4ht bootstrap

2016-07-22 Thread Karl Berry
Hi Deimi - this is fantastic!

Unfortunately, I'm about to disappear for a week (to TUG'16; back online
next weekend, July 30-31), but I'll review it carefully/commit after I
return.  A few quick replies for now.

Literate sources are quite complex; not so easy to grasp.

Understatement of the year :(.

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

This is another major unresolved problem.  My current attempts along
those lines is the diff-all target and related at the bottom of the
Makefile, which attempts to diff an installed TeX Live against the
development files generated in lit/*, while ignoring comments and more.

There are, sadly, many differences.  They all need to be looked at and
resolved.  I have hopes that these latest fixes will reduce them
dramatically.

For now, I think the best that could be done is to copy the lit/*
directory to a backup, install your changes, rerun make, and then do a
diff between the backup and results.  If you see what I mean.

I wonder if it is not a case to put it in a mainstream, not just for
debugging.

I want to do that.  However, as long as the failed runs were required
for some documents to make it through to the end, it was not possible.

With your fixes, maybe we could try again.  But I also fear that doing
so now will introduce the same failure into workflows in the wild, which
also depend on the temporary results from failed runs.  I don't know.

(The scripts need a lot of attention in general.  Sigh.)

"mktex4ht.cnf (and/or some other)"
has two different recipes.

Right, which is why I didn't introduce it as a dependency.

One option I can thing of is combining recipes. (though i am not
quite sure if it is right thing to do): 

It would be much nicer if we could separate out the content so that the
mutual recursion was removed.  I.e., a new file that generates
mktex4ht.cnf separately -- run that first, then cond4ht, then tex4ht.
Except that doesn't look possible.  But the current setup just seems
fundamentally wrong.

I remain unclear as to why all those different \AddFile's exist in the
first place.  What does that number mean, and how does one choose what
number to use?  Argh.

There are a lot of derived files from tex4ht-4ht.tex.
Probably I would set them programatically rather than manually.

Definitely agreed.  The manual stuff was only because we had to get on
with fixing the real bugs, and introducing a complete derived list
started having problems.

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

I hadn't thought of using recorder output, though.  Sounds good.  I'll
look at this when I get back.

I cannot find the version identification in this file.

You're right, there's nothing there.  Don't worry about it :).  I'll
tweak it one way or another to be consistent later.

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

The ones mentioned are the ones that have been on my mind.  But it's
easy to test: do a clean svn checkout in a new directory, type make, and
see what error messages result, or what fails to get made (correctly).

One other thing, not about a clean checkout but about a clean
environment, is that it would be wonderful if *all* derived files were
written to a different directory, not ".".  Right now, just figuring out
what is a source file and what is a derived file is far from obvious.

There is a trace of my initial attempts with the wd= variable in the
Makefile; right now, the Java files get written there but nothing else.
(The Java files are another huge problem in and of themselves, like what
is all that code doing -- ofte nothing because Java on a given system
may or not even exist -- and shouldn't we do it a better way, but never
mind ...)  I suspect that, given the intermixed input and output, this
is next to impossible, but as long as we're here ...

It's also annoying to have to generate the HTML "documentation" for the
lit sources (with magical settings, as you noted) along with creating
the necessary derived files.  Those should really be separable.  But
this is even deeper into pipedream territory ...

See you all back here in a week ... --karl


Re: [tex4ht] debugging tex4ht bootstrap

2016-07-22 Thread Deimantas Galcius

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 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}
-

[tex4ht] debugging tex4ht bootstrap

2016-07-18 Thread Karl Berry
I'll see if I can sort it out.

That would be fantastic, Deimi.  Having a reproducible environment would
be so great.  (E.g., be able to do a checkout and type "make" and it
just works ...)  I've got it in my queue, but ...

The first compilation fails, but not others.

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

Something similar was going wrong for me with tex4ht-options.tex (which
generates tex4ht.4ht).

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.  It seems.  Maybe I'm wrong.  I'm unsure of everything.

In general, the relationship of the pieces remains an inscrutable
mystery to me :(.  --karl