[tex4ht] Typesetting source code and pseudo-code

Jagath AR jagathar at gmail.com
Tue Jan 5 05:49:17 CET 2016


Hi Hans,
Could you please send a minimal working example with the problem and the
command line used to generate the html file.

Jagath

On 4 January 2016 at 22:08, Hans Georg Schaathun <georg+tex at schaathun.net>
wrote:

> Hi,
>
> I am struggling to find a good way to typeset source code
> with tex4ht.  In my opinion the <code> tag should be used
> in HTML, for the benefit of screen readers and search engines
> which might need the semantics.
>
> I am used to using both lstlisting (listings package), verbatim,
> and code (texpower package).  Texpower does not seem to be supported
> by tex4ht at all.  verbatim is ok, except that I should like to
> reconfigure it to use the <code> tag.  lstlisting is brilliant for
> source code, except for the <code> tag.  For pseudo-code I also
> have the problem that tex4ht does not grok maths within lstlisting.
> It causes an unclosed tags.
>
> Has anyone found a way cleanly to produce <code> elements with tex4ht?
> All my attempts either produce an excess of tags which mess up
> the spacing, or they make tex strip linebreaks before it gets
> to tex4ht.  I do not understand all the low-level TeX code in the
> listings.4ht style, and I would really hope I don't have to ...
>
> Preferably, I should like to specify a custom class name for the
> purpose of CSS configuration, but it is obviously possible to tailor
> the CSS style to a non-custom class name if I have to.
>
> Secondly, is there a good fix to make tex4ht accept maths within
> lstlisting?
>
> Thanks a lot for any pointers,
> --
> :-- Hans Georg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex4ht/attachments/20160105/ce0796bc/attachment.html>


More information about the tex4ht mailing list