HTMLcodeWhen the tag also needs a closing tag (e.g <I>...</I>) the contents must be given, enclosed in braces. Both the opening and closing tags then will be placed correctly.[
attribs]{
tag}
HTMLcode[
attribs]{
tag}{
contents}
Warning: In version 97.1 this command was actually called HTML. However style files may well define HTML to mean something else, like a styled version of the HTML acronym. So in version 98.1 the name has been changed to HTMLcode.
If no other definition of HTML exists, then this command will be defined, to work the same as HTMLcode.
An important aspect of this is that any of the tag, attribs and contents may be given wholly by expanding a LATEX macro, or may contain arbitrary macros, perhaps including other HTMLcode commands. The following tableThe contents of Figure ex:HTMLcode was constructed using this feature; its LATEX source follows.
|
\newcommand{\myalign}{center} \newcommand{\mylist}{UL} \newcommand{\myitem}[2]{\HTMLcode[disc]{LI}{\simpletest{#1}{#2}}} \newcommand{\simpletest}[2]{% \HTMLcode{#1}{ a simple test of “#2”,} using \HTMLcode{CODE}{<#1>} .} \newcommand{\tableopts}{10,border=5} \newcommand{\tablelist}[4][left]{\HTMLcode[#1]{DIV}{ \HTMLcode[\tableopts]{TABLE}{ \HTMLcode[bottom]{CAPTION}{ #3 }\HTMLcode{TR}{\HTMLcode{TD}{ \HTMLcode{#2}{ #4 }}} }}\HTMLcode[all]{BR}} \tablelist[\myalign]{\mylist}{% \textbf{A listing of the different text styles available in HTML 3.2}}{% \myitem{B}{bold-face} \myitem{I}{italics} \myitem{TT}{teletype-text} \myitem{U}{underlining} \HTMLcode[circle]{LI}{\simpletest{STRIKE}{strikeout}} \myitem{EM}{emphasis style} \myitem{STRONG}{strong style} \myitem{CODE}{code style} \myitem{CITE}{citation style} \myitem{DFN}{definition style} \HTMLcode[square]{LI}{\simpletest{SAMP}{sample style}} \HTMLcode[square]{LI}{\simpletest{KBD}{keyboard style}} \myitem{VAR}{variable style}}
The above code demonstrates many aspects of the way HTML
commands can be used.
Some further aspects of the use of this HTML
command are not apparent from the above example.