# [tex4ht] issue with raw html output with httex

Patrice Dumas pertusus at free.fr
Sun Oct 25 21:30:50 CET 2020

On Sun, Oct 25, 2020 at 12:59:34PM -0700, William F Hammond wrote:
> On Sun, Oct 25, 2020 at 12:05 PM Patrice Dumas <pertusus at free.fr> writes in
> part:
>
> If I pass a texi document to httexi, with \input texinfo, @setfilename
> > and @bye it does not give an error, but the result is not correct, there
> > is no inserted html, and the output is simple text without html
> > elements:
> >
> > ...
> >
> > Is there a combination of TeX code and texinfo code to make it right?
> >
> >
> For texi I do not understand why one would want to involve tex4ht at all.
> Aside from math Texinfo is a well-defined language independent of its
> implementation as a TeX macro package.  Texinfo, which is, after all, the
> language GNU documentation, has mostly been used for software
> documentation, and for that reason mathematical text has not been a
> priority.  I doubt if there are many Texinfo documents that incorporate
> math.

Actually there are and it has been a feature used for a long time, in
particular for the Singular manual, which used texi2html in part because
it could output math, using latex2html since before 2000.  The need for
tex4ht is actually not for full manuals, but for fragments to render
correctly to html mostly maths (in general in @tex blocks, in the @math
command, and very recently in @displaymath).

The idea is that there is a TeX or texinfo file generated with markers
between those markers the code that one want to convert.  For example,
for texinfo:

@verbatim

<!-- tex4ht_begin tex_tex4ht_math math 1 -->
@end verbatim
@math{{x^i}\over{\tan y}}
@verbatim
<!-- tex4ht_end tex_tex4ht_math math 1 -->

@end verbatim
@verbatim

<!-- tex4ht_begin tex_tex4ht_math math 2 -->
@end verbatim
@math{a at sup{b} + {x^i}\over{\tan y}}
@verbatim
<!-- tex4ht_end tex_tex4ht_math math 2 -->

@end verbatim

The advantage of doing it with texinfo (httexi) and not tex (httex)
is that code that is valid Texinfo and rendered correctly by texinfo.tex
as pdf could be rendered as html by httexi, for example valid mix of
TeX and Texinfo syntax in @math{}, for example
@math{a at sup{b} + {x^i}\over{\tan y}}.

It actually worked in the past, use of tex4ht in texi2html dates back
from 2007, use of httexi probably from 2009.

> If one is unhappy with the HTML generated this way, one can use the --xml
> option to generate the Texinfo-equivalent XML and then use XSLT or whatever
> XML translation library to meet one's needs.

It is not easy to do so, and to my knowledge nobody has tried.

> Well, there's still the math question.  I haven't looked at Texinfo
> recently enough to know if the Texinfo keepers have made its math
> well-defined, but the last time I looked it was not so.  If still not so,
> that should be done.  It should not simply be TeX math or even LaTeX math
> although the guide should be the mostly commonly used parts of LaTeX math
> enhanced with AMS improvements but with the full syntactic rigor of Texinfo
> source so that all of the makeinfo options can cover the math.

I didn't get the point here, sorry.

--
Pat