Hello Chet,

I was finally able to take a look at these issues. I think that most issues
regarding wrong IDs can be fixed by not removing *.xref files in the clean
step. Other files are safer to remove, especially .ind file needs to be
removed before new lualatex run, but .xref is necessary. With this change,
I don't get any errors with Epubcheck.

The tcolrobox error is caused by the configurations in the config.cfg file.
They assume that the Listings package is loaded. Tcolorbox loads listings
in your mwe-2, so if you remove Tcolorbox, Listings are not loaded at all.
This leads to errors. I guess this issue shouldn't happen with your real
file. In any case, here is a version of config file which tests if Listings
are available, to prevent these errors.

Best regards,
Michal

On Tue, Mar 4, 2025 at 6:27 PM Chet Murthy <murthy.c...@gmail.com> wrote:

> Michal,
>
> Thank you for diagnosing this!  It's no problem at all to make the change,
> and I've done so to the MWE
> that I sent you on this mail thread.  In any case, htlatex is very fast
> (compared to lulatex,so the multiple
> runs are inconsequential).  This is a little long, and I hope it's all
> clear.
>
> While you were diagnosing this issue, I had already found the next bug.
> At the end is (what I think is) a
> very, very simple example that shows that indexes are just broken,
> along with several other errors.
>
> Because it's getting a little difficult to know precisely what MWE is
> being discussed, which config files, etc, I took the liberty of setting up
> a little GIT repo to store them in.
> If this isn't a good way to communicate examples to you, please let me
> know, and I'll return to just attaching
> files to emails.
>
> But absent your contra-indication, for the moment I'll store each MWE in a
> separate directory, self-contained,
> with a Makefile to run all build-steps for definiteness.  That was the
> only reason I put the "clean" step in there:
> to ensure that there were no files left-over from previous runs, to
> pollute later runs.
>
> BTW, I've also updated my Texlive installation using "tlmgr update
> --all".  I don't know how to get a
> version-number or timestamp from Texlive, so I can't identify the
> exact version of all the Texlive software
> I'm using.  So I'll just ensure that each time, I report when I updated
> with tlmgr.
>
> The repo is here: https://github.com/chetmurthy/latex-mwes
>
> OK, those preliminaries aside,
>
> (0) Updated Texlive: just before this email
> ==THIS WORKS, JUST DOCUMENTING IT=================
> (1) the MWE I sent you on Feb 25 (in this thread), and then with the
> updated build instruction per your email of Feb 27, is here:
>
> https://github.com/chetmurthy/latex-mwes/tree/master/mwe-1/2025-02-25-12-58
>
> To reproduce:
>
> $ make sample.FULL
>
> And that falis (b/c it runs htlatex only once) with 5 "Fragment identifier
> is not defined" errors from epubcheck (v5.2.1)
> ==THESE ALL FAIL=================
> (1') with your updated build.lua, in the directory
> https://github.com/chetmurthy/latex-mwes/tree/master/mwe-1/2025-03-04-05-00
> the sample now works and no errors are reported by epubcheck.
>
> To reproduce:
>
> $ make sample.FULL
> ===================
> (2) but meanwhile, I made an even simpler MWE, with a single chapter, a
> single \index entry:
> https://github.com/chetmurthy/latex-mwes/tree/master/mwe-2/2025-03-04-05%3A00
>
> This yields (with the updated build.lua file) 1 "Fragment identifier is
> not defined".
>
> To reproduce:
>
> $ make sample.FULL
>
> Looking at the generated HTML, it seems that both the TOC entry for the
> Index, and the single index-entry, assume that they're part of the same
> file. The fragment-ids are correct, but are in the wrong files.
> =========================
> (2b) sample.ind is overwritten by tex4ebook, and that new version is not
> accepted by lualatex
>
> But also, I found that the "sample.ind" file that was generated by
> "makeindex" after lualatex, got overwritten by the htlatex runs, and when
> lualatex was run  after it, (without "make clean"), lualatex fails with
> error:
>
> [4] (./sample.ind
> ! Undefined control sequence.
> l.5   \item bool (type), {\Link
>                                []{x3-2001}{}1\EndLink{}}
> ?
>
> To reproduce:
>
> $ make sample.IND-FILE-BROKEN
>
> ===================
> (2c) generated HTML is -badly- malformed
>
> There's a package included,
>
> \usepackage[most]{tcolorbox}
>
> that is entirely superfluous.  If you comment this out, then the generated
> sample.html is malformed, viz.
>
> FATAL(RSC-016): sample.epub/OEBPS/sample.html(3,3): Fatal Error while
> parsing file: Comment must start with "<!--".
>
> and this is caused by an element being emitted -before- xmldecl (which is
> completely malformed).
>
> (2d) Last, I got stack-overflow when processing my entire book, but I have
> not tried to isolate that, since these errors are so much more basic
>

Attachment: config.cfg
Description: Binary data

Reply via email to