html.sty 41 KB

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