[tex4ht] How to insert HTML code at any location in the generated HTML file?

Radhakrishnan CV cvr at river-valley.org
Wed Jul 10 16:32:06 CEST 2013


On Wed, Jul 10, 2013 at 4:28 PM, Nasser M. Abbasi <nma at 12000.org> wrote:

> On 7/10/2013 5:49 AM, Radhakrishnan CV wrote:
>
>> On Wed, Jul 10, 2013 at 1:54 PM, Nasser M. Abbasi <nma at 12000.org> wrote:
>>
>>  I am converting a latex document that I used to compile with
>>> latex2html to htlatex.
>>>
>>>
>> [...]
>>
>>
>>  What is the correct way to insert HTML code any where in
>>> the document, and have it show at that location in the HTML
>>> file? I have very large amount of HTML code that was inserted in
>>> that document.
>>>
>>>
>> You might use {verbatim} environment as in any LaTeX document.
>>
>> \documentclass{article}
>>
>> \begin{document}
>>
>> \begin{verbatim}
>>
>>     any HTML code here
>>
>> \end{verbatim}
>>
>> \end{document}
>>
>> Hope this helps.
>>
>> Best regards
>>
>>
> Sure, I know I can use Verbatim.
>
> May be I did not explain the problem well.
>
> I want to inject HTML code, into the generated HTML itself
> (when running htlatex only)
>
> If I write
>
> --------------------------
>
> \documentclass{article}
> \begin{document}
>
> \begin{verbatim}
> <h2>This is HTML head 2 </h2>
> \end{verbatim}
>
> \end{document}
> ---------------------------
>
> the HTML generated will just look like this:
>
>    <h2>This is HTML head 2 </h2>
>
> Which is clearly not what I wanted.
>

OK. I misunderstood your problem. I think, this should solve your problem:

 Please try this:

\documentclass{article}
\begin{document}

\ScriptEnv{html}
 {\NoFonts\hfill\break}
 {\EndNoFonts}

\begin{html}
<h2>This is HTML head 2 </h2>
\end{html}

\end{document}


Best regards
-- 
Radhakrishnan
River Valley<https://maps.google.com/maps?q=River%20Valley,%20Thiruvananthapuram%20Neyyardam%20Road,%20Kerala,%20India&vector=1>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex4ht/attachments/20130710/0df96771/attachment.html>


More information about the tex4ht mailing list