[tex4ht] [bug #561] tex4ht with xr-hyper does not work when splitting other document.
Nasser M. Abbasi
puszcza-hackers at gnu.org.ua
Sun May 1 06:38:18 CEST 2022
URL:
<http://puszcza.gnu.org.ua/bugs/?561>
Summary: tex4ht with xr-hyper does not work when splitting
other document.
Project: tex4ht
Submitted by: nma123
Submitted on: Sun May 1 04:38:18 2022
Category: None
Priority: 5 - Normal
Severity: 7 - Important
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
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
_______________________________________________________
Reply to this item at:
<http://puszcza.gnu.org.ua/bugs/?561>
_______________________________________________
Message sent via/by Puszcza
http://puszcza.gnu.org.ua/
More information about the tex4ht
mailing list.