[tex4ht] Perplexing problem with internal refs when generating ebooks

Chet Murthy murthy.chet at gmail.com
Mon Feb 24 06:38:49 CET 2025


Michal,

I've made progress, but have now hit several other problems in trying to
get my document converted to an ebook.  Some of them, I have "not very good
workarounds" for, so I'm going to defer asking about them, but I'm blocked
on one now.  I've produced an MWE using the fixed example you sent me.

In that fixed example, there was a figure with an lstlisting in it,
followed by references to the figure.

In this new example, the references come first, then there is a footnote,
and then  a regular figure, followed by the figure-with-lstlisting.

So there are two sorts of references: one to the regular figure, and two to
the figure-with-listlisting.  The latter references are properly resolved;
the former is not.  If I comment-out the footnote, they all get resolved.

Looking at the generated HTML, it appears that the reference to the regular
figure is a local reference, viz.

<a href='#-mandelbrot-set'>1.1<!-- tex4ht:ref: fig:mandelbrot  --></a>

even though the figure is in a different HTML file.

I would really appreciate your help.

Thanks,
--chet--
P.S. Separately, I'm finding other problems with math-mode and inline
listings.  Should I be sending all these issues to the mailing-list (and
you) all at once, or do them one-at-a-time (in hope that as you and others
help me figure this out, I will eventually get to where I can solve the
rest of the problems)?



On Thu, Feb 20, 2025 at 11:01 AM Michal Hoftich <michal.h21 at gmail.com>
wrote:

> Hi Chet,
>
> I would try the config file with your current distribution first. It is
> possible that the validation issue will be fixed just with these
> definitions. Otherwise, it is best to use the TeX Live distribution from
> https://www.tug.org/texlive/. But the new version will be released in few
> weeks, so I don't think it is the best time to install it right now. You
> can also try Docker, I think for example this should work:
> https://github.com/islandoftex/texlive.
>
> But as I said, try the updated files first, maybe it isn't necessary to
> install anything.
>
> Best regards,
> Michal
>
> Michal,
>>
>> Thank you for your kind and rapid response!  Um, do you have a
>> recommendation for the right versions of tex4{ebook,ht}, and what other
>> software I should be compiling from sources?  Or if there's a Linux distro
>> (let's say, Ubuntu or Debian's latest  bleeding edge) I could get that
>> working in Docker.
>>
>> I'd like to have the right software before proceeding.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex4ht/attachments/20250223/4c3c13f8/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample2.tex
Type: text/x-tex
Size: 846 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex4ht/attachments/20250223/4c3c13f8/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.cfg
Type: application/octet-stream
Size: 982 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex4ht/attachments/20250223/4c3c13f8/attachment-0001.obj>


More information about the tex4ht mailing list.