ia64/xen-unstable

view docs/html.sty @ 3762:0a4b76b6b5a0

bitkeeper revision 1.1161 (420b5ed6DpcotfvpA5TTxShadFd_MQ)

Merge with non-ancient version of Xen.
author sos22@douglas.cl.cam.ac.uk
date Thu Feb 10 13:17:10 2005 +0000 (2005-02-10)
parents f6afd85efce0
children
line source
1 %
2 % $Id: html.sty,v 1.23 1998/02/26 10:32:24 latex2html Exp $
3 % LaTeX2HTML Version 96.2 : 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.
19 % Changes:
20 % See the change log at end of file.
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
28 \providecommand{\latextohtml}{\LaTeX2\texttt{HTML}}
31 %%% LINKS TO EXTERNAL DOCUMENTS
32 %
33 % This can be used to provide links to arbitrary documents.
34 % The first argumment should be the text that is going to be
35 % highlighted and the second argument a URL.
36 % The hyperlink will appear as a hyperlink in the HTML
37 % document and as a footnote in the dvi or ps files.
38 %
39 \newcommand{\htmladdnormallinkfoot}[2]{#1\footnote{#2}}
42 % This is an alternative definition of the command above which
43 % will ignore the URL in the dvi or ps files.
44 \newcommand{\htmladdnormallink}[2]{#1}
47 % This command takes as argument a URL pointing to an image.
48 % The image will be embedded in the HTML document but will
49 % be ignored in the dvi and ps files.
50 %
51 \newcommand{\htmladdimg}[1]{}
54 %%% CROSS-REFERENCES BETWEEN (LOCAL OR REMOTE) DOCUMENTS
55 %
56 % This can be used to refer to symbolic labels in other Latex
57 % documents that have already been processed by the translator.
58 % The arguments should be:
59 % #1 : the URL to the directory containing the external document
60 % #2 : the path to the labels.pl file of the external document.
61 % If the external document lives on a remote machine then labels.pl
62 % must be copied on the local machine.
63 %
64 %e.g. \externallabels{http://cbl.leeds.ac.uk/nikos/WWW/doc/tex2html/latex2html}
65 % {/usr/cblelca/nikos/tmp/labels.pl}
66 % The arguments are ignored in the dvi and ps files.
67 %
68 \newcommand{\externallabels}[2]{}
71 % This complements the \externallabels command above. The argument
72 % should be a label defined in another latex document and will be
73 % ignored in the dvi and ps files.
74 %
75 \newcommand{\externalref}[1]{}
78 % Suggested by Uffe Engberg (http://www.brics.dk/~engberg/)
79 % This allows the same effect for citations in external bibliographies.
80 % An \externallabels command must be given, locating a labels.pl file
81 % which defines the location and keys used in the external .html file.
82 %
83 \newcommand{\externalcite}{\nocite}
86 %%% HTMLRULE
87 % This command adds a horizontal rule and is valid even within
88 % a figure caption.
89 % Here we introduce a stub for compatibility.
90 \newcommand{\htmlrule}{\protect\HTMLrule}
91 \newcommand{\HTMLrule}{\@ifstar\htmlrulestar\htmlrulestar}
92 \newcommand{\htmlrulestar}[1]{}
94 % This command adds information within the <BODY> ... </BODY> tag
95 %
96 \newcommand{\bodytext}[1]{}
97 \newcommand{\htmlbody}{}
100 %%% HYPERREF
101 % Suggested by Eric M. Carol <eric@ca.utoronto.utcc.enfm>
102 % Similar to \ref but accepts conditional text.
103 % The first argument is HTML text which will become ``hyperized''
104 % (underlined).
105 % The second and third arguments are text which will appear only in the paper
106 % version (DVI file), enclosing the fourth argument which is a reference to a label.
107 %
108 %e.g. \hyperref{using the tracer}{using the tracer (see Section}{)}{trace}
109 % where there is a corresponding \label{trace}
110 %
111 \newcommand{\hyperref}{\hyperrefx[ref]}
112 \def\hyperrefx[#1]{{\def\next{#1}%
113 \def\tmp{ref}\ifx\next\tmp\aftergroup\hyperrefref
114 \else\def\tmp{pageref}\ifx\next\tmp\aftergroup\hyperpageref
115 \else\def\tmp{page}\ifx\next\tmp\aftergroup\hyperpageref
116 \else\def\tmp{noref}\ifx\next\tmp\aftergroup\hypernoref
117 \else\def\tmp{no}\ifx\next\tmp\aftergroup\hypernoref
118 \else\typeout{*** unknown option \next\space to hyperref ***}%
119 \fi\fi\fi\fi\fi}}
120 \newcommand{\hyperrefref}[4]{#2\ref{#4}#3}
121 \newcommand{\hyperpageref}[4]{#2\pageref{#4}#3}
122 \newcommand{\hypernoref}[3]{#2}
125 %%% HYPERCITE --- added by RRM
126 % Suggested by Stephen Simpson <simpson@math.psu.edu>
127 % effects the same ideas as in \hyperref, but for citations.
128 % It does not allow an optional argument to the \cite, in LaTeX.
129 %
130 % \hypercite{<html-text>}{<LaTeX-text>}{<opt-text>}{<key>}
131 %
132 % uses the pre/post-texts in LaTeX, with a \cite{<key>}
133 %
134 % \hypercite[ext]{<html-text>}{<LaTeX-text>}{<key>}
135 %
136 % uses the pre/post-texts in LaTeX, with a \nocite{<key>}
137 % the actual reference comes from an \externallabels file.
138 %
139 \newcommand{\hypercite}{\hypercitex[int]}
140 \def\hypercitex[#1]{{\def\next{#1}%
141 \def\tmp{int}\ifx\next\tmp\aftergroup\hyperciteint
142 \else\def\tmp{cite}\ifx\next\tmp\aftergroup\hyperciteint
143 \else\def\tmp{ext}\ifx\next\tmp\aftergroup\hyperciteext
144 \else\def\tmp{nocite}\ifx\next\tmp\aftergroup\hyperciteext
145 \else\def\tmp{no}\ifx\next\tmp\aftergroup\hyperciteext
146 \else\typeout{*** unknown option \next\space to hypercite ***}%
147 \fi\fi\fi\fi\fi}}
148 \newcommand{\hyperciteint}[4]{#2{\def\tmp{#3}\def\emptyopt{}%
149 \ifx\tmp\emptyopt\cite{#4}\else\cite[#3]{#4}\fi}}
150 \newcommand{\hyperciteext}[3]{#2\nocite{#3}}
154 %%% HTMLREF
155 % Reference in HTML version only.
156 % Mix between \htmladdnormallink and \hyperref.
157 % First arg is text for in both versions, second is label for use in HTML
158 % version.
159 \newcommand{\htmlref}[2]{#1}
161 %%% HTMLCITE
162 % Reference in HTML version only.
163 % Mix between \htmladdnormallink and \hypercite.
164 % First arg is text for in both versions, second is citation for use in HTML
165 % version.
166 \newcommand{\htmlcite}[2]{#1}
169 %%% HTMLIMAGE
170 % This command can be used inside any environment that is converted
171 % into an inlined image (eg a "figure" environment) in order to change
172 % the way the image will be translated. The argument of \htmlimage
173 % is really a string of options separated by commas ie
174 % [scale=<scale factor>],[external],[thumbnail=<reduction factor>
175 % The scale option allows control over the size of the final image.
176 % The ``external'' option will cause the image not to be inlined
177 % (images are inlined by default). External images will be accessible
178 % via a hypertext link.
179 % The ``thumbnail'' option will cause a small inlined image to be
180 % placed in the caption. The size of the thumbnail depends on the
181 % reduction factor. The use of the ``thumbnail'' option implies
182 % the ``external'' option.
183 %
184 % Example:
185 % \htmlimage{scale=1.5,external,thumbnail=0.2}
186 % will cause a small thumbnail image 1/5th of the original size to be
187 % placed in the final document, pointing to an external image 1.5
188 % times bigger than the original.
189 %
190 \newcommand{\htmlimage}[1]{}
193 % \htmlborder causes a border to be placed around an image or table
194 % when the image is placed within a <TABLE> cell.
195 \newcommand{\htmlborder}[1]{}
197 % Put \begin{makeimage}, \end{makeimage} around LaTeX to ensure its
198 % translation into an image.
199 % This shields sensitive text from being translated.
200 \newenvironment{makeimage}{}{}
203 % A dummy environment that can be useful to alter the order
204 % in which commands are processed, in LaTeX2HTML
205 \newenvironment{tex2html_deferred}{}{}
208 %%% HTMLADDTONAVIGATION
209 % This command appends its argument to the buttons in the navigation
210 % panel. It is ignored by LaTeX.
211 %
212 % Example:
213 % \htmladdtonavigation{\htmladdnormallink
214 % {\htmladdimg{http://server/path/to/gif}}
215 % {http://server/path}}
216 \newcommand{\htmladdtonavigation}[1]{}
219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
220 % Comment.sty version 2.0, 19 June 1992
221 % selectively in/exclude pieces of text: the user can define new
222 % comment versions, and each is controlled separately.
223 % This style can be used with plain TeX or LaTeX, and probably
224 % most other packages too.
225 %
226 % Examples of use in LaTeX and TeX follow \endinput
227 %
228 % Author
229 % Victor Eijkhout
230 % Department of Computer Science
231 % University Tennessee at Knoxville
232 % 104 Ayres Hall
233 % Knoxville, TN 37996
234 % USA
235 %
236 % eijkhout@cs.utk.edu
237 %
238 % Usage: all text included in between
239 % \comment ... \endcomment
240 % or \begin{comment} ... \end{comment}
241 % is discarded. The closing command should appear on a line
242 % of its own. No starting spaces, nothing after it.
243 % This environment should work with arbitrary amounts
244 % of comment.
245 %
246 % Other 'comment' environments are defined by
247 % and are selected/deselected with
248 % \includecomment{versiona}
249 % \excludecoment{versionb}
250 %
251 % These environments are used as
252 % \versiona ... \endversiona
253 % or \begin{versiona} ... \end{versiona}
254 % with the closing command again on a line of its own.
255 %
256 % Basic approach:
257 % to comment something out, scoop up every line in verbatim mode
258 % as macro argument, then throw it away.
259 % For inclusions, both the opening and closing comands
260 % are defined as noop
261 %
262 % Changed \next to \html@next to prevent clashes with other sty files
263 % (mike@emn.fr)
264 % Changed \html@next to \htmlnext so the \makeatletter and
265 % \makeatother commands could be removed (they were causing other
266 % style files - changebar.sty - to crash) (nikos@cbl.leeds.ac.uk)
267 % Changed \htmlnext back to \html@next...
269 \def\makeinnocent#1{\catcode`#1=12 }
270 \def\csarg#1#2{\expandafter#1\csname#2\endcsname}
272 \def\ThrowAwayComment#1{\begingroup
273 \def\CurrentComment{#1}%
274 \let\do\makeinnocent \dospecials
275 \makeinnocent\^^L% and whatever other special cases
276 \endlinechar`\^^M \catcode`\^^M=12 \xComment}
277 {\catcode`\^^M=12 \endlinechar=-1 %
278 \gdef\xComment#1^^M{\def\test{#1}\edef\test{\meaning\test}
279 \csarg\ifx{PlainEnd\CurrentComment Test}\test
280 \let\html@next\endgroup
281 \else \csarg\ifx{LaLaEnd\CurrentComment Test}\test
282 \edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
283 \else \csarg\ifx{LaInnEnd\CurrentComment Test}\test
284 \edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
285 \else \let\html@next\xComment
286 \fi \fi \fi \html@next}
287 }
289 \def\includecomment
290 #1{\expandafter\def\csname#1\endcsname{}%
291 \expandafter\def\csname end#1\endcsname{}}
292 \def\excludecomment
293 #1{\expandafter\def\csname#1\endcsname{\ThrowAwayComment{#1}}%
294 {\escapechar=-1\relax
295 \edef\tmp{\string\\end#1}%
296 \csarg\xdef{PlainEnd#1Test}{\meaning\tmp}%
297 \edef\tmp{\string\\end\string\{#1\string\}}%
298 \csarg\xdef{LaLaEnd#1Test}{\meaning\tmp}%
299 \edef\tmp{\string\\end \string\{#1\string\}}%
300 \csarg\xdef{LaInnEnd#1Test}{\meaning\tmp}%
301 }}
303 \excludecomment{comment}
304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
305 % end Comment.sty
306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
308 %
309 % Alternative code by Robin Fairbairns, 22 September 1997
310 %
311 \newcommand\@gobbleenv{\let\reserved@a\@currenvir\@gobble@nv}
312 \long\def\@gobble@nv#1\end#2{\def\reserved@b{#2}%
313 \ifx\reserved@a\reserved@b
314 \edef\reserved@a{\noexpand\end{\reserved@a}}%
315 \expandafter\reserved@a
316 \else
317 \expandafter\@gobble@nv
318 \fi}
320 \renewcommand{\excludecomment}[1]{%
321 \csname newenvironment\endcsname{#1}{\@gobbleenv}{}}
323 %%% RAW HTML
324 %
325 % Enclose raw HTML between a \begin{rawhtml} and \end{rawhtml}.
326 % The html environment ignores its body
327 %
328 \excludecomment{rawhtml}
331 %%% HTML ONLY
332 %
333 % Enclose LaTeX constructs which will only appear in the
334 % HTML output and will be ignored by LaTeX with
335 % \begin{htmlonly} and \end{htmlonly}
336 %
337 \excludecomment{htmlonly}
338 % Shorter version
339 \newcommand{\html}[1]{}
341 % for images.tex only
342 \excludecomment{imagesonly}
344 %%% LaTeX ONLY
345 % Enclose LaTeX constructs which will only appear in the
346 % DVI output and will be ignored by latex2html with
347 %\begin{latexonly} and \end{latexonly}
348 %
349 \newenvironment{latexonly}{}{}
350 % Shorter version
351 \newcommand{\latex}[1]{#1}
354 %%% LaTeX or HTML
355 % Combination of \latex and \html.
356 % Say \latexhtml{this should be latex text}{this html text}
357 %
358 %\newcommand{\latexhtml}[2]{#1}
359 \long\def\latexhtml#1#2{#1}
362 %%% tracing the HTML conversions
363 % This alters the tracing-level within the processing
364 % performed by latex2html by adjusting $VERBOSITY
365 % (see latex2html.config for the appropriate values)
366 %
367 \newcommand{\htmltracing}[1]{}
368 \newcommand{\htmltracenv}[1]{}
371 %%% \strikeout for HTML only
372 % uses <STRIKE>...</STRIKE> tags on the argument
373 % LaTeX just gobbles it up.
374 \newcommand{\strikeout}[1]{}
377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
378 %%% JCL - stop input here if LaTeX2e is not present
379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
380 \ifx\if@compatibility\undefined
381 %LaTeX209
382 \makeatother\relax\expandafter\endinput
383 \fi
384 \if@compatibility
385 %LaTeX2e in LaTeX209 compatibility mode
386 \makeatother\relax\expandafter\endinput
387 \fi
389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
390 %
391 % Start providing LaTeX2e extension:
392 % This is currently:
393 % - additional optional argument for \htmladdimg
394 % - support for segmented documents
395 %
397 \ProvidesPackage{html}
398 [1996/12/22 v1.1 hypertext commands for latex2html (nd, hws, rrm)]
399 %%%%MG
401 % This command takes as argument a URL pointing to an image.
402 % The image will be embedded in the HTML document but will
403 % be ignored in the dvi and ps files. The optional argument
404 % denotes additional HTML tags.
405 %
406 % Example: \htmladdimg[ALT="portrait" ALIGN=CENTER]{portrait.gif}
407 %
408 \renewcommand{\htmladdimg}[2][]{}
410 %%% HTMLRULE for LaTeX2e
411 % This command adds a horizontal rule and is valid even within
412 % a figure caption.
413 %
414 % This command is best used with LaTeX2e and HTML 3.2 support.
415 % It is like \hrule, but allows for options via key--value pairs
416 % as follows: \htmlrule[key1=value1, key2=value2, ...] .
417 % Use \htmlrule* to suppress the <BR> tag.
418 % Eg. \htmlrule[left, 15, 5pt, "none", NOSHADE] produces
419 % <BR CLEAR="left"><HR NOSHADE SIZE="15">.
420 % Renew the necessary part.
421 \renewcommand{\htmlrulestar}[1][all]{}
423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
424 %
425 % renew some definitions to allow optional arguments
426 %
427 % The description of the options is missing, as yet.
428 %
429 \renewcommand{\latextohtml}{\textup{\LaTeX2\texttt{HTML}}}
430 \renewcommand{\htmladdnormallinkfoot}[3][]{#2\footnote{#3}}
431 \renewcommand{\htmladdnormallink}[3][]{#2}
432 \renewcommand{\htmlbody}[1][]{}
433 \renewcommand{\hyperref}[1][ref]{\hyperrefx[#1]}
434 \renewcommand{\hypercite}[1][int]{\hypercitex[#1]}
435 \renewcommand{\htmlref}[3][]{#2}
436 \renewcommand{\htmlcite}[1]{#1\htmlcitex}
437 \newcommand{\htmlcitex}[2][]{{\def\tmp{#1}\ifx\tmp\@empty\else~[#1]\fi}}
438 \renewcommand{\htmlimage}[2][]{}
439 \renewcommand{\htmlborder}[2][]{}
442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
443 %
444 % HTML HTMLset HTMLsetenv
445 %
446 % These commands do nothing in LaTeX, but can be used to place
447 % HTML tags or set Perl variables during the LaTeX2HTML processing;
448 % They are intended for expert use only.
450 \newcommand{\HTMLcode}[2][]{}
451 \ifx\undefined\HTML\newcommand{\HTML}[2][]{}\else
452 \typeout{*** Warning: \string\HTML\space had an incompatible definition ***}%
453 \typeout{*** instead use \string\HTMLcode\space for raw HTML code ***}%
454 \fi
455 \newcommand{\HTMLset}[3][]{}
456 \newcommand{\HTMLsetenv}[3][]{}
458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
459 %
460 % The following commands pertain to document segmentation, and
461 % were added by Herbert Swan <dprhws@edp.Arco.com> (with help from
462 % Michel Goossens <goossens@cern.ch>):
463 %
464 %
465 % This command inputs internal latex2html tables so that large
466 % documents can to partitioned into smaller (more manageable)
467 % segments.
468 %
469 \newcommand{\internal}[2][internals]{}
471 %
472 % Define a dummy stub \htmlhead{}. This command causes latex2html
473 % to define the title of the start of a new segment. It is not
474 % normally placed in the user's document. Rather, it is passed to
475 % latex2html via a .ptr file written by \segment.
476 %
477 \newcommand{\htmlhead}[3][]{}
479 % In the LaTeX2HTML version this will eliminate the title line
480 % generated by a \segment command, but retains the title string
481 % for use in other places.
482 %
483 \newcommand{\htmlnohead}{}
486 % In the LaTeX2HTML version this put a URL into a <BASE> tag
487 % within the <HEAD>...</HEAD> portion of a document.
488 %
489 \newcommand{\htmlbase}[1]{}
490 %
492 %
493 % The dummy command \endpreamble is needed by latex2html to
494 % mark the end of the preamble in document segments that do
495 % not contain a \begin{document}
496 %
497 \newcommand{\startdocument}{}
500 % \tableofchildlinks, \htmlinfo
501 % by Ross Moore --- extensions dated 27 September 1997
502 %
503 % These do nothing in LaTeX but for LaTeX2HTML they mark
504 % where the table of child-links and info-page should be placed,
505 % when the user wants other than the default.
506 % \tableofchildlinks % put mini-TOC at this location
507 % \tableofchildlinks[off] % not on current page
508 % \tableofchildlinks[none] % not on current and subsequent pages
509 % \tableofchildlinks[on] % selectively on current page
510 % \tableofchildlinks[all] % on current and all subsequent pages
511 % \htmlinfo % put info-page at this location
512 % \htmlinfo[off] % no info-page in current document
513 % \htmlinfo[none] % no info-page in current document
514 % *-versions omit the preceding <BR> tag.
515 %
516 \newcommand{\tableofchildlinks}{%
517 \@ifstar\tableofchildlinksstar\tableofchildlinksstar}
518 \newcommand{\tableofchildlinksstar}[1][]{}
520 \newcommand{\htmlinfo}{\@ifstar\htmlinfostar\htmlinfostar}
521 \newcommand{\htmlinfostar}[1][]{}
524 % This redefines \begin to allow for an optional argument
525 % which is used by LaTeX2HTML to specify `style-sheet' information
527 \let\realLaTeX@begin=\begin
528 \renewcommand{\begin}[1][]{\realLaTeX@begin}
531 %
532 % Allocate a new set of section counters, which will get incremented
533 % for "*" forms of sectioning commands, and for a few miscellaneous
534 % commands.
535 %
537 \newcounter{lpart}
538 \newcounter{lchapter}[part]
539 \@ifundefined{c@chapter}%
540 {\let\Hchapter\relax \newcounter{lsection}[part]}%
541 {\let\Hchapter=\chapter \newcounter{lsection}[chapter]}
542 \newcounter{lsubsection}[section]
543 \newcounter{lsubsubsection}[subsection]
544 \newcounter{lparagraph}[subsubsection]
545 \newcounter{lsubparagraph}[paragraph]
546 \newcounter{lequation}
548 %
549 % Redefine "*" forms of sectioning commands to increment their
550 % respective counters.
551 %
552 \let\Hpart=\part
553 %\let\Hchapter=\chapter
554 \let\Hsection=\section
555 \let\Hsubsection=\subsection
556 \let\Hsubsubsection=\subsubsection
557 \let\Hparagraph=\paragraph
558 \let\Hsubparagraph=\subparagraph
559 \let\Hsubsubparagraph=\subsubparagraph
561 \ifx\c@subparagraph\undefined
562 \newcounter{lsubsubparagraph}[lsubparagraph]
563 \else
564 \newcounter{lsubsubparagraph}[subparagraph]
565 \fi
567 %
568 % The following definitions are specific to LaTeX2e:
569 % (They must be commented out for LaTeX 2.09)
570 %
571 \renewcommand{\part}{\@ifstar{\stepcounter{lpart}%
572 \bgroup\def\tmp{*}\H@part}{\bgroup\def\tmp{}\H@part}}
573 \newcommand{\H@part}[1][]{\def\tmp@a{#1}\check@align
574 \expandafter\egroup\expandafter\Hpart\tmp}
576 \ifx\Hchapter\relax\else
577 \def\chapter{\resetsections \@ifstar{\stepcounter{lchapter}%
578 \bgroup\def\tmp{*}\H@chapter}{\bgroup\def\tmp{}\H@chapter}}\fi
579 \newcommand{\H@chapter}[1][]{\def\tmp@a{#1}\check@align
580 \expandafter\egroup\expandafter\Hchapter\tmp}
582 \renewcommand{\section}{\resetsubsections
583 \@ifstar{\stepcounter{lsection}\bgroup\def\tmp{*}%
584 \H@section}{\bgroup\def\tmp{}\H@section}}
585 \newcommand{\H@section}[1][]{\def\tmp@a{#1}\check@align
586 \expandafter\egroup\expandafter\Hsection\tmp}
588 \renewcommand{\subsection}{\resetsubsubsections
589 \@ifstar{\stepcounter{lsubsection}\bgroup\def\tmp{*}%
590 \H@subsection}{\bgroup\def\tmp{}\H@subsection}}
591 \newcommand{\H@subsection}[1][]{\def\tmp@a{#1}\check@align
592 \expandafter\egroup\expandafter\Hsubsection\tmp}
594 \renewcommand{\subsubsection}{\resetparagraphs
595 \@ifstar{\stepcounter{lsubsubsection}\bgroup\def\tmp{*}%
596 \H@subsubsection}{\bgroup\def\tmp{}\H@subsubsection}}
597 \newcommand{\H@subsubsection}[1][]{\def\tmp@a{#1}\check@align
598 \expandafter\egroup\expandafter\Hsubsubsection\tmp}
600 \renewcommand{\paragraph}{\resetsubparagraphs
601 \@ifstar{\stepcounter{lparagraph}\bgroup\def\tmp{*}%
602 \H@paragraph}{\bgroup\def\tmp{}\H@paragraph}}
603 \newcommand\H@paragraph[1][]{\def\tmp@a{#1}\check@align
604 \expandafter\egroup\expandafter\Hparagraph\tmp}
606 \renewcommand{\subparagraph}{\resetsubsubparagraphs
607 \@ifstar{\stepcounter{lsubparagraph}\bgroup\def\tmp{*}%
608 \H@subparagraph}{\bgroup\def\tmp{}\H@subparagraph}}
609 \newcommand\H@subparagraph[1][]{\def\tmp@a{#1}\check@align
610 \expandafter\egroup\expandafter\Hsubparagraph\tmp}
612 \ifx\Hsubsubparagraph\relax\else\@ifundefined{subsubparagraph}{}{%
613 \def\subsubparagraph{%
614 \@ifstar{\stepcounter{lsubsubparagraph}\bgroup\def\tmp{*}%
615 \H@subsubparagraph}{\bgroup\def\tmp{}\H@subsubparagraph}}}\fi
616 \newcommand\H@subsubparagraph[1][]{\def\tmp@a{#1}\check@align
617 \expandafter\egroup\expandafter\Hsubsubparagraph\tmp}
619 \def\check@align{\def\empty{}\ifx\tmp@a\empty
620 \else\def\tmp@b{center}\ifx\tmp@a\tmp@b\let\tmp@a\empty
621 \else\def\tmp@b{left}\ifx\tmp@a\tmp@b\let\tmp@a\empty
622 \else\def\tmp@b{right}\ifx\tmp@a\tmp@b\let\tmp@a\empty
623 \else\expandafter\def\expandafter\tmp@a\expandafter{\expandafter[\tmp@a]}%
624 \fi\fi\fi \def\empty{}\ifx\tmp\empty\let\tmp=\tmp@a \else
625 \expandafter\def\expandafter\tmp\expandafter{\expandafter*\tmp@a}%
626 \fi\fi}
627 %
628 \def\resetsections{\setcounter{section}{0}\setcounter{lsection}{0}%
629 \reset@dependents{section}\resetsubsections }
630 \def\resetsubsections{\setcounter{subsection}{0}\setcounter{lsubsection}{0}%
631 \reset@dependents{subsection}\resetsubsubsections }
632 \def\resetsubsubsections{\setcounter{subsubsection}{0}\setcounter{lsubsubsection}{0}%
633 \reset@dependents{subsubsection}\resetparagraphs }
634 %
635 \def\resetparagraphs{\setcounter{lparagraph}{0}\setcounter{lparagraph}{0}%
636 \reset@dependents{paragraph}\resetsubparagraphs }
637 \def\resetsubparagraphs{\ifx\c@subparagraph\undefined\else
638 \setcounter{subparagraph}{0}\fi \setcounter{lsubparagraph}{0}%
639 \reset@dependents{subparagraph}\resetsubsubparagraphs }
640 \def\resetsubsubparagraphs{\ifx\c@subsubparagraph\undefined\else
641 \setcounter{subsubparagraph}{0}\fi \setcounter{lsubsubparagraph}{0}}
642 %
643 \def\reset@dependents#1{\begingroup\let \@elt \@stpelt
644 \csname cl@#1\endcsname\endgroup}
645 %
646 %
647 % Define a helper macro to dump a single \secounter command to a file.
648 %
649 \newcommand{\DumpPtr}[2]{%
650 \count255=\arabic{#1}\def\dummy{dummy}\def\tmp{#2}%
651 \ifx\tmp\dummy\else\advance\count255 by \arabic{#2}\fi
652 \immediate\write\ptrfile{%
653 \noexpand\setcounter{#1}{\number\count255}}}
655 %
656 % Define a helper macro to dump all counters to the file.
657 % The value for each counter will be the sum of the l-counter
658 % actual LaTeX section counter.
659 % Also dump an \htmlhead{section-command}{section title} command
660 % to the file.
661 %
662 \newwrite\ptrfile
663 \def\DumpCounters#1#2#3#4{%
664 \begingroup\let\protect=\noexpand
665 \immediate\openout\ptrfile = #1.ptr
666 \DumpPtr{part}{lpart}%
667 \ifx\Hchapter\relax\else\DumpPtr{chapter}{lchapter}\fi
668 \DumpPtr{section}{lsection}%
669 \DumpPtr{subsection}{lsubsection}%
670 \DumpPtr{subsubsection}{lsubsubsection}%
671 \DumpPtr{paragraph}{lparagraph}%
672 \DumpPtr{subparagraph}{lsubparagraph}%
673 \DumpPtr{equation}{lequation}%
674 \DumpPtr{footnote}{dummy}%
675 \def\tmp{#4}\ifx\tmp\@empty
676 \immediate\write\ptrfile{\noexpand\htmlhead{#2}{#3}}\else
677 \immediate\write\ptrfile{\noexpand\htmlhead[#4]{#2}{#3}}\fi
678 \dumpcitestatus \dumpcurrentcolor
679 \immediate\closeout\ptrfile
680 \endgroup }
683 %% interface to natbib.sty
685 \def\dumpcitestatus{}
686 \def\loadcitestatus{\def\dumpcitestatus{%
687 \ifciteindex\immediate\write\ptrfile{\noexpand\citeindextrue}%
688 \else\immediate\write\ptrfile{\noexpand\citeindexfalse}\fi }%
689 }
690 \@ifpackageloaded{natbib}{\loadcitestatus}{%
691 \AtBeginDocument{\@ifpackageloaded{natbib}{\loadcitestatus}{}}}
694 %% interface to color.sty
696 \def\dumpcurrentcolor{}
697 \def\loadsegmentcolors{%
698 \let\real@pagecolor=\pagecolor
699 \let\pagecolor\segmentpagecolor
700 \let\segmentcolor\color
701 \ifx\current@page@color\undefined \def\current@page@color{{}}\fi
702 \def\dumpcurrentcolor{\bgroup\def\@empty@{{}}%
703 \expandafter\def\expandafter\tmp\space####1@{\def\thiscol{####1}}%
704 \ifx\current@color\@empty@\def\thiscol{}\else
705 \expandafter\tmp\current@color @\fi
706 \immediate\write\ptrfile{\noexpand\segmentcolor{\thiscol}}%
707 \ifx\current@page@color\@empty@\def\thiscol{}\else
708 \expandafter\tmp\current@page@color @\fi
709 \immediate\write\ptrfile{\noexpand\segmentpagecolor{\thiscol}}%
710 \egroup}%
711 \global\let\loadsegmentcolors=\relax
712 }
714 % These macros are needed within images.tex since this inputs
715 % the <segment>.ptr files for a segment, so that counters are
716 % colors are synchronised.
717 %
718 \newcommand{\segmentpagecolor}[1][]{%
719 \@ifpackageloaded{color}{\loadsegmentcolors\bgroup
720 \def\tmp{#1}\ifx\@empty\tmp\def\next{[]}\else\def\next{[#1]}\fi
721 \expandafter\segmentpagecolor@\next}%
722 {\@gobble}}
723 \def\segmentpagecolor@[#1]#2{\def\tmp{#1}\def\tmpB{#2}%
724 \ifx\tmpB\@empty\let\next=\egroup
725 \else
726 \let\realendgroup=\endgroup
727 \def\endgroup{\edef\next{\noexpand\realendgroup
728 \def\noexpand\current@page@color{\current@color}}\next}%
729 \ifx\tmp\@empty\real@pagecolor{#2}\def\model{}%
730 \else\real@pagecolor[#1]{#2}\def\model{[#1]}%
731 \fi
732 \edef\next{\egroup\def\noexpand\current@page@color{\current@page@color}%
733 \noexpand\real@pagecolor\model{#2}}%
734 \fi\next}
735 %
736 \newcommand{\segmentcolor}[2][named]{\@ifpackageloaded{color}%
737 {\loadsegmentcolors\segmentcolor[#1]{#2}}{}}
739 \@ifpackageloaded{color}{\loadsegmentcolors}{\let\real@pagecolor=\@gobble
740 \AtBeginDocument{\@ifpackageloaded{color}{\loadsegmentcolors}{}}}
743 % Define the \segment[align]{file}{section-command}{section-title} command,
744 % and its helper macros. This command does four things:
745 % 1) Begins a new LaTeX section;
746 % 2) Writes a list of section counters to file.ptr, each
747 % of which represents the sum of the LaTeX section
748 % counters, and the l-counters, defined above;
749 % 3) Write an \htmlhead{section-title} command to file.ptr;
750 % 4) Inputs file.tex.
752 \def\segment{\@ifstar{\@@htmls}{\@@html}}
753 \def\endsegment{}
754 \newcommand{\@@htmls}[1][]{\@@htmlsx{#1}}
755 \newcommand{\@@html}[1][]{\@@htmlx{#1}}
756 \def\@@htmlsx#1#2#3#4{\csname #3\endcsname* {#4}%
757 \DumpCounters{#2}{#3*}{#4}{#1}\input{#2}}
758 \def\@@htmlx#1#2#3#4{\csname #3\endcsname {#4}%
759 \DumpCounters{#2}{#3}{#4}{#1}\input{#2}}
761 \makeatother
762 \endinput
765 % Modifications:
766 %
767 % (The listing of Initiales see Changes)
769 % $Log: html.sty,v $
770 % Revision 1.23 1998/02/26 10:32:24 latex2html
771 % -- use \providecommand for \latextohtml
772 % -- implemented \HTMLcode to do what \HTML did previously
773 % \HTML still works, unless already defined by another package
774 % -- fixed problems remaining with undefined \chapter
775 % -- defined \endsegment
776 %
777 % Revision 1.22 1997/12/05 11:38:18 RRM
778 % -- implemented an optional argument to \begin for style-sheet info.
779 % -- modified use of an optional argument with sectioning-commands
780 %
781 % Revision 1.21 1997/11/05 10:28:56 RRM
782 % -- replaced redefinition of \@htmlrule with \htmlrulestar
783 %
784 % Revision 1.20 1997/10/28 02:15:58 RRM
785 % -- altered the way some special html-macros are defined, so that
786 % star-variants are explicitly defined for LaTeX
787 % -- it is possible for these to occur within images.tex
788 % e.g. \htmlinfostar \htmlrulestar \tableofchildlinksstar
789 %
790 % Revision 1.19 1997/10/11 05:47:48 RRM
791 % -- allow the dummy {tex2html_nowrap} environment in LaTeX
792 % use it to make its contents be evaluated in environment order
793 %
794 % Revision 1.18 1997/10/04 06:56:50 RRM
795 % -- uses Robin Fairbairns' code for ignored environments,
796 % replacing the previous comment.sty stuff.
797 % -- extensions to the \tableofchildlinks command
798 % -- extensions to the \htmlinfo command
799 %
800 % Revision 1.17 1997/07/08 11:23:39 RRM
801 % include value of footnote counter in .ptr files for segments
802 %
803 % Revision 1.16 1997/07/03 08:56:34 RRM
804 % use \textup within the \latextohtml macro
805 %
806 % Revision 1.15 1997/06/15 10:24:58 RRM
807 % new command \htmltracenv as environment-ordered \htmltracing
808 %
809 % Revision 1.14 1997/06/06 10:30:37 RRM
810 % - new command: \htmlborder puts environment into a <TABLE> cell
811 % with a border of specified width, + other attributes.
812 % - new commands: \HTML for setting arbitrary HTML tags, with attributes
813 % \HTMLset for setting Perl variables, while processing
814 % \HTMLsetenv same as \HTMLset , but it gets processed
815 % as if it were an environment.
816 % - new command: \latextohtml --- to set the LaTeX2HTML name/logo
817 % - fixed some remaining problems with \segmentcolor & \segmentpagecolor
818 %
819 % Revision 1.13 1997/05/19 13:55:46 RRM
820 % alterations and extra options to \hypercite
821 %
822 % Revision 1.12 1997/05/09 12:28:39 RRM
823 % - Added the optional argument to \htmlhead, also in \DumpCounters
824 % - Implemented \HTMLset as a no-op in LaTeX.
825 % - Fixed a bug in accessing the page@color settings.
826 %
827 % Revision 1.11 1997/03/26 09:32:40 RRM
828 % - Implements LaTeX versions of \externalcite and \hypercite commands.
829 % Thanks to Uffe Engberg and Stephen Simpson for the suggestions.
830 %
831 % Revision 1.10 1997/03/06 07:37:58 RRM
832 % Added the \htmltracing command, for altering $VERBOSITY .
833 %
834 % Revision 1.9 1997/02/17 02:26:26 RRM
835 % - changes to counter handling (RRM)
836 % - shuffled around some definitions
837 % - changed \htmlrule of 209 mode
838 %
839 % Revision 1.8 1997/01/26 09:04:12 RRM
840 % RRM: added optional argument to sectioning commands
841 % \htmlbase sets the <BASE HREF=...> tag
842 % \htmlinfo and \htmlinfo* allow the document info to be positioned
843 %
844 % Revision 1.7 1997/01/03 12:15:44 L2HADMIN
845 % % - fixes to the color and natbib interfaces
846 % % - extended usage of \hyperref, via an optional argument.
847 % % - extended use comment environments to allow shifting expansions
848 % % e.g. within \multicolumn (`bug' reported by Luc De Coninck).
849 % % - allow optional argument to: \htmlimage, \htmlhead,
850 % % \htmladdimg, \htmladdnormallink, \htmladdnormallinkfoot
851 % % - added new commands: \htmlbody, \htmlnohead
852 % % - added new command: \tableofchildlinks
853 %
854 % Revision 1.6 1996/12/25 03:04:54 JCL
855 % added patches to segment feature from Martin Wilck
856 %
857 % Revision 1.5 1996/12/23 01:48:06 JCL
858 % o introduced the environment makeimage, which may be used to force
859 % LaTeX2HTML to generate an image from the contents.
860 % There's no magic, all what we have now is a defined empty environment
861 % which LaTeX2HTML will not recognize and thus pass it to images.tex.
862 % o provided \protect to the \htmlrule commands to allow for usage
863 % within captions.
864 %
865 % Revision 1.4 1996/12/21 19:59:22 JCL
866 % - shuffled some entries
867 % - added \latexhtml command
868 %
869 % Revision 1.3 1996/12/21 12:22:59 JCL
870 % removed duplicate \htmlrule, changed \htmlrule back not to create a \hrule
871 % to allow occurrence in caption
872 %
873 % Revision 1.2 1996/12/20 04:03:41 JCL
874 % changed occurrence of \makeatletter, \makeatother
875 % added new \htmlrule command both for the LaTeX2.09 and LaTeX2e
876 % sections
877 %
878 %
879 % jcl 30-SEP-96
880 % - Stuck the commands commonly used by both LaTeX versions to the top,
881 % added a check which stops input or reads further if the document
882 % makes use of LaTeX2e.
883 % - Introduced rrm's \dumpcurrentcolor and \bodytext
884 % hws 31-JAN-96 - Added support for document segmentation
885 % hws 10-OCT-95 - Added \htmlrule command
886 % jz 22-APR-94 - Added support for htmlref
887 % nd - Created