Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of contents for book with faulty layout with epub3 #85

Closed
FredericVivien opened this issue Dec 3, 2021 · 7 comments
Closed

Table of contents for book with faulty layout with epub3 #85

FredericVivien opened this issue Dec 3, 2021 · 7 comments

Comments

@FredericVivien
Copy link

Hi

First of all thanks for the work. I am working on a booklet and was impressed by the output of my first attempt at using tex4ebook. I noticed a couple of problems, here is one. In a book with chapters, and chapters in the appendix, the part of the table of contents related to the appendix has a faulty layout.

Toy example:
\documentclass{book}
\usepackage{tex4ebook}
\begin{document}
\tableofcontents
\chapter{First chapter}
Here is some text.
\chapter{Second chapter}
Here is some text.
\appendix
\chapter{First chapter in appendix}
Here is some text.
\chapter{Second chapter in appendix}
Here is some text.
\end{document}

When calling tex4ebook -f epub3 on the above example, the table of contents is:

  1. 1 First chapter
  2. 2 Second chapter

      A First chapter in appendix
      B Second chapter in appendix

Hence, the part of the table of contents related to the appendix appears to be nested inside the entry for the last chapter before the appendix (notice the location of ). Also, the chapters in the appendix do not appear to be processed the same way than the ones in the main part. The problem does not seem to appear with the epub target.

I have not tried to locate the origin of the problem.

Best.

@michal-h21
Copy link
Owner

Hi Fredefic,

thanks for the report. You are right, appendix sections are broken in Epub 3. I've hopefully fixed that in the development version (2284bb1).

Best regards,
Michal

@FredericVivien
Copy link
Author

Hi Michal

Thanks for the fix. Indeed, the structure is now correct on my real-life example. However, I have found another problem I have not noticed earlier relative to all sections (apparently) in the table of contents for epub3 (but not for epub): textsuperscript characters appears as normal characters. For instance, when the source is:
\chapter{2\textsuperscript{nd} chapter}
In epub3 the output is:
2 2nd chapter
when in epub it is:
2nd chapter

This problem is far less impacting than the previous one, obviously. Once again, than you for the fix.

Frédéric

@michal-h21
Copy link
Owner

Hi Frédéric,

the superscript issue is strange, I cannot reproduce it when I just add a chapter with superscript to your previous example. It produces correct output for both Epub and Epub 3. Can you make a MWE that shows it?

Best,
Michal

@FredericVivien
Copy link
Author

Hi Michal

This is strange. Here is a MWE:
\documentclass{book}
\usepackage{tex4ebook}
\begin{document}
\tableofcontents
\chapter{2\textsuperscript{nd} chapter}
\end{document}
It seems that the output is correct with epub (but the reader I first used could not process it properly). The output for epub3 is faulty because the corresponding line for the chapter in the table of content contains 1 2nd chapter'', and, hence, no modifiers for nd''. (There is a ``sup'' in the epub version.)

If you cannot reproduce the problem with that example, may it be due to different versions of tex4ht?

Best,
Frédéric

@michal-h21
Copy link
Owner

Hi Frédéric,

I see it now. tex4ebook removed all elements from TOC in Epub 3, because there were some validation issues. I've changed this method, and it should keep superscripts and other elements now.

Best,
Michal

@FredericVivien
Copy link
Author

Hi Michal

The epub3 looks fine now. I add noticed another problem but not yet found a MWE for it, but it looks like your fix also fixed that other indentation problem.

Thanks a lot.

Best,
Frédéric

@michal-h21
Copy link
Owner

Hi Frédéric,

that's good to hear! I hope to release a new tex4ebook version to CTAN soon, if you don't find other issues :)

Best,
Michal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants