Debian Codegraph @

packages/pamgen/doc/sand_report/html.sty

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