[tex4ht] [bug #576] \HCode alternative that copies verbatim?

Michal Hoftich puszcza-hackers at gnu.org.ua
Sun Aug 28 22:08:19 CEST 2022


Follow-up Comment #6, bug #576 (project tex4ht):

Sure, just define the environment in this way in the document:

%%%%%%%%%%%%%%%%%%
\documentclass{article}
\NewDocumentEnvironment{foo}{+b}{}{}
\NewDocumentEnvironment{latexenv}{}{}{}
\long\def\FooCmd #1\EndFooCmd{}


\begin{document}

normal text

\begin{foo}
<p dir="auto">The following code shows the concept:</p>

<p dir="auto">This is another paragraph</p>
\end{foo}

normal text

  \begin{latexenv}
  $$E = mc^2$$ And this is \textit{latex}.
  \end{latexenv}

\FooCmd
<p dir="auto">The following code shows the concept:</p>

<p dir="auto">This is another paragraph</p>
\EndFooCmd
\end{document} 
%%%%%%%%%%%%%%%%%%%

And then redefine it to eat the argument in the configuration file:

%%%%%%%%%%%%%%%%
\Preamble{xhtml}
\ScriptEnv{foo}
{\ifvmode\IgnorePar\fi\EndP\NoFonts\hfill\break }
{\EndNoFonts }

\ScriptCommand{\FooCmd}
{\ifvmode\IgnorePar\fi\EndP\NoFonts\hfill\break }
{\EndNoFonts }
\RenewDocumentEnvironment{latexenv}{+b}{}{}
\begin{document}
\EndPreamble
%%%%%%%%%%%%%%%%


    _______________________________________________________

Reply to this item at:

  <http://puszcza.gnu.org.ua/bugs/?576>

_______________________________________________
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



More information about the tex4ht mailing list.