[tex4ht] [bug #561] tex4ht with xr-hyper does not work when splitting other document.

Nasser M. Abbasi nma at 12000.org
Sat May 14 02:58:44 CEST 2022


Hello Michal;

Great news.

The changes you made to tex4ht splitting name format in:

>https://tex.stackexchange.com/questions/644059/how-to-control-the-name-of-the-html-files-that-tex4ht-uses-for-splitting-subsubs>

is working very well.

Not only that, it had the good side effect of making your eralier
changes in xrhyper-hooks.4ht now also work when splitting the external document!

It was now working before these changes.

I think the problem was that the overloading of the file names
with subsection and subsubsection, all using the same format is why it
was not working.

But now suddenly I found it is working with the new file format.

Now, I can build each chapter in separate folder and the links automatically
work across files without me having to add any extra manual code to add the links.

I just type  \hyperref[1]{1} in main document and it will find the
correct link even if it is in an external HTML file separate with splitting
also added.

I just need to add

\externaldocument{chapters/folder_name/index}

Thanks again for making these changes. This will make life so much easier now
and now it will be possible to only compile the chapters that changed
instead of the whole document each time.

Will xrhyper-hooks.4ht and the changes you just made by adding cut-fullname
option to make4h all be in official tex4ht sources?  or do I need
to keep my own copy of xrhyper-hooks.4ht?

Best regards
--Nasser


On 5/3/2022 1:46 AM, Nasser M. Abbasi wrote:
> On 5/2/2022 7:46 AM, Michal Hoftich wrote:
>> Follow-up Comment #1, bug #561 (project tex4ht):
>>
>> This one was a bit more difficult, as information about cut files is not
>> available at the moment when we save the directory. I fixed that by loading of
>> the .xref with redefined version of the \:CrossWord macro. It detects links to
>> cut files using regular expressions, and saves directory also for these.
>>
>> You can try the updated xrhyper-hooks.4ht file.
>>
>> (file #510)
>>       _______________________________________________________
> 
> Thank you Michal for the effort.
> 
> It works well, when there is one chapter which split.
> 
> But unfortunately when I have more than one separate chapter,
> the links go to wrong places.
> 
....
> 
> I am using your xrhyper-hooks.4ht which I put in my texmf.
> 
> I have one main.tex, and two ch1.tex and ch2.tex, both are book class.
> I compiled ch1.tex and ch2.tex with split 4.  Then I did reference
> to 2 labels in each chapter.
> 
> When I click in main.htm for a link that should point to ch1.htm, it
> instead go to ch2.htm.
> 
> I made a zip file if you like to see for yourself with all the files
> and the HTML generated. Please see attached.
> 
> The commands I used are
> 
> cd CHAPTERS/chapter_1
> make4ht  -ulm default  -a debug ch1.tex 'mathjax,htm,4'
> cd ../chapter_2
> make4ht  -ulm default  -a debug ch2.tex 'mathjax,htm,4'
> cd ../..
> make4ht  -ulm default  -a debug main.tex 'mathjax,htm'
> 
> And looked at main.htm
> 
> If you think this will not work, may be due to tex4ht is not designed
> for this, no problem, I understand. I will go back to using one large latex file.
> 
> I was hoping by splitting the html like this, I can only compile the chapters
> that change, saving time.
> 
> If you like me to try anything, will be happy to.
> 
> Best regards,
> --Nasser



More information about the tex4ht mailing list.