next up previous contents
Next: Environments with an argument Up: Converting LaTeX .sty Style Previous: Optional arguments   Contents

Writing Subroutines to Translate LaTeX Environments

For every environment env-name that is encountered, LaTeX2HTML will use the subroutine &do_env_env-name, if it exists. The body of the environment will be passed to this subroutine as a single string.

Consider a trivial example: suppose you want to define an environment called, say, bfit that typesets its contents in a bold italic font, the LaTeX code might look something like:

\newenvironment{bfit}
{\begin{bfseries}\itshape}
{\end{bfseries}}
The corresponding Perl file will need to define a subroutine called &do_env_bfit, that will look something like:
sub do_env_bfit{
   local($_) = @_;

   "<B><I>" . $_ . "</I></B>";
}
This puts the contents of the environment into the HTML bold and italic markups.



Subsections

Dr Nicola L C Talbot 2005-06-10