# TeX4ht and Plain TeX

According to tug.org TeX4ht can be used with Plain TeX. I've tried the commands listed in the site above, but nothing works! All I can have is a simple text file, with .html extension, but without any HTML tag.

What is the correct way to convert a Plain TeX file into HTML?

-
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  egreg Jan 4 '12 at 10:26
Hello @egreg!. Nice to meet you here. –  Sam Qasbah Jan 4 '12 at 10:30
Let's try and see if someone here is able to help. –  egreg Jan 4 '12 at 10:32
Hmm, htlatex is working as expected. Maybe some bug? –  someonr Jan 4 '12 at 11:04
@someonr: I don't know what htlatex is. As you can read in the link I enclosed, and as I said three times in my message (once in the title), I was speaking about Plain TeX. Thanks for your comment anyway. –  Sam Qasbah Jan 4 '12 at 11:23

edit: I've created simple package for Plain support in tex4ht. Basically it defines commands needed by tex4ht to insert basic document hooks:

% file plain-4ht.tex
\def\documentstyle#1{}
\documentstyle{tex4ht}
\csname tex4ht\endcsname
\def\document{}
\def\enddocument{\csname bye\endcsname}


Now you can just use:

\input plain-4ht.tex
\document

Some text.
\enddocument


What is still a issue is support for accented characters.

Original post:

According to CVR's blog, you need to enclose your document with these commands:

\input amstex
\documentstyle{amsppt}
\csname tex4ht\endcsname
\document

. . . source of your plain TeX document . . .

\enddocument


and compile with

httex file "xhtml,html4.4ht,unicode.4ht,mathml.4ht"


Following sample works for me:

 \input amstex
\documentstyle{amsppt}
\csname tex4ht\endcsname
\document

{\bf What} about the {\it formatting}

The quadratic formula is $-b \pm \sqrt{b^2 - 4ac} \over 2a$

P\v{r}\'ili\v{s} \v{z}lu\v{t}ou\v{c}k\'y ku\v{n} \'up\v{e}l \v{d}\'abelsk\'e \'ody
\enddocument\bye


I am not plain TeX user and don't know what is the plain version of the inputenc, so instead of utf-8 characters I used control sequences for the diacritics.

-