Generation of simple, CSS-less HTML with htlatex
You have to do two things:
you can disable generation of css and ugly elements like
<span
class="cmti-10x-x-109">Emphasized text</span>
with some command line options:
htlatex filename "xhtml,NoFonts,-css"
You will then have to provide configurations for em
and textit
, as they are by default dealt only by css.
This should be done with custom config file, like myfonts.cfg
\Preamble{xhtml}
\Configure{emph}{\ifvmode\ShowPar\fi\HCode{<em>}}{\HCode{</em>}}
\Configure{textbf}{\ifvmode\ShowPar\fi\HCode{<b>}}{\HCode{</b>}}
\begin{document}
\EndPreamble
Now your htlatex call will be
htlatex filename "myfonts,-css,NoFonts"
Resulting html
<body
>
<!--l. 4--><p class="noindent" >Normal text
</p><!--l. 6--><p class="indent" > <em>Emphasized text</em>
</p><!--l. 8--><p class="indent" > <b>Bold-faced text</b> </p>
</body></html>
All command line options of tex4ht
are described in this article. There are also other interesting articles about configuring of this system.
For getting rid of <p class="indent">
, you can put following to the config file:
\Configure{HtmlPar}
{\EndP\Tg<p>}
{\EndP\Tg<p>}
{\HCode{</p>\Hnewline}}
{\HCode{</p>\Hnewline}}
You can use
htlatex myfile.tex "html,css-in"
This will embed css into the html file.
Note that, you may need to execute the command two times because the "css-in" option uses the .css file generated in the previous call.