bugtex4ht - Bugs: bug #592, inconsistent font sizes used for...

Show feedback again

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

bug #592: inconsistent font sizes used for subsubsection/paragraph titles in tex4ht. How to fix?

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Sun Jan 1 18:28:48 2023  
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue Jan 10 15:05:40 2023, comment #5:

I've just added the default style. It fixes the section titles, page dimensions, and images in the dark mode. The default CSS can be disabled using the "nostyle" option.

Michal Hoftich <michal_h21>
Project Member
Thu Jan 5 16:29:01 2023, comment #4:

Maybe we could add a CSS style that would address not only the size of sections, but also other issues, like responsive page size or images in dark mode. The question is whether to use it by default, or just by option. What speaks for default use is that, as Nasser noted, most users use the default settings and have no idea how to solve such problems. For users who want to use a custom style, we could provide an option that would ignore the default styles.

Michal Hoftich <michal_h21>
Project Member
Sun Jan 1 21:56:19 2023, comment #3:

I agree that it is really strange that <h5> and <h6> are smaller than 1em. I think we should still use correct heading levels, for semantic and accessibility reasons. As only \subsubsection uses such small font size, I think we can just set font size for this element to 1em.

And maybe we can also provide some option to request a nicer default CSS.

Michal Hoftich <michal_h21>
Project Member
Sun Jan 1 21:33:18 2023, comment #2:

To my mind, this is a bug in the browser(s). Browsers should not render any <hN> tag as less than the body size. That's nonsensical.

But given that reality, and that it's unlikely to change, my suggestion for tex4ht is to avoid h5 and h6, since they are useless, and just use h4 for all those lower-level sectioning elements. Maybe with a class="subsubsection" or whatever so they can be distinguished if anyone cares to.

This seems cleaner to me than specifying explicit sizes for everything.

Karl Berry <karl>
Project Administrator
Sun Jan 1 20:49:24 2023, comment #1:

I've posted my solution at TeX.sx. It is just a matter of few lines of CSS. I am not sure if it is good idea to add it to TeX4ht sources, as it is preferable if users set high level design elements themselves, IMHO. But it is true that it is not really good that \subsubsection is rendered that small, and lot of people will not try to fix that.

So that is my question: should we set default sizes for sectioning commands?

Michal Hoftich <michal_h21>
Project Member
Sun Jan 1 18:28:48 2023, original submission:

Reference and screen shot at


I noticed in tex4ht that the size of the font used for the paragraph title is the same as that of the section title (i.e. too large) and the size of the font for the subsubsection is smaller than that used for the paragraph, which it should be larger or at least the same size.

This makes looking at titles confusing as font size gives indication of order.

The font size should decrease all the way from chapter to paragraph. Now it decreases but then starts to increase once it reaches paragraph.

in PDF, it is consistent, as the sizes decrease correctly from chapter to paragraph. Screen shots below


\title{my book title}

\part{first part}
\chapter{first chapter}
\section{first section}
\subsection{first subsection}
\subsubsection{first subsubsection}
\paragraph{first paragraph}


Compiled using

make4ht -ulm default -a debug foo.tex 'mathjax,htm'


enter image description here

Compare to the pdf where the sizes decreases uniformly (but hard to see if font used for paragraph is smaller or same as subsubsection, but at least it is not larger like with the HTML)

enter image description here

Question is: How to make the size of the font used for paragraph title with tex4ht not be larger than subsubsection? Is there a way to control these settings?

TL 2022

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):



    1 latest change follows.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Apr 18 09:02:28 2023michal_h21Open/ClosedOpen=>Closed
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup+gray