[tex4ht] Is there any easy way to make tex4ht produce a newline inside the section/chapter title?

Nasser M. Abbasi nma at 12000.org
Sun Aug 10 14:41:27 CEST 2014

What I am trying to do it make a section title be
a small image, then put small label below the image.

This is so when I process the tex file, the HTML will have
a toc that has small image for each section title to click on
to go to the section instead of just plain text.

I can put a small image and text label in the section title
and process them with pdflatex and tex4ht with no problem.

Only small issue, is that tex4ht does not produce a newline
in the tableofcontents when viewed in final HTML, as pdflatex
does in the PDF. So the lable comes on the same line as the
image instead of below it compared to the PDF.

Is there a simple way to tell tex4ht to produce newline
in section title? May be some smart \Config command?

Here is MWE


\section{line one\newline
          line two

When compiling the above using

   htlatex foo.tex

and looking at the HTML, I see the following:
    <h3 class="likesectionHead"><a id="x1-1000"></a>Contents</h3>
    <div class="tableofcontents">
    <span class="sectionToc" >1 <a href="#x1-20001" id="QQ2-1-2">
          line one line two </a></span>    ---->>>>>> no line break!

    <h3 class="sectionHead"><span class="titlemark">1 </span>
       <a id="x1-20001"></a>
         line one<br class="newline" />line two

texlive 2014.


More information about the tex4ht mailing list