[tex4ht] issue with raw html output with httex

Patrice Dumas pertusus at free.fr
Sun Oct 25 16:40:21 CET 2020

On Sun, Oct 25, 2020 at 12:27:08PM +0100, Michal Hoftich wrote:
> Hello Pat,
> replace calls to tex by etex.


> Another issue is that TeX4ht needs `\document` and `\enddocument` commands
> to appear in the compilation, because all HTML configurations happen at this
> moment, and also HTML header is written. You don't need to change your TeX
> file, just make another file with the necessary structure and include your
> original file here. 

In my case, there is no trouble with having `\document` and `\enddocument`
explicitly in the document, nor to add commands in preamble, as the
files are automatically generated and should only be run through tex4ht
scripts, never directly through TeX.

> You can then compile this file and instead of the
> original one.
> The container file can look like this:
> %%%%%%
> \input plain-4ht.tex
> \document
> \input bug_httex.tex
> \enddocument
> %%%%%%
> It depends on plain-4ht.tex:
> %%%%%%
> \def\documentstyle#1{}
> \documentstyle{tex4ht}
> \csname tex4ht\endcsname
> \def\document{}
> \def\enddocument{\csname bye\endcsname}
> %%%%%%

With this in preamble and the use of \document and \enddocument, 
the output is as intented, both the insertion of raw html and 
the formatting.  Thanks!

What would be the equivalent for httexi?  Is it the same?  

In httex the tex calls are like 

 tex  $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1

In addition to calling etex, is that needed or should it be 
replaced by inlined plain-4ht.tex?

As a side note the tex calls in httexi are not exactly the same as in 

 tex  $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1

Thanks a lot in any case!


More information about the tex4ht mailing list.