[tex4ht] How to increase spacings/indentation in table of content for generated HTML?

Nasser M. Abbasi nma at 12000.org
Wed Jul 24 11:52:30 CEST 2013

The toc generated by tex4ht, in HTML, has too small horizontal
indentation between different levels.

I'd like the next level to be a little more indented away. i.e.
same way as it appears in the toc generated by pdflatex.

Looking around, I found this

with a nice solution by Eitan which I used and it works, except it has
bullets added to each entry. (please see screen shot below)

I tried to understand the code and remove these bullets while keeping
the better indentation now, but I do not understand how the code works.

To make it clear, here is a screen shot


The top pic shows the default toc. As you can see, the indentation
is too small (between say section and subsection, etc....)

12. section
--12.1 subsection

I'd like to see something like

12. section
----12.1 subsection

The second pic, is the pdf toc.

The 3rd is the result of using Eitan code. And again, I'd like
to ask if there is a way to modify his code, or use different way
or option, to make the indentation larger.

Here is the code btw, just to be clear, it is in the above link also.

----- my .cfg -----
       {\tocNesting{1}\HCode{<li>}}{ }{}{ }
       {\tocNesting{2}\HCode{<li>}}{ }{}{ }
       {\tocNesting{3}\HCode{<li>}}{ }{}{ }
       {} {\tocNesting{0}} {} {} {}

       \expandafter\ifx \csname level#1\endcsname\relax
           \ifnum #1>0 \HCode{<ul>}\fi
           \expandafter\def \csname level#1\endcsname{\HCode{</ul>}}
       \c=#1 \advance\c by 1
         \csname level\the\c\endcsname
         \expandafter\let \csname level\the\c\endcsname\relax
         \advance\c by 1
       \ifnum \c<10   \repeat

Is it possible to modify the above to just remove those black dots and
the white dots that show up in the table of content?


More information about the tex4ht mailing list