bugtex4ht - Bugs: bug #561, tex4ht with xr-hyper does not work...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

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

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Sun May 1 04:38:18 2022  
 
Category: NonePriority: 5 - Normal
Severity: 7 - ImportantStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Mon May 2 12:46:09 2022, comment #1:

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)

Michal Hoftich <michal_h21>
Project Member
Sun May 1 04:38:18 2022, original submission:

I found a big problem with xr-hyper. THis is related to closed bug report

"bug #560: problem using tex4ht with xr-hyper when other documents are in separate folders"

For reference, https://tex.stackexchange.com/questions/641726/problem-using-tex4ht-with-xr-hyper-when-other-documents-are-in-separate-folders

I've been testing this in tex4ht. I found a big problem. Everything works fine as long as the chapter is compiled all as one large HTML file with no splitting. Then the link from the parent show up correctly.

Once I split the chapter, and recompile everything in correct order, then the parent losses the link and they no long show up. Since I split all the chapters (because they are large) then this will not work as is for me.

I hope there is an easy solution for this. Below I give MWE showing this and also a zip file with everything in it to make it easier to see.

I have this layout

---------------------
main.tex
|
CHAPTERS/
|
chapters_1/
|
ch1.tex
---------------------

Here is main.tex

---------------------
\documentclass{book}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument{CHAPTERS/chapter_1/ch1}
\begin{document}
See problem \hyperref[1]{1}
\end{document}
-----------------

And this is ch1.tex

-----------------------
\documentclass{article}
\usepackage{xr-hyper}
\usepackage{hyperref}
\begin{document}
\section{some section name}
\subsection{problem 1 from some book}
\label{1}
THis is problem 1
\end{document}

--------------------

Now I do the following

-------------------
cd CHAPTERS/chapter_1/
make4ht -ulm default -a debug ch1.tex 'mathjax,htm,4'
cd ../..
make4ht -ulm default -a debug main.tex 'mathjax,htm'
--------------------

Then look at main.htm to see if the link worked, it did not. It just shows the number 1 but it is not clickable. Here is the raw HTML of main.htm

--------------------------
<!DOCTYPE html>
<html lang='en-US' xml:lang='en-US'>
<head><title></title>
<meta charset='utf-8' />
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' />
<meta content='width=device-width,initial-scale=1' name='viewport' />
<link href='main.css' rel='stylesheet' type='text/css' />
<meta content='main.tex' name='src' />
<script>window.MathJax = { tex: { tags: "ams", }, }; </script>
<script async='async' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' type='text/javascript'></script>
</head><body>
<!-- l. 8 --><p class='noindent'>See problem <a>1</a>
</p>

</body>
</html>
----------------------

Now I do the following

cd CHAPTERS/chapter_1/
make4ht -ulm default -a debug ch1.tex 'mathjax,htm'
cd ../..
make4ht -ulm default -a debug main.tex 'mathjax,htm'

Notice, I removed the split above on the chapter.

Now I look at main.htm and link is active and working. Here is the new raw HTML of main.htm. You see, now it worked

--------------------------------
<!DOCTYPE html>
<html lang='en-US' xml:lang='en-US'>
<head><title></title>
<meta charset='utf-8' />
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' />
<meta content='width=device-width,initial-scale=1' name='viewport' />
<link href='main.css' rel='stylesheet' type='text/css' />
<meta content='main.tex' name='src' />
<script>window.MathJax = { tex: { tags: "ams", }, }; </script>
<script async='async' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' type='text/javascript'></script>
</head><body>
<!-- l. 8 --><p class='noindent'>See problem <a href='CHAPTERS/chapter_1/ch1.htm#x1-20001.1'>1</a>
</p>

</body>
</html>
--------------------

Here is a

<https://12000.org/tmp/04302022_sep_chapters/trying_separate_chapters_bug.zip>

zip file the contains the above layout and all the files.

Thank you
--Nasser

Nasser M. Abbasi <nma123>

 

Attached Files
file #510:  xrhyper-hooks.4ht added by michal_h21 (2kB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by michal_h21 (Updated the item)
  • -unavailable- added by nma123 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    1 latest change follows.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon May 2 12:46:08 2022michal_h21Attached File-=>Added xrhyper-hooks.4ht, #510
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray