bugtex4ht - Bugs: bug #275, titlesec package slows down tex4ht

Show feedback again

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

bug #275: titlesec package slows down tex4ht

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Mon 28 Mar 2016 11:44:08 AM EEST  
Category: NonePriority: 5 - Normal
Severity: 3 - MinorStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Thu 31 Mar 2016 02:38:56 PM EEST, comment #3:

I've spent yesterday by hunting the slowdown, I've rewrote lot of titlesec in custom .4ht file, but still haven't found the cause. There was lot of cases where token registers or \edef commands which were feeded with some new content in each section, but it is still slowing down. So it might be really easier to just contact Javier :)

Michal Hoftich <michal_h21>
Project Member
Wed 30 Mar 2016 02:13:01 AM EEST, comment #2:

the maintainer of titlesec is javier bezos. he is still around. if we asked him to just make titlesec a no-op for tex4ht, he might be willing. would one of you be willing to ask him about it?
thanks, k.

Karl Berry <karl>
Project Administrator
Tue 29 Mar 2016 06:38:06 PM EEST, comment #1:

I am not sure what to do with this. titlesec really can't work with tex4ht, as sectioning commands are heavily redefined by tex4ht and they should be configured using CSS, titlesec's configurations can't be used due to totally different display models between DVI/PDF and CSS.

It would be best if titlesec wasn't loaded at all with tex4ht, only dummy definitions of macros which may be used in the document. The problem is that tex4ht redefines macros after the end of preamble, so we can't fix the macros which were called in the preamble. So you must either modify your document to include problematic package only when tex4ht isn't called, or the package itself must be modified to cooperate with tex4ht.

Michal Hoftich <michal_h21>
Project Member
Mon 28 Mar 2016 11:44:08 AM EEST, original submission:

Adding titlesec package slows down tex4ht considerably.

I can't make a MWE now, but there is a file that shows this problem. The following zip file contains all the needed input to reproduce this problem


There is file called compile.sh in the zip file which has this line:

make4ht --lua -u -c ./nma.cfg -e ./main.mk4 report.tex "htm,3,pic-align,notoc*"

The fix is to remove the package titlesec which is loaded in the file my_core.tex in the same folder. Now the compilation will speed up and become many times faster.

Thanks for finding the fix goes to Jagath AR​

This was reported at tex4ht mailing list. For more info: http://tug.org/pipermail/tex4ht/2016q1/001397.html

I am reporting this as a performance bug so that it is tracked and known even though there is a workaround.

Nasser M. Abbasi <nma123>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by karl (Posted a comment)
  • -unavailable- added by michal_h21 (Posted a comment)
  • -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):



    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup+gray