Making characters non-specialControlling HyperlatexChanging the formatting of footnotesSetting Html attributesContentsIndex

Setting Html attributes

If you are familiar with HTML, then you will sometimes want to be able to add certain HTML attributes to the HTML tags generated by Hyperlatex. This is possible using the command \xmlattributes. Its first argument is the name of an HTML tag (in lower case!), the second argument can be used to specify attributes for that tag. The declaration can be used in the preamble as well as in the document. A new declaration for the same tag cancels any previous declaration, unless you use the starred version of the command: It has effect only on the next occurrence of the named tag, after which Hyperlatex reverts to the previous state.

All the HTML-tags created using the \xml-command can be influenced by this declaration. There are, however, also some HTML-tags that are created directly in the Hyperlatex kernel and that do not look up any attributes here. You can only try and see (and complain to me if you need to set attribute for a certain tag where Hyperlatex doesn't allow it).

Some common applications:

HTML 3.2 allows you to specify the background color of an HTML node using an attribute that you can set as follows. (If you do this in init.hlx or the preamble of your file, all nodes of your document will be colored this way.) Note that this usage is deprecated, you should be using a style sheet instead.

   \xmlattributes{body}{bgcolor="#ffffe6"}

The following declaration makes the tables in your document have borders.

   \xmlattributes{table}{border="1"}

A more compact representation of the list environments can be enforced using (this is for the itemize environment):

   \xmlattributes{ul}{compact}

The following attributes make section and subsection headings be centered.

   \xmlattributes{h1}{align="center"}
   \xmlattributes{h2}{align="center"}

Tom Sgouros, September 13, 2005

Making characters non-specialControlling HyperlatexChanging the formatting of footnotesSetting Html attributesContentsIndex