The hyperref package seems to have conflict with titlesec package when compiled with make4ht. The following document is compiled with make4ht. The compiled html file doesn't contain table of contents.


How could this be dealt with? Note that there is no problem when titlesec package and the command titleformat is removed.


This issue is not related to hyperref, it is really the \titleformat what causes the issue, namely the runin option. It seems to redefine the \section in a way where tex4ht isn't able to insert the HTML tags for headers and they are not saved to the TOC. Also the third section is missing from the document completely.

I've found that the hang format works with tex4ht, so there is an easy fix: just redefine the runin (and display, which has the same issue as runin) format to hang:


I've added the \titlelabel{\thetitle.} line to get the dots after section number, because it seems that this feature isn't supported by tex4ht configuration for \titleformat-

It seems to work now:

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.