hevea.sty (9545B)
1 % htmlgen Version 0.0 : html.sty 2 % This is a very basic style file for latex document to be processed 3 % with htmlgen. It contains definitions of LaTeX commands which are 4 % processed in a special way by the translator. 5 % Mostly : 6 % - environment latexonly, not processed by htmlgen, processed by latex. 7 % - environment htmlonly , the reverse 8 % - environment htmlraw, to include raw HTML in hevea output. 9 % 10 \makeatletter% 11 12 \newif{\ifhtml} 13 \newif{\iftext} 14 \htmlfalse 15 \textfalse 16 17 18 \newcommand{\smup}[2]{% 19 \raise #1\hbox{$\m@th$% 20 \csname S@\f@size\endcsname 21 \fontsize\sf@size 0% 22 \math@fontsfalse\selectfont 23 #2% 24 }}% 25 \newcommand{\hevea}{H\kern-.15em\protect\smup{.2ex}{E}\kern-.15emV\kern-.15em\protect\smup{.2ex}{E}\kern-.15emA}% 26 \newcommand{\hacha}{H\kern-.15em\protect\smup{.2ex}{A}\kern-.15emC\kern-.1em\protect\smup{.2ex}{H}\kern-.15emA}% 27 \newcommand{\html}{\protect\smup{0.ex}{HTML}} 28 \makeatother% 29 \newcommand{\footurl}[2]{#2\footnote{\texttt{#1}}} 30 \newcommand{\url}[2]{#2} 31 \newcommand{\oneurl}[1]{\texttt{#1}} 32 \newcommand{\home}[1]{\protect\raisebox{-.75ex}{\char126}#1} 33 \newcommand{\docurl}{http://para.inria.fr/\home{maranget}/hevea} 34 \newcommand{\mailto}[1]{\texttt{#1}} 35 \newif\ifhevea\heveafalse 36 %% Void cutting instructions 37 \newcounter{cuttingdepth} 38 \newcommand{\cuttingunit}{} 39 \newcommand{\cutdef}[2]{} 40 \newcommand{\cuthere}[2]{} 41 \newcommand{\cutend}{} 42 \newcommand{\htmlhead}[1]{} 43 \newcommand{\htmlfoot}[1]{} 44 % LaTeX2HTML Version 0.6.4 : html.sty 45 % 46 % This file contains definitions of LaTeX commands which are 47 % processed in a special way by the translator. 48 % For example, there are commands for embedding external hypertext links, 49 % for cross-references between documents or for including 50 % raw HTML. 51 % This file includes the comments.sty file v2.0 by Victor Eijkhout 52 % In most cases these commands do nothing when processed by LaTeX. 53 54 % Modifications: 55 % 56 % nd = Nikos Drakos <nikos@cbl.leeds.ac.uk> 57 % jz = Jelle van Zeijl <jvzeijl@isou17.estec.esa.nl> 58 59 % jz 22-APR-94 - Added support for htmlref 60 % nd - Created 61 62 63 64 % Exit if the style file is already loaded 65 % (suggested by Lee Shombert <las@potomac.wash.inmet.com> 66 \ifx \htmlstyloaded\relax \endinput\else\let\htmlstyloaded\relax\fi 67 68 %%% LINKS TO EXTERNAL DOCUMENTS 69 % 70 % This can be used to provide links to arbitrary documents. 71 % The first argumment should be the text that is going to be 72 % highlighted and the second argument a URL. 73 % The hyperlink will appear as a hyperlink in the HTML 74 % document and as a footnote in the dvi or ps files. 75 % 76 \newcommand{\htmladdnormallinkfoot}[2]{ #1\footnote{#2}} 77 78 % This is an alternative definition of the command above which 79 % will ignore the URL in the dvi or ps files. 80 \newcommand{\htmladdnormallink}[2]{ #1 } 81 82 % This command takes as argument a URL pointing to an image. 83 % The image will be embedded in the HTML document but will 84 % be ignored in the dvi and ps files. 85 % 86 \newcommand{\htmladdimg}[1]{ } 87 88 %%% CROSS-REFERENCES BETWEEN (LOCAL OR REMOTE) DOCUMENTS 89 % 90 % This can be used to refer to symbolic labels in other Latex 91 % documents that have already been processed by the translator. 92 % The arguments should be: 93 % #1 : the URL to the directory containing the external document 94 % #2 : the path to the labels.pl file of the external document. 95 % If the external document lives on a remote machine then labels.pl 96 % must be copied on the local machine. 97 % 98 %e.g. \externallabels{http://cbl.leeds.ac.uk/nikos/WWW/doc/tex2html/latex2html} 99 % {/usr/cblelca/nikos/tmp/labels.pl} 100 % The arguments are ignored in the dvi and ps files. 101 % 102 \newcommand{\externallabels}[2]{ } 103 104 % This complements the \externallabels command above. The argument 105 % should be a label defined in another latex document and will be 106 % ignored in the dvi and ps files. 107 % 108 \newcommand{\externalref}[1]{ } 109 110 111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 112 % Comment.sty version 2.0, 19 June 1992 113 % selectively in/exclude pieces of text: the user can define new 114 % comment versions, and each is controlled separately. 115 % This style can be used with plain TeX or LaTeX, and probably 116 % most other packages too. 117 % 118 % Examples of use in LaTeX and TeX follow \endinput 119 % 120 % Author 121 % Victor Eijkhout 122 % Department of Computer Science 123 % University Tennessee at Knoxville 124 % 104 Ayres Hall 125 % Knoxville, TN 37996 126 % USA 127 % 128 % eijkhout@cs.utk.edu 129 % 130 % Usage: all text included in between 131 % \comment ... \endcomment 132 % or \begin{comment} ... \end{comment} 133 % is discarded. The closing command should appear on a line 134 % of its own. No starting spaces, nothing after it. 135 % This environment should work with arbitrary amounts 136 % of comment. 137 % 138 % Other 'comment' environments are defined by 139 % and are selected/deselected with 140 % \includecomment{versiona} 141 % \excludecoment{versionb} 142 % 143 % These environments are used as 144 % \versiona ... \endversiona 145 % or \begin{versiona} ... \end{versiona} 146 % with the closing command again on a line of its own. 147 % 148 % Basic approach: 149 % to comment something out, scoop up every line in verbatim mode 150 % as macro argument, then throw it away. 151 % For inclusions, both the opening and closing commands 152 % are defined as noop 153 % 154 % Changed \next to \html@next to prevent clashes with other sty files 155 % (mike@emn.fr) 156 % Changed \html@next to \htmlnext so the \makeatletter and 157 % \makeatother commands could be removed (they were causing other 158 % style files - changebar.sty - to crash) (nikos@cbl.leeds.ac.uk) 159 160 161 \def\makeinnocent#1{\catcode`#1=12 } 162 \def\csarg#1#2{\expandafter#1\csname#2\endcsname} 163 164 \def\ThrowAwayComment#1{\begingroup 165 \def\CurrentComment{#1}% 166 \let\do\makeinnocent \dospecials 167 \makeinnocent\^^L% and whatever other special cases 168 \endlinechar`\^^M \catcode`\^^M=12 \xComment} 169 {\catcode`\^^M=12 \endlinechar=-1 % 170 \gdef\xComment#1^^M{\def\test{#1} 171 \csarg\ifx{PlainEnd\CurrentComment Test}\test 172 \let\htmlnext\endgroup 173 \else \csarg\ifx{LaLaEnd\CurrentComment Test}\test 174 \edef\htmlnext{\endgroup\noexpand\end{\CurrentComment}} 175 \else \let\htmlnext\xComment 176 \fi \fi \htmlnext} 177 } 178 179 \def\includecomment 180 #1{\expandafter\def\csname#1\endcsname{}% 181 \expandafter\def\csname end#1\endcsname{}} 182 \def\excludecomment 183 #1{\expandafter\def\csname#1\endcsname{\ThrowAwayComment{#1}}% 184 {\escapechar=-1\relax 185 \csarg\xdef{PlainEnd#1Test}{\string\\end#1}% 186 \csarg\xdef{LaLaEnd#1Test}{\string\\end\string\{#1\string\}}% 187 }} 188 189 \excludecomment{comment} 190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 191 192 %%% RAW HTML 193 % 194 % Enclose raw HTML between a \begin{rawhtml} and \end{rawhtml}. 195 % The html environment ignores its body 196 % 197 \excludecomment{rawhtml} 198 199 %%% HTML ONLY 200 % 201 % Enclose LaTeX constructs which will only appear in the 202 % HTML output and will be ignored by LaTeX with 203 % \begin{htmlonly} and \end{htmlonly} 204 % 205 \excludecomment{htmlonly} 206 207 %%% LaTeX ONLY 208 % Enclose LaTeX constructs which will only appear in the 209 % DVI output and will be ignored by latex2html with 210 %\begin{latexonly} and \end{latexonly} 211 % 212 \newenvironment{latexonly}{}{} 213 \newenvironment{verblatex}{}{} 214 \def\toimage{\expandafter\ifx\csname graph\endcsname\relax \csname newbox\endcsname\graph\fi} 215 \def\endtoimage{\global\setbox\graph=\box\graph} 216 \def\verbimage{\expandafter\ifx\csname graph\endcsname\relax \csname newbox\endcsname\graph\fi} 217 \def\endverbimage{\global\setbox\graph=\box\graph} 218 %\newcommand{\imageflush}[1][]{} 219 \newcommand{\imageflush}{} 220 %%% HYPERREF 221 % Suggested by Eric M. Carol <eric@ca.utoronto.utcc.enfm> 222 % Similar to \ref but accepts conditional text. 223 % The first argument is HTML text which will become ``hyperized'' 224 % (underlined). 225 % The second and third arguments are text which will appear only in the paper 226 % version (DVI file), enclosing the fourth argument which is a reference to a label. 227 % 228 %e.g. \hyperref{using the tracer}{using the tracer (see Section}{)}{trace} 229 % where there is a corresponding \label{trace} 230 % 231 \newcommand{\hyperref}[4]{#2\ref{#4}#3} 232 233 %%% HTMLREF 234 % Reference in HTML version only. 235 % Mix between \htmladdnormallink and \hyperref. 236 % First arg is text for in both versions, second is label for use in HTML 237 % version. 238 \newcommand{\htmlref}[2]{#1} 239 240 %%% HTMLIMAGE 241 % This command can be used inside any environment that is converted 242 % into an inlined image (eg a "figure" environment) in order to change 243 % the way the image will be translated. The argument of \htmlimage 244 % is really a string of options separated by commas ie 245 % [scale=<scale factor>],[external],[thumbnail=<reduction factor> 246 % The scale option allows control over the size of the final image. 247 % The ``external'' option will cause the image not to be inlined 248 % (images are inlined by default). External images will be accessible 249 % via a hypertext link. 250 % The ``thumbnail'' option will cause a small inlined image to be 251 % placed in the caption. The size of the thumbnail depends on the 252 % reduction factor. The use of the ``thumbnail'' option implies 253 % the ``external'' option. 254 % 255 % Example: 256 % \htmlimage{scale=1.5,external,thumbnail=0.2} 257 % will cause a small thumbnail image 1/5th of the original size to be 258 % placed in the final document, pointing to an external image 1.5 259 % times bigger than the original. 260 % 261 \newcommand{\htmlimage}[1]{} 262 263 %%% HTMLADDTONAVIGATION 264 % This command appends its argument to the buttons in the navigation 265 % panel. It is ignored by LaTeX. 266 % 267 % Example: 268 % \htmladdtonavigation{\htmladdnormallink 269 % {\htmladdimg{http://server/path/to/gif}} 270 % {http://server/path}} 271 \newcommand{\htmladdtonavigation}[1]{}