html.sty 41 KB

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