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

Michal Hoftich michal.h21 at gmail.com
Thu Aug 14 19:13:46 CEST 2014

I don't think you should use `\newline` for this purpose, particularly
not in conversion to html. If you want to use images on separate line
in toc, use CSS for this, something like:

\Css{.tableofcontents img{display: block;}}

in your cfg file. I haven't tested this!


2014-08-10 14:41 GMT+02:00 Nasser M. Abbasi <nma at 12000.org>:
> 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
> ---------------------------------
> \documentclass[12pt,notitlepage]{article}%
> \begin{document}
> \tableofcontents
> \clearpage
> \section{line one\newline
>          line two
>         }
> \end{document}
> --------------------------------
> When compiling the above using
>   htlatex foo.tex
> and looking at the HTML, I see the following:
> --------------------------------
> </head><body>
>    <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!
>    </div>
>    <h3 class="sectionHead"><span class="titlemark">1 </span>
>       <a id="x1-20001"></a>
>         line one<br class="newline" />line two
>    </h3>
> </body>
> ------------------------------------
> texlive 2014.
> thanks,
> --Nasser

More information about the tex4ht mailing list