michal-h21 / tex4ebook

Converter from LaTeX to ebook formats (epub, mobi). Using tex4ht and texlua scripts.
311 stars 32 forks source link

Bad nesting in table of contents #87

Closed FredericVivien closed 2 years ago

FredericVivien commented 2 years ago

Hi Michal

(And all my best wishes for the new year)

Thank you for your answers to my previous reports. In the coming days/weeks, I will push my book through tex4ebook and check the output both visually and with epubcheck. Hence, a series of bug reports.

epubcheck reports a bad nesting of tags in the table of contents with epub3. Here is a MWE: \documentclass{article} \usepackage{tex4ebook} \begin{document} \tableofcontents \section{Title One} \subsection{First subtitle} \end{document}

In the table of contents, the ol tag for the subsection is opened before the a tag for the title of the section is closed.

One can see in the file: 1 Title One

  1. 1.1

    Best, Frédéric

michal-h21 commented 2 years ago

Hi Frédéric,

I wish you my best wishes for the new year too. Also thanks for the report. You are right that nested TOC entries are put as children of links to their parents. I've fixed it in the latest commit, hopefully.

Best, Michal

FredericVivien commented 2 years ago

Hi Michal

It looks like you fixed it: the output is visually correct and epubchek is now happy. Thanks.

Best, Frédéric

michal-h21 commented 2 years ago

That's good to hear! I hope I can close this issue now.