tiny update to translations
[goodguy/cin-manual-latex.git] / html.sty
1 %
2 % $Id: html.sty,v 1.39 2001/10/01 22:47:06 RRM Exp $
3 % LaTeX2HTML Version 2K.1 : html.sty
4
5 % This file contains definitions of LaTeX commands which are
6 % processed in a special way by the translator. 
7 % For example, there are commands for embedding external hypertext links,
8 % for cross-references between documents or for including raw HTML.
9 % This file includes the comments.sty file v2.0 by Victor Eijkhout
10 % In most cases these commands do nothing when processed by LaTeX.
11 %
12 % Place this file in a directory accessible to LaTeX (i.e., somewhere
13 % in the TEXINPUTS path.)
14 %
15 % NOTE: This file works with LaTeX 2.09 or (the newer) LaTeX2e.
16 %       If you only have LaTeX 2.09, some complex LaTeX2HTML features
17 %       like support for segmented documents are not available.
18
19 % Changes:
20 % See the change log at end of file.
21
22
23 % Exit if the style file is already loaded
24 % (suggested by Lee Shombert <las@potomac.wash.inmet.com>
25 \ifx \htmlstyloaded\relax \endinput\else\let\htmlstyloaded\relax\fi
26 \makeatletter
27
28 % allow for the hyperref package to be cleanly loaded
29 % either before or after this package,
30 % and ensure it is already loaded, when using pdf-TeX
31
32 \ifx\undefined\hyperref
33  \ifx\pdfoutput\undefined \let\pdfunknown\relax
34   \let\html@new=\newcommand
35  \else
36   \ifx\pdfoutput\relax \let\pdfunknown\relax
37    \RequirePackage{hyperref}\let\html@new=\renewcommand
38   \else
39    \ifcase\pdfoutput
40     \let\pdfunknown\relax    \let\html@new=\newcommand
41    \else
42      \RequirePackage[pdftex]{hyperref}\let\html@new=\newcommand
43    \fi
44
45   \fi
46  \fi
47 \else
48  \let\html@new=\renewcommand
49 \fi
50
51 \providecommand{\latextohtml}{\LaTeX2\texttt{HTML}}
52
53 %%% LINKS TO EXTERNAL DOCUMENTS
54 %
55 % This can be used to provide links to arbitrary documents.
56 % The first argumment should be the text that is going to be
57 % highlighted and the second argument a URL.
58 % The hyperlink will appear as a hyperlink in the HTML 
59 % document and as a footnote in the dvi or ps files.
60 %
61 \ifx\pdfunknown\relax
62  \html@new{\htmladdnormallinkfoot}[2]{#1\footnote{#2}} 
63 \else
64  \def\htmladdnormallinkfoot#1#2{\footnote{\href{#2}{#1}}}
65 \fi
66
67 % This is an alternative definition of the command above which
68 % will ignore the URL in the dvi or ps files.
69 \ifx\pdfunknown\relax
70  \html@new{\htmladdnormallink}[2]{#1}
71 \else
72  \def\htmladdnormallink#1#2{\href{#2}{#1}}
73 \fi
74
75 % This command takes as argument a URL pointing to an image.
76 % The image will be embedded in the HTML document but will
77 % be ignored in the dvi and ps files.
78 %
79 \ifx\pdfunknown\relax
80  \html@new{\htmladdimg}[1]{}
81 \else
82  \def\htmladdimg#1{\hyperimage{#1}}
83 \fi
84
85
86 %%% CROSS-REFERENCES BETWEEN (LOCAL OR REMOTE) DOCUMENTS
87 %
88 % This can be used to refer to symbolic labels in other Latex 
89 % documents that have already been processed by the translator.
90 % The arguments should be:
91 % #1 : the URL to the directory containing the external document
92 % #2 : the path to the labels.pl file of the external document.
93 % If the external document lives on a remote machine then labels.pl 
94 % must be copied on the local machine.
95 %
96 %e.g. \externallabels{http://cbl.leeds.ac.uk/nikos/WWW/doc/tex2html/latex2html}
97 %                    {/usr/cblelca/nikos/tmp/labels.pl}
98 % The arguments are ignored in the dvi and ps files.
99 %
100 \newcommand{\externallabels}[2]{}
101
102
103 % This complements the \externallabels command above. The argument
104 % should be a label defined in another latex document and will be
105 % ignored in the dvi and ps files.
106 %
107 \newcommand{\externalref}[1]{}
108
109
110 % Suggested by  Uffe Engberg (http://www.brics.dk/~engberg/)
111 % This allows the same effect for citations in external bibliographies.
112 % An  \externallabels  command must be given, locating a labels.pl file
113 % which defines the location and keys used in the external .html file.
114 %  
115 \newcommand{\externalcite}{\nocite}
116
117 % This allows a section-heading in the TOC or mini-TOC to be just
118 % a hyperlink to an external document.
119 %
120 %   \htmladdTOClink[<path_to_labels>]{<section-level>}{<title>}{<URL>}
121 % where <section-level> is  'chapter' , 'section' , 'subsection' etc.
122 % and <path_to_labels> is the path to find a  labels.pl  file,
123 % so that external cross-referencing may work, as with \externallabels
124 %
125 %\ifx\pdfunknown\relax
126  \newcommand{\htmladdTOClink}[4][]{}
127 %
128 % can do something here, using the \pdfoutline primitive
129 %\else
130 % \def\htmladdTOClink#1#2#3#4{\pdfoutline user {/S /URI /URI #4}
131 %   name{#2} count{#1}{#3}}
132 %\fi
133
134
135 %%% HTMLRULE
136 % This command adds a horizontal rule and is valid even within
137 % a figure caption.
138 % Here we introduce a stub for compatibility.
139 \newcommand{\htmlrule}{\protect\HTMLrule}
140 \newcommand{\HTMLrule}{\@ifstar\htmlrulestar\htmlrulestar}
141 \newcommand{\htmlrulestar}[1]{}
142
143 %%% HTMLCLEAR
144 % This command puts in a <BR> tag, with CLEAR="ALL"
145 \newcommand{\htmlclear}{}
146
147 % This command adds information within the <BODY> ... </BODY> tag
148 %
149 \newcommand{\bodytext}[1]{}
150 \newcommand{\htmlbody}{}
151
152
153 %%% HYPERREF 
154 % Suggested by Eric M. Carol <eric@ca.utoronto.utcc.enfm>
155 % Similar to \ref but accepts conditional text. 
156 % The first argument is HTML text which will become ``hyperized''
157 % (underlined).
158 % The second and third arguments are text which will appear only in the paper
159 % version (DVI file), enclosing the fourth argument which is a reference to a label.
160 %
161 %e.g. \hyperref{using the tracer}{using the tracer (see Section}{)}{trace}
162 % where there is a corresponding \label{trace}
163 %
164 % avoid possible confict with  hyperref  package
165 \ifx\undefined\hyperref
166  \newcommand{\hyperrefhyper}[4]{#4}%
167  \def\next{\newcommand}%
168 \else
169  \let\hyperrefhyper\hyperref
170  \def\next{\renewcommand}%
171 \fi
172 \next{\hyperref}{\hyperrefi[]}\let\next=\relax
173
174 \def\hyperrefi[#1]{{\def\next{#1}\def\tmp{}%
175  \ifx\next\tmp\aftergroup\hyperrefdef
176  \else\def\tmp{ref}\ifx\next\tmp\aftergroup\hyperrefref
177  \else\def\tmp{pageref}\ifx\next\tmp\aftergroup\hyperrefpageref
178  \else\def\tmp{page}\ifx\next\tmp\aftergroup\hyperrefpage
179  \else\def\tmp{noref}\ifx\next\tmp\aftergroup\hyperrefnoref
180  \else\def\tmp{no}\ifx\next\tmp\aftergroup\hyperrefno
181  \else\def\tmp{hyper}\ifx\next\tmp\aftergroup\hyperrefhyper
182  \else\def\tmp{html}\ifx\next\tmp\aftergroup\hyperrefhtml
183  \else\typeout{*** unknown option \next\space to  hyperref ***}%
184  \fi\fi\fi\fi\fi\fi\fi\fi}}
185 \newcommand{\hyperrefdef}[4]{#2\ref{#4}#3}
186 \newcommand{\hyperrefpageref}[4]{#2\pageref{#4}#3}
187 \newcommand{\hyperrefnoref}[3]{#2}
188 \let\hyperrefref=\hyperrefdef
189 \let\hyperrefpage=\hyperrefpageref
190 \let\hyperrefno=\hyperrefnoref
191 \ifx\undefined\hyperrefhyper\newcommand{\hyperrefhyper}[4]{#4}\fi
192 \let\hyperrefhtml=\hyperrefdef
193
194 %%% HYPERCITE --- added by RRM
195 % Suggested by Stephen Simpson <simpson@math.psu.edu>
196 % effects the same ideas as in  \hyperref, but for citations.
197 % It does not allow an optional argument to the \cite, in LaTeX.
198 %
199 %   \hypercite{<html-text>}{<LaTeX-text>}{<opt-text>}{<key>}
200 %
201 % uses the pre/post-texts in LaTeX, with a  \cite{<key>}
202 %
203 %   \hypercite[ext]{<html-text>}{<LaTeX-text>}{<key>}
204 %   \hypercite[ext]{<html-text>}{<LaTeX-text>}[<prefix>]{<key>}
205 %
206 % uses the pre/post-texts in LaTeX, with a  \nocite{<key>}
207 % the actual reference comes from an \externallabels  file.
208 %
209 \newcommand{\hypercite}{\hypercitei[]}
210 \def\hypercitei[#1]{{\def\next{#1}\def\tmp{}%
211  \ifx\next\tmp\aftergroup\hypercitedef
212  \else\def\tmp{int}\ifx\next\tmp\aftergroup\hyperciteint
213  \else\def\tmp{cite}\ifx\next\tmp\aftergroup\hypercitecite
214  \else\def\tmp{ext}\ifx\next\tmp\aftergroup\hyperciteext
215  \else\def\tmp{nocite}\ifx\next\tmp\aftergroup\hypercitenocite
216  \else\def\tmp{no}\ifx\next\tmp\aftergroup\hyperciteno
217  \else\typeout{*** unknown option \next\space to  hypercite ***}%
218  \fi\fi\fi\fi\fi\fi}}
219 \newcommand{\hypercitedef}[4]{#2{\def\tmp{#3}\def\emptyopt{}%
220  \ifx\tmp\emptyopt\cite{#4}\else\cite[#3]{#4}\fi}}
221 \newcommand{\hypercitenocite}[2]{#2\hypercitenocitex[]}
222 \def\hypercitenocitex[#1]#2{\nocite{#2}}
223 \let\hypercitecite=\hypercitedef
224 \let\hyperciteint=\hypercitedef
225 \let\hyperciteext=\hypercitenocite
226 \let\hyperciteno=\hypercitenocite
227
228 %%% HTMLREF
229 % Reference in HTML version only.
230 % Mix between \htmladdnormallink and \hyperref.
231 % First arg is text for in both versions, second is label for use in HTML
232 % version.
233 \ifx\pdfunknown\relax
234  \html@new{\htmlref}[2]{#1}
235 \else
236  \def\htmlref#1#2{\hyperefhyper[#2]{#1}}
237 \fi
238
239 %%% HTMLCITE
240 % Reference in HTML version only.
241 % Mix between \htmladdnormallink and \hypercite.
242 % First arg is text for both versions, second is citation for use in HTML
243 % version.
244 \newcommand{\htmlcite}[2]{#1}
245
246
247 %%% HTMLIMAGE
248 % This command can be used inside any environment that is converted
249 % into an inlined image (eg a "figure" environment) in order to change
250 % the way the image will be translated. The argument of \htmlimage
251 % is really a string of options separated by commas ie 
252 % [scale=<scale factor>],[external],[thumbnail=<reduction factor>
253 % The scale option allows control over the size of the final image.
254 % The ``external'' option will cause the image not to be inlined 
255 % (images are inlined by default). External images will be accessible
256 % via a hypertext link. 
257 % The ``thumbnail'' option will cause a small inlined image to be 
258 % placed in the caption. The size of the thumbnail depends on the
259 % reduction factor. The use of the ``thumbnail'' option implies
260 % the ``external'' option.
261 %
262 % Example:
263 % \htmlimage{scale=1.5,external,thumbnail=0.2}
264 % will cause a small thumbnail image 1/5th of the original size to be
265 % placed in the final document, pointing to an external image 1.5
266 % times bigger than the original.
267
268 \newcommand{\htmlimage}[1]{}
269
270
271 % \htmlborder causes a border to be placed around an image or table
272 % when the image is placed within a <TABLE> cell.
273 \newcommand{\htmlborder}[1]{}
274
275 % Put \begin{makeimage}, \end{makeimage} around LaTeX to ensure its
276 % translation into an image.
277 % This shields sensitive text from being translated.
278 \newenvironment{makeimage}{}{}
279
280
281 % A dummy environment that can be useful to alter the order
282 % in which commands are processed, in LaTeX2HTML
283 \newenvironment{tex2html_deferred}{}{}
284
285
286 %%% HTMLADDTONAVIGATION
287 % This command appends its argument to the buttons in the navigation
288 % panel. It is ignored by LaTeX.
289 %
290 % Example:
291 % \htmladdtonavigation{\htmladdnormallink
292 %              {\htmladdimg{http://server/path/to/gif}}
293 %              {http://server/path}}
294 \newcommand{\htmladdtonavigation}[1]{}
295
296
297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298 % based upon Eijkhout's  comment.sty v2.0
299 % with modifications to avoid conflicts with later versions
300 % of this package, should a user be requiring it.
301 %       Ross Moore,  10 March 1999
302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
303 % Comment.sty   version 2.0, 19 June 1992
304 % selectively in/exclude pieces of text: the user can define new
305 % comment versions, and each is controlled separately.
306 % This style can be used with plain TeX or LaTeX, and probably
307 % most other packages too.
308 %
309 % Examples of use in LaTeX and TeX follow \endinput
310 %
311 % Author
312 %    Victor Eijkhout
313 %    Department of Computer Science
314 %    University Tennessee at Knoxville
315 %    104 Ayres Hall
316 %    Knoxville, TN 37996
317 %    USA
318 %
319 %    eijkhout@cs.utk.edu
320 %
321 % Usage: all text included in between
322 %    \comment ... \endcomment
323 % or \begin{comment} ... \end{comment}
324 % is discarded. The closing command should appear on a line
325 % of its own. No starting spaces, nothing after it.
326 % This environment should work with arbitrary amounts
327 % of comment.
328 %
329 % Other 'comment' environments are defined by
330 % and are selected/deselected with
331 % \includecomment{versiona}
332 % \excludecoment{versionb}
333 %
334 % These environments are used as
335 % \versiona ... \endversiona
336 % or \begin{versiona} ... \end{versiona}
337 % with the closing command again on a line of its own.
338 %
339 % Basic approach:
340 % to comment something out, scoop up  every line in verbatim mode
341 % as macro argument, then throw it away.
342 % For inclusions, both the opening and closing comands
343 % are defined as noop
344 %
345 % Changed \next to \html@next to prevent clashes with other sty files
346 % (mike@emn.fr)
347 % Changed \html@next to \htmlnext so the \makeatletter and
348 % \makeatother commands could be removed (they were causing other
349 % style files - changebar.sty - to crash) (nikos@cbl.leeds.ac.uk)
350 % Changed \htmlnext back to \html@next...
351
352 \def\makeinnocent#1{\catcode`#1=12 }
353 \def\csarg#1#2{\expandafter#1\csname#2\endcsname}
354
355 \def\ThrowAwayComment#1{\begingroup
356     \def\CurrentComment{#1}%
357     \let\do\makeinnocent \dospecials
358     \makeinnocent\^^L% and whatever other special cases
359 %%RRM
360 %%  use \xhtmlComment for \xComment
361 %%  use \html@next    for \next
362     \endlinechar`\^^M \catcode`\^^M=12 \xhtmlComment}
363 {\catcode`\^^M=12 \endlinechar=-1 %
364  \gdef\xhtmlComment#1^^M{\def\test{#1}\edef\test{\meaning\test}
365       \csarg\ifx{PlainEnd\CurrentComment Test}\test
366           \let\html@next\endgroup
367       \else \csarg\ifx{LaLaEnd\CurrentComment Test}\test
368             \edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
369       \else \csarg\ifx{LaInnEnd\CurrentComment Test}\test
370             \edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
371       \else \let\html@next\xhtmlComment
372       \fi \fi \fi \html@next}
373 }
374
375 %%\def\includecomment   %%RRM
376 \def\htmlincludecomment
377  #1{\expandafter\def\csname#1\endcsname{}%
378     \expandafter\def\csname end#1\endcsname{}}
379 %%\def\excludecomment   %%RRM
380 \def\htmlexcludecomment
381  #1{\expandafter\def\csname#1\endcsname{\ThrowAwayComment{#1}}%
382     {\escapechar=-1\relax
383      \edef\tmp{\string\\end#1}%
384       \csarg\xdef{PlainEnd#1Test}{\meaning\tmp}%
385      \edef\tmp{\string\\end\string\{#1\string\}}%
386       \csarg\xdef{LaLaEnd#1Test}{\meaning\tmp}%
387      \edef\tmp{\string\\end \string\{#1\string\}}%
388       \csarg\xdef{LaInnEnd#1Test}{\meaning\tmp}%
389     }}
390
391 %%\excludecomment{comment}      %%RRM
392 \htmlexcludecomment{comment}
393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
394 % end Comment.sty
395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
396 \let\includecomment=\htmlincludecomment
397 \let\excludecomment=\htmlexcludecomment
398
399 %
400 % Alternative code by Robin Fairbairns, 22 September 1997
401 % revised to cope with % and unnested { }, by Ross Moore, 4 July 1998
402 % further revised to cope with & and # in tables, 10 March 1999
403 %
404 \def\raw@catcodes{\catcode`\%=12 \catcode`\{=12 \catcode`\}=12
405  \catcode`\&=12 \catcode`\#=12 }
406 \newcommand\@gobbleenv{\bgroup\raw@catcodes
407  \let\reserved@a\@currenvir\@gobble@nv}
408 \bgroup
409  \def\expansionhead{\gdef\@gobble@nv@i##1}
410  \def\expansiontail{{\def\reserved@b{##1}\@gobble@nv@ii}}
411  \def\expansionheadii{\long\gdef\@gobble@nv##1\end}
412  \def\expansiontailii{{\@gobble@nv@i}}
413  \def\expansionmidii{##2}
414  \raw@catcodes\relax
415  \expandafter\expansionhead\expandafter}\expansiontail
416 \egroup
417 \long\gdef\@gobble@nv#1\end#2{\@gobble@nv@i}
418 %\long\def\@gobble@nv#1\end#2{\def\reserved@b{#2}%
419 \def\@gobble@nv@ii{%
420  \ifx\reserved@a\reserved@b
421   \edef\reserved@a{\egroup\noexpand\end{\reserved@a}}%
422   \expandafter\reserved@a
423  \else
424   \expandafter\@gobble@nv
425  \fi}
426
427 \renewcommand{\htmlexcludecomment}[1]{%
428     \csname newenvironment\endcsname{#1}{\@gobbleenv}{}}
429 \newcommand{\htmlreexcludecomment}[1]{%
430     \csname renewenvironment\endcsname{#1}{\@gobbleenv}{}}
431
432 %%% RAW HTML 
433
434 % Enclose raw HTML between a \begin{rawhtml} and \end{rawhtml}.
435 % The html environment ignores its body
436 %
437 \htmlexcludecomment{rawhtml}
438
439
440 %%% HTML ONLY
441 %
442 % Enclose LaTeX constructs which will only appear in the 
443 % HTML output and will be ignored by LaTeX with 
444 % \begin{htmlonly} and \end{htmlonly}
445 %
446 \htmlexcludecomment{htmlonly}
447 % Shorter version
448 \newcommand{\html}[1]{}
449
450 % for images.tex only
451 \htmlexcludecomment{imagesonly}
452
453 %%% LaTeX ONLY
454 % Enclose LaTeX constructs which will only appear in the 
455 % DVI output and will be ignored by latex2html with 
456 %\begin{latexonly} and \end{latexonly}
457 %
458 \newenvironment{latexonly}{}{}
459 % Shorter version
460 \newcommand{\latex}[1]{#1}
461
462
463 %%% LaTeX or HTML
464 % Combination of \latex and \html.
465 % Say \latexhtml{this should be latex text}{this html text}
466 %
467 %\newcommand{\latexhtml}[2]{#1}
468 \long\def\latexhtml#1#2{#1}
469
470
471 %%% tracing the HTML conversions
472 % This alters the tracing-level within the processing
473 % performed by  latex2html  by adjusting  $VERBOSITY
474 % (see  latex2html.config  for the appropriate values)
475 %
476 \newcommand{\htmltracing}[1]{}
477 \newcommand{\htmltracenv}[1]{}
478
479
480 %%%  \strikeout for HTML only
481 % uses <STRIKE>...</STRIKE> tags on the argument
482 % LaTeX just gobbles it up.
483 \newcommand{\strikeout}[1]{}
484
485 %%%  \htmlurl  and  \url
486 %  implement \url as the simplest thing, if not already defined
487 %  let \htmlurl#1  be equivalent to it 
488 %
489 \def\htmlurlx#1{\begin{small}\texttt{#1}\end{small}}%
490 \expandafter\ifx\csname url\endcsname\relax
491  \let\htmlurl=\htmlurlx \else \let\htmlurl=\url \fi
492
493
494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
495 %%% JCL - stop input here if LaTeX2e is not present
496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
497 \ifx\if@compatibility\undefined
498   %LaTeX209
499   \makeatother\relax\expandafter\endinput
500 \fi
501 \if@compatibility
502   %LaTeX2e in LaTeX209 compatibility mode
503   \makeatother\relax\expandafter\endinput
504 \fi
505
506 %\let\real@TeXlogo = \TeX
507 %\DeclareRobustCommand{\TeX}{\relax\real@TeXlogo}
508
509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
510 %
511 % Start providing LaTeX2e extension:
512 % This is currently:
513 %  - additional optional argument for \htmladdimg
514 %  - support for segmented documents
515 %
516
517 \ProvidesPackage{html}
518           [1999/07/19 v1.38 hypertext commands for latex2html (nd, hws, rrm)]
519
520 %
521 % Ensure that \includecomment and \excludecomment are bound
522 % to the version defined here.
523 %
524 \AtBeginDocument{%
525  \let\includecomment=\htmlincludecomment
526  \let\excludecomment=\htmlexcludecomment
527  \htmlreexcludecomment{comment}}
528
529 %%%  bind \htmlurl to \url if that is later loaded
530 %
531 \expandafter\ifx\csname url\endcsname\relax
532  \AtBeginDocument{\@ifundefined{url}{}{\let\htmlurl=\url}}\fi
533
534 %%%%MG
535
536 % This command takes as argument a URL pointing to an image.
537 % The image will be embedded in the HTML document but will
538 % be ignored in the dvi and ps files.  The optional argument
539 % denotes additional HTML tags.
540 %
541 % Example:  \htmladdimg[ALT="portrait" ALIGN=CENTER]{portrait.gif}
542 %
543 \ifx\pdfunknown\relax
544  \renewcommand{\htmladdimg}[2][]{}
545 \else
546  \renewcommand{\htmladdimg}[2][]{\hyperimage{#2}}
547 \fi
548
549 %%% HTMLRULE for LaTeX2e
550 % This command adds a horizontal rule and is valid even within
551 % a figure caption.
552 %
553 % This command is best used with LaTeX2e and HTML 3.2 support.
554 % It is like \hrule, but allows for options via key--value pairs
555 % as follows:  \htmlrule[key1=value1, key2=value2, ...] .
556 % Use \htmlrule* to suppress the <BR> tag.
557 % Eg. \htmlrule[left, 15, 5pt, "none", NOSHADE] produces
558 % <BR CLEAR="left"><HR NOSHADE SIZE="15">.
559 % Renew the necessary part.
560 \renewcommand{\htmlrulestar}[1][all]{}
561
562 %%% HTMLCLEAR for LaTeX2e
563 % This command puts in a <BR> tag, with optional CLEAR="<attrib>"
564 %
565 \renewcommand{\htmlclear}[1][all]{}
566
567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
568 %
569 %  renew some definitions to allow optional arguments
570 %
571 % The description of the options is missing, as yet.
572 %
573 \renewcommand{\latextohtml}{\textup{\LaTeX2\texttt{HTML}}}
574 \ifx\pdfunknown\relax
575  \renewcommand{\htmladdnormallinkfoot}[3][]{#2\footnote{#3}} 
576  \renewcommand{\htmladdnormallink}[3][]{#2}
577 \else
578  \renewcommand{\htmladdnormallinkfoot}[1][]{\def\next{#1}%
579    \ifx\next\@empty\def\next{\htmladdnonamedlinkfoot}%
580    \else\def\next{\htmladdnamedlinkfoot{#1}}\fi \next}
581  \newcommand{\htmladdnonamedlinkfoot}[2]{%
582    #1\footnote{\href{#2}{#2}}}
583  \newcommand{\htmladdnamedlinkfoot}[3]{%
584    \hypertarget{#1}{#2}\footnote{\href{#3}{#3}}}
585  \renewcommand{\htmladdnormallink}[1][]{\def\next{#1}%
586   \ifx\next\@empty\def\next{\htmladdnonamedlink}%
587   \else\def\next{\htmladdnamedlink{#1}}\fi \next}
588  \newcommand{\htmladdnonamedlink}[2]{\href{#2}{#1}}
589  \newcommand{\htmladdnamedlink}[3]{%
590    \hypertarget{#1}{\hskip2bp}\href{#3}{#2}}
591 \fi
592
593 \renewcommand{\htmlbody}[1][]{}
594 \renewcommand{\htmlborder}[2][]{}
595 \renewcommand{\externallabels}[3][]{}
596 \renewcommand{\externalref}[2][]{}
597 \renewcommand{\externalcite}[1][]{\nocite}
598 \renewcommand{\hyperref}[1][]{\hyperrefi[#1]}
599 \renewcommand{\hypercite}[1][]{\hypercitei[#1]}
600 \renewcommand{\hypercitenocite}[2]{#2\hypercitenocitex}
601 \renewcommand{\hypercitenocitex}[2][]{\nocite{#2}}
602 \let\hyperciteno=\hypercitenocite
603 \let\hyperciteext=\hypercitenocite
604
605 \ifx\pdfunknown\relax
606  \renewcommand{\htmlimage}[2][]{}
607  \renewcommand{\htmlref}[2][]{#2{\def\tmp{#1}\ifx\tmp\@empty
608   \aftergroup\htmlrefdef\else\aftergroup\htmlrefext\fi}}
609  \newcommand{\htmlrefdef}[1]{}
610  \newcommand{\htmlrefext}[2][]{}
611  \renewcommand{\htmlcite}[2][]{#2{\def\tmp{#1}\ifx\tmp\@empty
612   \aftergroup\htmlcitedef\else\aftergroup\htmlciteext\fi}}
613  \newcommand{\htmlciteext}[2][]{}
614 \else
615  \renewcommand{\htmlimage}[2][]{\hyperimage{#2}}
616  \renewcommand{\htmlref}[1][]{\def\htmp@{#1}\ifx\htmp@\@empty
617   \def\htmp@{\htmlrefdef}\else\def\htmp@{\htmlrefext{#1}}\fi\htmp@}
618  \newcommand{\htmlrefdef}[2]{\hyperref[hyper][#2]{#1}}
619  \newcommand{\htmlrefext}[3]{%
620   \hypertarget{#1}{\hskip2bp}\hyperref[hyper][#3]{#2}}
621  \renewcommand{\htmlcite}[2][]{#2{\def\htmp@{#1}\ifx\htmp@\@empty
622   \aftergroup\htmlcitedef\else\aftergroup\htmlciteext\fi}}
623  \newcommand{\htmlciteext}[1][]{\cite}
624 \fi
625 \newcommand{\htmlcitedef}[1]{ \nocite{#1}}
626
627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
628 %
629 %  HTML  HTMLset  HTMLsetenv
630 %
631 %  These commands do nothing in LaTeX, but can be used to place
632 %  HTML tags or set Perl variables during the LaTeX2HTML processing;
633 %  They are intended for expert use only.
634
635 \newcommand{\HTMLcode}[2][]{}
636 \ifx\undefined\HTML\newcommand{\HTML}[2][]{}\else
637 \typeout{*** Warning: \string\HTML\space had an incompatible definition ***}%
638 \typeout{*** instead use \string\HTMLcode\space for raw HTML code ***}%
639 \fi 
640 \newcommand{\HTMLset}[3][]{}
641 \newcommand{\HTMLsetenv}[3][]{}
642
643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
644 %
645 % The following commands pertain to document segmentation, and
646 % were added by Herbert Swan <dprhws@edp.Arco.com> (with help from
647 % Michel Goossens <goossens@cern.ch>):
648 %
649 %
650 % This command inputs internal latex2html tables so that large
651 % documents can to partitioned into smaller (more manageable)
652 % segments.
653 %
654 \newcommand{\internal}[2][internals]{}
655
656 %
657 %  Define a dummy stub \htmlhead{}.  This command causes latex2html
658 %  to define the title of the start of a new segment.  It is not
659 %  normally placed in the user's document.  Rather, it is passed to
660 %  latex2html via a .ptr file written by \segment.
661 %
662 \newcommand{\htmlhead}[3][]{}
663
664 %  In the LaTeX2HTML version this will eliminate the title line
665 %  generated by a \segment command, but retains the title string
666 %  for use in other places.
667 %
668 \newcommand{\htmlnohead}{}
669
670
671 %  In the LaTeX2HTML version this put a URL into a <BASE> tag
672 %  within the <HEAD>...</HEAD> portion of a document.
673 %
674 \ifx\pdfunknown\relax
675  \newcommand{\htmlbase}[1]{}
676 \else
677  \let\htmlbase=\hyperbaseurl
678 \fi
679
680
681 %  Include style information into the stylesheet; e.g. CSS
682 %
683 \newcommand{\htmlsetstyle}[3][]{}
684 \newcommand{\htmladdtostyle}[3][]{}
685
686 %  Define a style-class for information in a particular language
687 %
688 \newcommand{\htmllanguagestyle}[2][]{}
689
690
691 %
692 %  The dummy command \endpreamble is needed by latex2html to
693 %  mark the end of the preamble in document segments that do
694 %  not contain a \begin{document}
695 %
696 \newcommand{\startdocument}{}
697
698
699 % \tableofchildlinks, \htmlinfo
700 %     by Ross Moore  ---  extensions dated 27 September 1997
701 %
702 %  These do nothing in LaTeX but for LaTeX2HTML they mark 
703 %  where the table of child-links and info-page should be placed,
704 %  when the user wants other than the default.
705 %       \tableofchildlinks       % put mini-TOC at this location
706 %       \tableofchildlinks[off]  % not on current page
707 %       \tableofchildlinks[none] % not on current and subsequent pages
708 %       \tableofchildlinks[on]   % selectively on current page
709 %       \tableofchildlinks[all]  % on current and all subsequent pages
710 %       \htmlinfo                % put info-page at this location
711 %       \htmlinfo[off]           % no info-page in current document
712 %       \htmlinfo[none]          % no info-page in current document
713 %  *-versions omit the preceding <BR> tag.
714 %
715 \newcommand{\tableofchildlinks}{%
716   \@ifstar\tableofchildlinksstar\tableofchildlinksstar}
717 \newcommand{\tableofchildlinksstar}[1][]{}
718
719 \newcommand{\htmlinfo}{\@ifstar\htmlinfostar\htmlinfostar}
720 \newcommand{\htmlinfostar}[1][]{}
721
722
723 %  This redefines  \begin  to allow for an optional argument
724 %  which is used by LaTeX2HTML to specify `style-sheet' information
725
726 \let\realLaTeX@begin=\begin
727 \renewcommand{\begin}[1][]{\realLaTeX@begin}
728
729
730 %
731 %  Allocate a new set of section counters, which will get incremented
732 %  for "*" forms of sectioning commands, and for a few miscellaneous
733 %  commands.
734 %
735
736 \@ifundefined{c@part}{\newcounter{part}}{}%
737 \newcounter{lpart}
738 \newcounter{lchapter}[part]
739 \@ifundefined{c@chapter}%
740  {\let\Hchapter\relax \newcounter{chapter}\let\thechapter\relax
741   \newcounter{lsection}[part]}%
742  {\let\Hchapter=\chapter \newcounter{lsection}[chapter]}
743 \newcounter{lsubsection}[section]
744 \newcounter{lsubsubsection}[subsection]
745 \newcounter{lparagraph}[subsubsection]
746 \newcounter{lsubparagraph}[paragraph]
747 %\newcounter{lequation}
748
749 %
750 %  Redefine "*" forms of sectioning commands to increment their
751 %  respective counters.
752 %
753 \let\Hpart=\part
754 %\let\Hchapter=\chapter
755 \let\Hsection=\section
756 \let\Hsubsection=\subsection
757 \let\Hsubsubsection=\subsubsection
758 \let\Hparagraph=\paragraph
759 \let\Hsubparagraph=\subparagraph
760 \let\Hsubsubparagraph=\subsubparagraph
761
762 \ifx\c@subparagraph\undefined
763  \newcounter{lsubsubparagraph}[lsubparagraph]
764 \else
765  \newcounter{lsubsubparagraph}[subparagraph]
766 \fi
767
768 %
769 %  The following definitions are specific to LaTeX2e:
770 %  (They must be commented out for LaTeX 2.09)
771 %
772 \expandafter\ifx\csname part\endcsname\relax\else
773 \renewcommand{\part}{\@ifstar{\stepcounter{lpart}%
774   \bgroup\def\tmp{*}\H@part}{\bgroup\def\tmp{}\H@part}}\fi
775 \newcommand{\H@part}[1][]{\def\tmp@a{#1}\check@align
776  \expandafter\egroup\expandafter\Hpart\tmp}
777
778 \ifx\Hchapter\relax\else
779  \def\chapter{\resetsections \@ifstar{\stepcounter{lchapter}%
780    \bgroup\def\tmp{*}\H@chapter}{\bgroup\def\tmp{}\H@chapter}}\fi
781 \newcommand{\H@chapter}[1][]{\def\tmp@a{#1}\check@align
782  \expandafter\egroup\expandafter\Hchapter\tmp}
783
784 \renewcommand{\section}{\resetsubsections
785  \@ifstar{\stepcounter{lsection}\bgroup\def\tmp{*}%
786    \H@section}{\bgroup\def\tmp{}\H@section}}
787 \newcommand{\H@section}[1][]{\def\tmp@a{#1}\check@align
788  \expandafter\egroup\expandafter\Hsection\tmp}
789
790 \renewcommand{\subsection}{\resetsubsubsections
791  \@ifstar{\stepcounter{lsubsection}\bgroup\def\tmp{*}%
792    \H@subsection}{\bgroup\def\tmp{}\H@subsection}}
793 \newcommand{\H@subsection}[1][]{\def\tmp@a{#1}\check@align
794  \expandafter\egroup\expandafter\Hsubsection\tmp}
795
796 \renewcommand{\subsubsection}{\resetparagraphs
797  \@ifstar{\stepcounter{lsubsubsection}\bgroup\def\tmp{*}%
798    \H@subsubsection}{\bgroup\def\tmp{}\H@subsubsection}}
799 \newcommand{\H@subsubsection}[1][]{\def\tmp@a{#1}\check@align
800  \expandafter\egroup\expandafter\Hsubsubsection\tmp}
801
802 \renewcommand{\paragraph}{\resetsubparagraphs
803  \@ifstar{\stepcounter{lparagraph}\bgroup\def\tmp{*}%
804    \H@paragraph}{\bgroup\def\tmp{}\H@paragraph}}
805 \newcommand\H@paragraph[1][]{\def\tmp@a{#1}\check@align
806  \expandafter\egroup\expandafter\Hparagraph\tmp}
807
808 \ifx\Hsubparagraph\relax\else\@ifundefined{subparagraph}{}{%
809 \renewcommand{\subparagraph}{\resetsubsubparagraphs
810  \@ifstar{\stepcounter{lsubparagraph}\bgroup\def\tmp{*}%
811    \H@subparagraph}{\bgroup\def\tmp{}\H@subparagraph}}}\fi
812 \newcommand\H@subparagraph[1][]{\def\tmp@a{#1}\check@align
813  \expandafter\egroup\expandafter\Hsubparagraph\tmp}
814
815 \ifx\Hsubsubparagraph\relax\else\@ifundefined{subsubparagraph}{}{%
816 \def\subsubparagraph{%
817  \@ifstar{\stepcounter{lsubsubparagraph}\bgroup\def\tmp{*}%
818    \H@subsubparagraph}{\bgroup\def\tmp{}\H@subsubparagraph}}}\fi
819 \newcommand\H@subsubparagraph[1][]{\def\tmp@a{#1}\check@align
820  \expandafter\egroup\expandafter\Hsubsubparagraph\tmp}
821
822 \def\check@align{\def\empty{}\ifx\tmp@a\empty
823  \else\def\tmp@b{center}\ifx\tmp@a\tmp@b\let\tmp@a\empty
824  \else\def\tmp@b{left}\ifx\tmp@a\tmp@b\let\tmp@a\empty
825  \else\def\tmp@b{right}\ifx\tmp@a\tmp@b\let\tmp@a\empty
826  \else\expandafter\def\expandafter\tmp@a\expandafter{\expandafter[\tmp@a]}%
827  \fi\fi\fi \def\empty{}\ifx\tmp\empty\let\tmp=\tmp@a \else 
828   \expandafter\def\expandafter\tmp\expandafter{\expandafter*\tmp@a}%
829  \fi\fi}
830 %
831 \def\resetsections{\setcounter{section}{0}\setcounter{lsection}{0}%
832  \reset@dependents{section}\resetsubsections }
833 \def\resetsubsections{\setcounter{subsection}{0}\setcounter{lsubsection}{0}%
834  \reset@dependents{subsection}\resetsubsubsections }
835 \def\resetsubsubsections{\setcounter{subsubsection}{0}\setcounter{lsubsubsection}{0}%
836  \reset@dependents{subsubsection}\resetparagraphs }
837 %
838 \def\resetparagraphs{\setcounter{lparagraph}{0}\setcounter{lparagraph}{0}%
839  \reset@dependents{paragraph}\resetsubparagraphs }
840 \def\resetsubparagraphs{\ifx\c@subparagraph\undefined\else
841   \setcounter{subparagraph}{0}\fi \setcounter{lsubparagraph}{0}%
842  \reset@dependents{subparagraph}\resetsubsubparagraphs }
843 \def\resetsubsubparagraphs{\ifx\c@subsubparagraph\undefined\else
844   \setcounter{subsubparagraph}{0}\fi \setcounter{lsubsubparagraph}{0}}
845 %
846 \def\reset@dependents#1{\begingroup\let \@elt \@stpelt
847  \csname cl@#1\endcsname\endgroup}
848
849 % ignore optional *-version of \tableofcontents
850 \let\ltx@tableofcontents\tableofcontents
851 \renewcommand{\tableofcontents}{%
852  \@ifstar\ltx@tableofcontents\ltx@tableofcontents}
853 %
854 %
855 %  Define a helper macro to dump a single \secounter command to a file.
856 %
857 \newcommand{\DumpPtr}[2]{%
858 \count255=\csname c@#1\endcsname\relax\def\dummy{dummy}\def\tmp{#2}%
859 \ifx\tmp\dummy\def\ctr{#1}\else
860  \def\ctr{#2}\advance\count255 by \csname c@#2\endcsname\relax\fi
861 \immediate\write\ptrfile{%
862 \noexpand\setcounter{\ctr}{\number\count255}}}
863 %\expandafter\noexpand\expandafter\setcounter\expandafter{\ctr}{\number\count255}}}
864
865 %
866 %  Define a helper macro to dump all counters to the file.
867 %  The value for each counter will be the sum of the l-counter
868 %      actual LaTeX section counter.
869 %  Also dump an \htmlhead{section-command}{section title} command
870 %      to the file.
871 %
872 \newwrite\ptrfile
873 \def\DumpCounters#1#2#3#4{%
874 \begingroup\let\protect=\noexpand
875 \immediate\openout\ptrfile = #1.ptr
876 \DumpPtr{part}{lpart}%
877 \ifx\Hchapter\relax\else\DumpPtr{chapter}{lchapter}\fi
878 \DumpPtr{section}{lsection}%
879 \DumpPtr{subsection}{lsubsection}%
880 \DumpPtr{subsubsection}{lsubsubsection}%
881 \DumpPtr{paragraph}{lparagraph}%
882 \DumpPtr{subparagraph}{lsubparagraph}%
883 \DumpPtr{equation}{dummy}%
884 \DumpPtr{footnote}{dummy}%
885 \def\tmp{#4}\ifx\tmp\@empty
886 \immediate\write\ptrfile{\noexpand\htmlhead{#2}{#3}}\else
887 \immediate\write\ptrfile{\noexpand\htmlhead[#4]{#2}{#3}}\fi
888 \dumpcitestatus \dumpcurrentcolor
889 \immediate\closeout\ptrfile
890 \endgroup }
891
892
893 %% interface to natbib.sty
894
895 \def\dumpcitestatus{}
896 \def\loadcitestatus{\def\dumpcitestatus{%
897   \ifciteindex\immediate\write\ptrfile{\noexpand\citeindextrue}%
898   \else\immediate\write\ptrfile{\noexpand\citeindexfalse}\fi }%
899 }
900 \@ifpackageloaded{natbib}{\loadcitestatus}{%
901  \AtBeginDocument{\@ifpackageloaded{natbib}{\loadcitestatus}{}}}
902
903
904 %% interface to color.sty
905
906 \def\dumpcurrentcolor{}
907 \def\loadsegmentcolors{%
908  \let\real@pagecolor=\pagecolor
909  \let\pagecolor\segmentpagecolor
910  \let\segmentcolor\color
911  \ifx\current@page@color\undefined \def\current@page@color{{}}\fi
912  \def\dumpcurrentcolor{\bgroup\def\@empty@{{}}%
913    \expandafter\def\expandafter\tmp\space####1@{\def\thiscol{####1}}%
914   \ifx\current@color\@empty@\def\thiscol{}\else
915    \expandafter\tmp\current@color @\fi
916   \immediate\write\ptrfile{\noexpand\segmentcolor{\thiscol}}%
917   \ifx\current@page@color\@empty@\def\thiscol{}\else
918    \expandafter\tmp\current@page@color @\fi
919   \immediate\write\ptrfile{\noexpand\segmentpagecolor{\thiscol}}%
920  \egroup}%
921  \global\let\loadsegmentcolors=\relax
922 }
923
924 % These macros are needed within  images.tex  since this inputs
925 % the <segment>.ptr files for a segment, so that counters are
926 % colors are synchronised.
927 %
928 \newcommand{\segmentpagecolor}[1][]{%
929  \@ifpackageloaded{color}{\loadsegmentcolors\bgroup
930   \def\tmp{#1}\ifx\@empty\tmp\def\next{[]}\else\def\next{[#1]}\fi
931   \expandafter\segmentpagecolor@\next}%
932  {\@gobble}}
933 \def\segmentpagecolor@[#1]#2{\def\tmp{#1}\def\tmpB{#2}%
934  \ifx\tmpB\@empty\let\next=\egroup
935  \else
936   \let\realendgroup=\endgroup
937   \def\endgroup{\edef\next{\noexpand\realendgroup
938    \def\noexpand\current@page@color{\current@color}}\next}%
939   \ifx\tmp\@empty\real@pagecolor{#2}\def\model{}%
940   \else\real@pagecolor[#1]{#2}\def\model{[#1]}%
941   \fi
942   \edef\next{\egroup\def\noexpand\current@page@color{\current@page@color}%
943   \noexpand\real@pagecolor\model{#2}}%
944  \fi\next}
945 %
946 \newcommand{\segmentcolor}[2][named]{\@ifpackageloaded{color}%
947  {\loadsegmentcolors\segmentcolor[#1]{#2}}{}}
948
949 \@ifpackageloaded{color}{\loadsegmentcolors}{\let\real@pagecolor=\@gobble
950  \AtBeginDocument{\@ifpackageloaded{color}{\loadsegmentcolors}{}}}
951
952
953 %  Define the \segment[align]{file}{section-command}{section-title} command,
954 %  and its helper macros.  This command does four things:
955 %       1)  Begins a new LaTeX section;
956 %       2)  Writes a list of section counters to file.ptr, each
957 %           of which represents the sum of the LaTeX section
958 %           counters, and the l-counters, defined above;
959 %       3)  Write an \htmlhead{section-title} command to file.ptr;
960 %       4)  Inputs file.tex.
961
962 \newcommand{\segment}{\@ifstar{\@@htmls}{\@@html}}
963 %\tracingall
964 \newcommand{\@endsegment}[1][]{}
965 \let\endsegment\@endsegment
966 \newcommand{\@@htmls}[1][]{\@@htmlsx{#1}}
967 \newcommand{\@@html}[1][]{\@@htmlx{#1}}
968 \def\@@htmlsx#1#2#3#4{\csname #3\endcsname* {#4}%
969                    \DumpCounters{#2}{#3*}{#4}{#1}\input{#2}}
970 \def\@@htmlx#1#2#3#4{\csname #3\endcsname {#4}%
971                    \DumpCounters{#2}{#3}{#4}{#1}\input{#2}}
972
973 \makeatother
974 \endinput
975
976
977 % Modifications:
978 %
979 % (The listing of Initiales see Changes)
980
981 % $Log: html.sty,v $
982 % Revision 1.39  2001/10/01 22:47:06  RRM
983 %  --  somehow revision 1.39 was not committed earlier
984 %  --  it allows a * version of \tableofcontents (used with frames) to be
985 %      treated as un-starred by LaTeX
986 %
987 % Revision 1.39  2000/09/10 12:23:20  RRM
988 %  --  added *-argument for \tableofcontents  in frames.perl
989 %      LaTeX should just ignore it
990 %
991 % Revision 1.38  1999/07/19 13:23:20  RRM
992 %  --  compatibility with pdflatex and hyperref.sty
993 %       citations are not complete yet, I think
994 %  --  ensure that \thechapter remains undefined; some packages use it
995 %       as a test for the type of documentclass being used.
996 %
997 % Revision 1.37  1999/03/12 07:02:38  RRM
998 %  --  change macro name from \addTOCsection to \htmladdTOClink
999 %  --  it has 3 + 1 optional argument, to allow a local path to a labels.pl
1000 %       file for the external document, for cross-references
1001 %
1002 % Revision 1.36  1999/03/10 05:46:00  RRM
1003 %  --  extended the code for compatibilty with comment.sty
1004 %  --  allow excluded environments to work within tables,
1005 %       with the excluded material spanning headers and several cells
1006 %       thanks Avinash Chopde for recognising the need for this.
1007 %  --  added LaTeX support (ignores it) for  \htmladdTOCsection
1008 %       thanks to Steffen Klupsch and Uli Wortmann for this idea.
1009 %
1010 % Revision 1.35  1999/03/08 11:16:16  RRM
1011 %       html.sty  for LaTeX2HTML V99.1
1012 %
1013 %  --  ensure that html.sty can be loaded *after* hyperref.sty
1014 %  --  support new command  \htmlclear for <BR> in HTML, ignored by LaTeX
1015 %  --  ensure {part} and {chapter} counters are defined, even if not used
1016 %
1017 % Revision 1.34  1998/09/19 10:37:29  RRM
1018 %  --  fixed typo with \next{\hyperref}{....}
1019 %
1020 % Revision 1.33  1998/09/08 12:47:51  RRM
1021 %  --  changed macro-names for the \hyperref and \hypercite options
1022 %       allows easier compatibility with other packages
1023 %
1024 % Revision 1.32  1998/08/24 12:15:14  RRM
1025 %  --  new command  \htmllanguagestyle  to associate a style class
1026 %       with text declared as a particular language
1027 %
1028 % Revision 1.31  1998/07/07 14:15:41  RRM
1029 %  --  new commands  \htmlsetstyle  and  \htmladdtostyle
1030 %
1031 % Revision 1.30  1998/07/04 02:42:22  RRM
1032 %  --  cope with catcodes of % { } in rawhtml/comment/htmlonly environments
1033 %
1034 % Revision 1.29  1998/06/23 13:33:23  RRM
1035 %  --  use \begin{small} with the default for URLs
1036 %
1037 % Revision 1.28  1998/06/21 09:38:39  RRM
1038 %  --  implement \htmlurl  to agree with \url if already defined
1039 %     or loaded subsequently (LaTeX-2e only)
1040 %  --  get LaTeX to print the revision number when loading
1041 %
1042 % Revision 1.27  1998/06/20 15:13:10  RRM
1043 %  --  \TeX is already protected in recent versions of LaTeX
1044 %       so \DeclareRobust doesn't work --- causes looping
1045 %  --  \part and \subparagraph need not be defined in some styles
1046 %
1047 % Revision 1.26  1998/06/01 08:36:49  latex2html
1048 %  --  implement optional argument for \endsegment
1049 %  --  made the counter value output from \DumpPtr more robust
1050 %
1051 % Revision 1.25  1998/05/09 05:43:35  latex2html
1052 %  --   conditionals for avoiding undefined counters
1053 %
1054 % Revision 1.23  1998/02/26 10:32:24  latex2html
1055 %  --  use \providecommand for  \latextohtml
1056 %  --  implemented \HTMLcode to do what \HTML did previously
1057 %       \HTML still works, unless already defined by another package
1058 %  --  fixed problems remaining with undefined \chapter
1059 %  --  defined \endsegment
1060 %
1061 % Revision 1.22  1997/12/05 11:38:18  RRM
1062 %  --  implemented an optional argument to \begin for style-sheet info.
1063 %  --  modified use of an optional argument with sectioning-commands
1064 %
1065 % Revision 1.21  1997/11/05 10:28:56  RRM
1066 %  --  replaced redefinition of \@htmlrule with \htmlrulestar
1067 %
1068 % Revision 1.20  1997/10/28 02:15:58  RRM
1069 %  --  altered the way some special html-macros are defined, so that
1070 %       star-variants are explicitly defined for LaTeX
1071 %        -- it is possible for these to occur within  images.tex
1072 %       e.g. \htmlinfostar \htmlrulestar \tableofchildlinksstar
1073 %
1074 % Revision 1.19  1997/10/11 05:47:48  RRM
1075 %  --  allow the dummy {tex2html_nowrap} environment in LaTeX
1076 %       use it to make its contents be evaluated in environment order
1077 %
1078 % Revision 1.18  1997/10/04 06:56:50  RRM
1079 %  --  uses Robin Fairbairns' code for ignored environments,
1080 %      replacing the previous  comment.sty  stuff.
1081 %  --  extensions to the \tableofchildlinks command
1082 %  --  extensions to the \htmlinfo command
1083 %
1084 % Revision 1.17  1997/07/08 11:23:39  RRM
1085 %     include value of footnote counter in .ptr files for segments
1086 %
1087 % Revision 1.16  1997/07/03 08:56:34  RRM
1088 %     use \textup  within the \latextohtml macro
1089 %
1090 % Revision 1.15  1997/06/15 10:24:58  RRM
1091 %      new command  \htmltracenv  as environment-ordered \htmltracing
1092 %
1093 % Revision 1.14  1997/06/06 10:30:37  RRM
1094 %  -   new command:  \htmlborder  puts environment into a <TABLE> cell
1095 %      with a border of specified width, + other attributes.
1096 %  -   new commands: \HTML  for setting arbitrary HTML tags, with attributes
1097 %                    \HTMLset  for setting Perl variables, while processing
1098 %                    \HTMLsetenv  same as \HTMLset , but it gets processed
1099 %                                 as if it were an environment.
1100 %  -   new command:  \latextohtml  --- to set the LaTeX2HTML name/logo
1101 %  -   fixed some remaining problems with \segmentcolor & \segmentpagecolor
1102 %
1103 % Revision 1.13  1997/05/19 13:55:46  RRM
1104 %      alterations and extra options to  \hypercite
1105 %
1106 % Revision 1.12  1997/05/09 12:28:39  RRM
1107 %  -  Added the optional argument to \htmlhead, also in \DumpCounters
1108 %  -  Implemented \HTMLset as a no-op in LaTeX.
1109 %  -  Fixed a bug in accessing the page@color settings.
1110 %
1111 % Revision 1.11  1997/03/26 09:32:40  RRM
1112 %  -  Implements LaTeX versions of  \externalcite  and  \hypercite  commands.
1113 %     Thanks to  Uffe Engberg  and  Stephen Simpson  for the suggestions.
1114 %
1115 % Revision 1.10  1997/03/06 07:37:58  RRM
1116 % Added the  \htmltracing  command, for altering  $VERBOSITY .
1117 %
1118 % Revision 1.9  1997/02/17 02:26:26  RRM
1119 % - changes to counter handling (RRM)
1120 % - shuffled around some definitions
1121 % - changed \htmlrule of 209 mode
1122 %
1123 % Revision 1.8  1997/01/26 09:04:12  RRM
1124 % RRM: added optional argument to sectioning commands
1125 %      \htmlbase  sets the <BASE HREF=...> tag
1126 %      \htmlinfo  and  \htmlinfo* allow the document info to be positioned
1127 %
1128 % Revision 1.7  1997/01/03 12:15:44  L2HADMIN
1129 % % - fixes to the  color  and  natbib  interfaces
1130 % % - extended usage of  \hyperref, via an optional argument.
1131 % % - extended use comment environments to allow shifting expansions
1132 % %     e.g. within \multicolumn  (`bug' reported by Luc De Coninck).
1133 % % - allow optional argument to: \htmlimage, \htmlhead,
1134 % %     \htmladdimg, \htmladdnormallink, \htmladdnormallinkfoot
1135 % % - added new commands: \htmlbody, \htmlnohead
1136 % % - added new command: \tableofchildlinks
1137 %
1138 % Revision 1.6  1996/12/25 03:04:54  JCL
1139 % added patches to segment feature from Martin Wilck
1140 %
1141 % Revision 1.5  1996/12/23 01:48:06  JCL
1142 %  o introduced the environment makeimage, which may be used to force
1143 %    LaTeX2HTML to generate an image from the contents.
1144 %    There's no magic, all what we have now is a defined empty environment
1145 %    which LaTeX2HTML will not recognize and thus pass it to images.tex.
1146 %  o provided \protect to the \htmlrule commands to allow for usage
1147 %    within captions.
1148 %
1149 % Revision 1.4  1996/12/21 19:59:22  JCL
1150 % - shuffled some entries
1151 % - added \latexhtml command
1152 %
1153 % Revision 1.3  1996/12/21 12:22:59  JCL
1154 % removed duplicate \htmlrule, changed \htmlrule back not to create a \hrule
1155 % to allow occurrence in caption
1156 %
1157 % Revision 1.2  1996/12/20 04:03:41  JCL
1158 % changed occurrence of \makeatletter, \makeatother
1159 % added new \htmlrule command both for the LaTeX2.09 and LaTeX2e
1160 % sections
1161 %
1162 %
1163 % jcl 30-SEP-96
1164 %  - Stuck the commands commonly used by both LaTeX versions to the top,
1165 %    added a check which stops input or reads further if the document
1166 %    makes use of LaTeX2e.
1167 %  - Introduced rrm's \dumpcurrentcolor and \bodytext
1168 % hws 31-JAN-96 - Added support for document segmentation
1169 % hws 10-OCT-95 - Added \htmlrule command
1170 % jz 22-APR-94 - Added support for htmlref
1171 % nd  - Created