Debian Codegraph @

texmf-dist/source/latex/iso10303/step4ht.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Author: Peter Wilson (CUA) (now at: [email protected])
4 %
5 % This system is released under the LaTeX Project Public License.
6 %
7 % This system is distributed in the hope that it will be useful,
8 % but WITHOUT ANY WARRANTY; without even the implied warranty of
9 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 %
11 %<*driver>
12 \documentclass{ltxdoc}
13 \usepackage{url}
14 \newcommand{\makecolonletter}{\catcode`\:11\relax}
15 \renewcommand{\MakePrivateLetters}{\makeatletter\makecolonletter}
16 \EnableCrossrefs
17 \CodelineIndex
18 \setcounter{StandardModuleDepth}{1}
19 \begin{document}
20 \DocInput{step4ht.dtx}
21 \end{document}
22 %</driver>
23 %
24 % \fi
25 %
26 % \CheckSum{503}
27 %
28 % \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
29 % \DoNotIndex{\@centercr,\@cite}
30 % \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
31 % \DoNotIndex{\@input,\@ixpt,\@m}
32 % \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
33 % \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
34 % \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
35 % \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
36 % \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
37 % \DoNotIndex{\advance,\Alph,\alph}
38 % \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
39 % \DoNotIndex{\bullet}
40 % \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
41 % \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
42 % \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
43 % \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
44 % \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
45 % \DoNotIndex{\fbox}
46 % \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
47 % \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
48 % \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
49 % \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
50 % \DoNotIndex{\input}
51 % \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
52 % \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
53 % \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
54 % \DoNotIndex{\NeedsTeXFormat,\newdimen}
55 % \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
56 % \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
57 % \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
58 % \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
59 % \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
60 % \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
61 % \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
62 % \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
63 % \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
64 % \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
65 % \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
66 % \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
67 % \DoNotIndex{\wd,\xiipt,\year,\z@}
68 % \DoNotIndex{\HCode}
69 %
70 % \changes{v0.1}{2000/01/20}{First public release}
71 %
72 % \def\fileversion{v0.1}
73 % \def\filedate{2000/01/20}
74 % \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
75 % \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
76 % \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
77 % \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter
78 % \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle
79 % \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment
80 % \newcommand*{\texht}{\Lpack{TeX4ht}} ^^A typeset TeX4ht
81 %
82 % \title{The \Lpack{step4ht} \texht{} package\thanks{This
83 % file has version number \fileversion, last revised
84 % \filedate.}}
85 %
86 % \author{%
87 % Peter Wilson\\
88 % Catholic University of America \\
89 % Now at \texttt{[email protected]}
90 % }
91 % \date{\filedate}
92 % \maketitle
93 % \begin{abstract}
94 % The \Lpack{step4ht} package, in conjunction with \texht{}
95 % can be used to convert \LaTeX{}
96 % STEP documents into HTML tagged documents.
97 % \end{abstract}
98 % \tableofcontents
99 %
100 % \StopEventually{}
101 %
102 %
103 %
104 % \section{Introduction}
105 %
106 % The \Lpack{step4ht} package can be used in conjunction with
107 % the \texht{} system to convert \LaTeX{} ISO~10303 (STEP) documents
108 % into HTML tagged documents.
109 %
110 % Section~\ref{sec:usc} describes the package and
111 % commented source code for the package is in Section~\ref{sec:code}.
112 %
113 % This manual is typeset according to the conventions of the
114 % \LaTeX{} \textsc{docstrip} utility which enables the automatic
115 % extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
116 %
117 % \subsection{Acknowledgement}
118 %
119 % Development of the \Lpack{step4ht} package would not have been possible
120 % without the help and expertise of Eitan Gurari, and in particular his
121 % willingness to put up with the many questions I asked.
122 %
123 %
124 % \section{The \Lpack{step4ht} package} \label{sec:usc}
125 %
126 % The \texht{} system has been developed by Eitan Gurari (see Chapter~4
127 % and Appendix~B in~\cite{GOOSSENS99}). It is a general purpose conversion
128 % system to convert \LaTeX{} tagged documents into HTML (or other *ML)
129 % tagged documents. \texht{} can be obtained from
130 % \url{http://www.cis.ohio-state.edu/~gurari/TeX4ht/mn.html}.
131 % The \Lpack{step4ht}
132 % package is not guaranteed to work with versions of \texht{} earlier
133 % than mid-January 2000. At the time of writing, the default \texht{}
134 % distribution was dated mid-1999. The latest version of \texht{} is obtainable
135 % from \url{http://www.cis.ohio-state.edu/~gurari/TeX4ht/bugfixes.html}.
136 %
137 % To use the \Lpack{step4ht} package, just process the \LaTeX{} document
138 % as you would any other under \texht. That is, either call the |ht| script
139 % on a document starting like:
140 % \begin{verbatim}
141 % \documentclass[...]{isov2}
142 % \usepackage[...]{tex4ht}
143 % \usepackage{isov13}
144 % ...
145 % \end{verbatim}
146 % or call the |htlatex| script on a document without the
147 % |\usepackage[...]{tex4ht}| line.
148 %
149 %
150 % \section{The package code} \label{sec:code}
151 %
152 % The following code is based on \Lpack{html0.4ht},
153 % \Lpack{html32.4ht} and \Lpack{html4.4ht}, all written by Eitan Gurari,
154 % together with code in the \Lpack{iso4ht} package.
155 %
156 % Most of the necessary work already exists in \Lpack{latex.4ht}, which
157 % sets up the \LaTeX{} kernel code and the \Lpack{iso4ht} package
158 % which provides the setup and configuration for the
159 % \Lpack{iso} class, together with \Lpack{html0.4ht},
160 % \Lpack{html32.4ht} and \Lpack{html4.4ht} provide the HTML option-related
161 % configurations for the kernel code.
162 % The HTML option-related configurations are
163 % embedded in \Lpack{stepv13.4ht} instead of being supplied as
164 % seperate files.
165 %
166 % \changes{v0.1}{2000/01/20}{First public release}
167 %
168 % Announce the name and version of the package.
169 % \begin{macrocode}
170 %<*usc>
171 \typeout{[stepv13.4ht 2000/01/20 version v0.1]}
172
173 % \end{macrocode}
174 %
175 % \subsection{Setup and hooks}
176 %
177 % The first major part of the code deals with setting up for configuring
178 % the \LaTeX{} commands and environments, which forms the second major
179 % portion of the code.
180 %
181 % Setting up may involve adding hooks into commands, either by redefining
182 % them or, in simpler cases prepending and/or appending code before and/or
183 % after the original code. It can also involve specifying that commands
184 % are configurable.
185 %
186 %
187 % \subsubsection{The STEP cover page}
188 %
189 % The |\STEPcover| command is implemented as a |picture| environment.
190 % \LaTeX{} pictures are usually presented as \file{.gif} images in \texht,
191 % so some major surgery is done to avoid pictures in this case.
192 %
193 % First, we redefine the commands that correspond to the |\STEPcover|
194 % picture placement commands.
195 %
196 % \DescribeMacro{\wg}
197 % The Working Group.
198 % \begin{macrocode}
199 \renewcommand{\wg}[1]{\def\@wg{/#1}}
200 % \end{macrocode}
201 %
202 % \DescribeMacro{\oldwg}
203 % The old Working Group.
204 % \begin{macrocode}
205 \renewcommand{\oldwg}[1]{\def\@oldwg{/#1}}
206 % \end{macrocode}
207 %
208 % \DescribeMacro{\@docnumber}
209 % \DescribeMacro{\docnumber}
210 % \DescribeMacro{\donumber}
211 % The document number, where |\donumber| has hooks and typesets the number.
212 % \begin{macrocode}
213 \renewcommand{\@docnumber}{/N}
214 \renewcommand{\docnumber}[1]{\def\@docnumber{/N#1}}
215 \def\donumber{\a:donumber ISO TC 184/SC4\@wg\@docnumber \b:donumber}
216 \NewConfigure{donumber}{2}
217
218 % \end{macrocode}
219 %
220 % \DescribeMacro{\@docdate}
221 % \DescribeMacro{\docdate}
222 % \DescribeMacro{\dodocdate}
223 % The document date, where |dodocdate| has hooks and typesets the date.
224 % \begin{macrocode}
225 \renewcommand{\@docdate}{Date: }
226 \renewcommand{\docdate}[1]{\def\@docdate{\textbf{Date: #1}}}
227 \def\dodocdate{\a:dodocdate \@docdate \b:dodocdate}
228 \NewConfigure{dodocdate}{2}
229
230 % \end{macrocode}
231 %
232 % \DescribeMacro{\@olddocnumber}
233 % \DescribeMacro{\olddocnumber}
234 % \DescribeMacro{\doolddocnumber}
235 % The previous document number, where |\dooldnumber| has hooks and
236 % typesets the number.
237 % \begin{macrocode}
238 \renewcommand{\@olddocnumber}{/N}
239 \renewcommand{\olddocnumber}[1]{\def\@olddocnumber{/N#1}}
240 \def\dooldnumber{\a:dooldnumber Supersedes ISO TC 184/SC4\@oldwg\@olddocnumber \b:dooldnumber}
241 \NewConfigure{dooldnumber}{2}
242
243 % \end{macrocode}
244 %
245 % \DescribeMacro{\dopartno}
246 % Typeset the Part number (and ballot cycle).
247 % \begin{macrocode}
248 \newcommand{\dopartno}{%
249 \ifnum\value{b@cyc} < 2\relax
250 {\bf ISO\thest@tus\ 10303-\thespartno}
251 \else
252 {\bf ISO\thest@tus\ 10303-\thespartno.\theb@cyc}
253 \fi}
254 \pend:def\dopartno{\a:dopartno}
255 \append:def\dopartno{\b:dopartno}
256 \NewConfigure{dopartno}{2}
257
258 % \end{macrocode}
259 %
260 % \DescribeMacro{\doptitle}
261 % Typeset the Part title.
262 % \begin{macrocode}
263 \newcommand{\doptitle}{%
264 {\bf \st@pn@me : \thes@ries : \thed@ctitle}
265 }
266 \pend:def\doptitle{\a:doptitle}
267 \append:def\doptitle{\b:doptitle}
268 \NewConfigure{doptitle}{2}
269
270 % \end{macrocode}
271 %
272 % \DescribeMacro{\cpnotice}
273 % Typeset the title COPYRIGHT NOTICE.
274 % \begin{macrocode}
275 \newcommand{\cpnotice}{\a:cpnotice COPYRIGHT NOTICE \b:cpnotice}
276 \NewConfigure{cpnotice}{2}
277
278 % \end{macrocode}
279 %
280 % \DescribeMacro{\@abstract}
281 % \DescribeMacro{\abstract}
282 % \DescribeMacro{\doabstract}
283 % The abstract, where |\doabstract| has hooks and typesets the abstract.
284 % \begin{macrocode}
285 \renewcommand{\@abstract}{\textbf{ABSTRACT}: }
286 \renewcommand{\abstract}[1]{\def\@abstract{\textbf{ABSTRACT}: #1}}
287 \def\doabstract{\a:doabstract \@abstract \b:doabstract}
288 \NewConfigure{doabstract}{2}
289
290 % \end{macrocode}
291 %
292 % \DescribeMacro{\@keywords}
293 % \DescribeMacro{\keywords}
294 % \DescribeMacro{\dokeywords}
295 % The KEYWORDS, where |\dokeywords| has hooks and typesets the keywords.
296 % \begin{macrocode}
297 \renewcommand{\@keywords}{\textbf{KEYWORDS}: }
298 \renewcommand{\keywords}[1]{\def\@keywords{\textbf{KEYWORDS}: #1}}
299 \def\dokeywords{\a:dokeywords \@keywords \b:dokeywords}
300 \NewConfigure{dokeywords}{2}
301
302 % \end{macrocode}
303 %
304 % \DescribeMacro{\@comread}
305 % \DescribeMacro{\comread}
306 % \DescribeMacro{\docomread}
307 % The COMMENTS TO READERS, where |\docomread| has hooks and typesets the
308 % comments.
309 % \begin{macrocode}
310 \renewcommand{\@comread}{\textbf{COMMENTS TO READER}: }
311 \renewcommand{\comread}[1]{\def\@comread{\textbf{COMMENTS TO READER}: #1}}
312 \def\docomread{\a:docomread \@comread \b:docomread}
313 \NewConfigure{docomread}{2}
314
315 % \end{macrocode}
316 %
317 % \DescribeMacro{\owner}
318 % \DescribeMacro{\address}
319 % \DescribeMacro{\telephone}
320 % \DescribeMacro{\fax}
321 % \DescribeMacro{\email}
322 % Contact information for the project leader.
323 % \begin{macrocode}
324 \renewcommand{\owner}[1]{\def\@owner{#1}}
325 \renewcommand{\address}[1]{\def\@address{#1}}
326 \renewcommand{\telephone}[1]{\def\@telephone{#1}}
327 \renewcommand{\fax}[1]{\def\@fax{#1}}
328 \renewcommand{\email}[1]{\def\@email{#1}}
329
330 % \end{macrocode}
331 %
332 % \DescribeMacro{\altowner}
333 % \DescribeMacro{\altaddress}
334 % \DescribeMacro{\alttelephone}
335 % \DescribeMacro{\altfax}
336 % \DescribeMacro{\altemail}
337 % Contact information for the document editor.
338 % \begin{macrocode}
339 \renewcommand{\altowner}[1]{\def\@altowner{#1}}
340 \renewcommand{\altaddress}[1]{\def\@altaddress{#1}}
341 \renewcommand{\alttelephone}[1]{\def\@alttelephone{#1}}
342 \renewcommand{\altfax}[1]{\def\@altfax{#1}}
343 \renewcommand{\altemail}[1]{\def\@altemail{#1}}
344
345 % \end{macrocode}
346 %
347 %
348 % \DescribeMacro{\STEPcover}
349 % The |\STEPcover| command is redefined to add hooks at the start and end.
350 % \begin{macrocode}
351 \renewcommand{\STEPcover}[1]{
352 \a:STEPcover
353 #1
354 \drawcoversheet
355 \b:STEPcover
356 }
357 \NewConfigure{STEPcover}{2}
358
359 % \end{macrocode}
360 %
361 % \DescribeMacro{\drawcoversheet}
362 % |\drawcoversheet| is redefined to typeset the cover instead of drawing it.
363 % \begin{macrocode}
364 \renewcommand{\drawcoversheet}{
365 \donumber \\
366 \dodocdate \\
367 \dooldnumber \\
368 \dopartno \\
369 \doptitle \\
370
371 \ifc@pyrightopt
372 \ifisst@ndard \input{bpfsX} \fi % IS
373 \iffdisst@ndard \input{bpfs2} \fi % FDIS
374 \ifdisst@ndard \input{bpfs3} \fi % DIS
375 \ifcdst@ndard \input{bpfs4} \fi % CD
376 \ifwdst@ndard \input{bpfs4} \fi % WD
377 \ift@chrep \input{bpfsX} \fi % Tech Report
378 \fi
379
380 \doabstract \\
381 \dokeywords \\
382 \docomread \\
383 \begin{tabular}{|l|p{0.3\textwidth}|p{0.3\textwidth}|} \hline
384 & Project Leader & Project Editor \\ \hline
385 Name & \@owner & \@altowner \\
386 Address & \@address & \@altaddress \\
387 Telephone & \@telephone & \@alttelephone \\
388 TeleFacsimile & \@fax & \@altfax \\
389 Email & \@email & \@altemail \\ \hline
390 \end{tabular}
391
392 % \end{macrocode}
393 % And, as before, clear out the cover commands which are no longer needed.
394 % \begin{macrocode}
395 \undef@covercmds
396 }
397
398 % \end{macrocode}
399 %
400 %
401 % \subsubsection{Miscellaneous}
402 %
403 % \DescribeMacro{\@presteptitle}
404 % \DescribeMacro{\stepparttitle}
405 % The |\stepparttitle| is redefined to use the |\titleclause*| command
406 % as defined in the \Lpack{iso4ht} package. The |\@presteptitle| command
407 % is just a helper. The configuration of |\titleclause*| is defined
408 % in \Lpack{iso4ht}.
409 % \begin{macrocode}
410 \newcommand{\@presteptitle}{\scivm@in \stepc@mp \thisp@rtno{\thespartno}}
411 \renewcommand{\stepparttitle}[1]{%
412 \gdef\thestepparttitle{{\@presteptitle \sptitle{#1}}}
413 \titleclause*{\thestepparttitle}
414 }
415
416 % \end{macrocode}
417 %
418 %
419 % \subsection{Configuration}
420 %
421 % All, or nearly all, configurations depend on the HTML level option chosen.
422 % Typically, html0 results in empty or null values of the hooks;
423 % the |\NewConfigure| command provides empty configurations. html32 has
424 % some simple hook values, while html4 are the most complex.
425 %
426 %
427 % \subsubsection{STEP cover page}
428 %
429 % \begin{macro}{\STEPcover}
430 % \begin{macro}{\donumber}
431 % \begin{macro}{\dodocdate}
432 % \begin{macro}{\dooldnumber}
433 % \begin{macro}{\dopartno}
434 % \begin{macro}{\doptitle}
435 % \begin{macro}{\cpnotice}
436 % \begin{macro}{\doabstract}
437 % \begin{macro}{\dokeywords}
438 % \begin{macro}{\docomread}
439 % \begin{macrocode}
440 \:CheckOption{0.0}
441 \if:Option
442 %%%% html0.0
443
444 \else
445 \:CheckOption{3.2}
446 \if:Option
447 %%%% html3.2
448 \Configure{STEPcover}{\HCode{<hr>}}{\HCode{<hr>}}
449 \Configure{donumber}{\HCode{<h3>}}{\HCode{</h3>}}
450 \Configure{dodocdate}{\HCode{<h5>}}{\HCode{</h5>}}
451 \Configure{dooldnumber}{\HCode{<h4>}}{\HCode{</h4>}}
452 \Configure{dopartno}{\HCode{<h4>}}{}
453 \Configure{doptitle}{}{\HCode{</h4>}}
454 \Configure{cpnotice}{\HCode{<h5>}}{\HCode{</h5>}}
455 \Configure{doabstract}{\HCode{<blockquote>}}{\HCode{</blockquote>}}
456 \Configure{dokeywords}{\HCode{<blockquote>}}{\HCode{</blockquote>}}
457 \Configure{docomread}{\HCode{<blockquote>}}{\HCode{</blockquote>}}
458
459 \else
460 %%%% html4.0
461 \Configure{STEPcover}{\HCode{<hr>}}{\HCode{<hr>}}
462 \Configure{STEPcover}{\HCode{<hr>}}{\HCode{<hr>}}
463 \Configure{donumber}{\HCode{<h3>}}{\HCode{</h3>}}
464 \Configure{dodocdate}{\HCode{<h5>}}{\HCode{</h5>}}
465 \Configure{dooldnumber}{\HCode{<h4>}}{\HCode{</h4>}}
466 \Configure{dopartno}{\HCode{<h4>}}{}
467 \Configure{doptitle}{}{\HCode{</h4>}}
468 \Configure{cpnotice}{\HCode{<h5>}}{\HCode{</h5>}}
469 \Configure{doabstract}{\HCode{<blockquote>}}{\HCode{</blockquote>}}
470 \Configure{dokeywords}{\HCode{<blockquote>}}{\HCode{</blockquote>}}
471 \Configure{docomread}{\HCode{<blockquote>}}{\HCode{</blockquote>}}
472
473 \fi
474 \fi
475
476 % \end{macrocode}
477 % \end{macro}
478 % \end{macro}
479 % \end{macro}
480 % \end{macro}
481 % \end{macro}
482 % \end{macro}
483 % \end{macro}
484 % \end{macro}
485 % \end{macro}
486 % \end{macro}
487 %
488 % \subsubsection{Miscellaneous}
489 %
490 % \begin{macro}{\start:env}
491 % \begin{macro}{\end:env}
492 % Currently these are defined in the \file{html*.4ht} files but they might
493 % dissapear in future, so make sure they are defined.
494 % \begin{macrocode}
495 \:CheckOption{0.0}
496 \if:Option
497 %%%% html0.0
498 \def\start:env#1{}
499 \def\end:env{}
500 \else
501 \CheckOption{3.2}
502 \if:Option
503 %%%% html3.2
504 \def\start:env#1{\IgnorePar\HCode{<\tbl:XV{#1}><tr><td\Hnewline}}
505 \def\end:env{\IgnorePar \end:TTT\ShowPar}
506 \else
507 %%%% html4
508 \def\start:env#1{\IgnorePar\EndP\HCode{<div class="#1"><\tbl:XV{#1}><tr
509 class="#1"><td\Hnewline class="#1">}}
510 \def\end:env{\IgnorePar \end:TTT\HCode{</div>}\ShowPar}
511 \fi
512 \fi
513
514 % \end{macrocode}
515 % \end{macro}
516 % \end{macro}
517 %
518 % \begin{environment}{espec}
519 % \begin{environment}{fspec}
520 % \begin{environment}{rspec}
521 % \begin{environment}{sspec}
522 % \begin{environment}{tspec}
523 % \begin{environment}{dtext}
524 % \begin{environment}{attrlist}
525 % \begin{environment}{fproplist}
526 % \begin{environment}{iproplist}
527 % \begin{environment}{enumlist}
528 % \begin{environment}{arglist}
529 % \begin{environment}{majorsublist}
530 % These are all simple environments, except for |majorsublist| which is
531 % a wrapper for |itemize|.
532 % \begin{macrocode}
533 \:CheckOption{0.0}
534 \if:Option
535 %%%% html0.0
536 \ConfigureEnv{espec}{}{}{}{}
537 \ConfigureEnv{fspec}{}{}{}{}
538 \ConfigureEnv{rspec}{}{}{}{}
539 \ConfigureEnv{sspec}{}{}{}{}
540 \ConfigureEnv{tspec}{}{}{}{}
541 \ConfigureEnv{dtext}{}{}{}{}
542 \ConfigureEnv{attrlist}{}{}{}{}
543 \ConfigureEnv{fproplist}{}{}{}{}
544 \ConfigureEnv{iproplist}{}{}{}{}
545 \ConfigureEnv{enumlist}{}{}{}{}
546 \ConfigureEnv{arglist}{}{}{}{}
547 \ConfigureEnv{majorsublist}{}{}{}{}
548
549 \else
550 \:CheckOption{3.2}
551 \if:Option
552 %%%% html3.2
553 \ConfigureEnv{espec}{\start:env{espec}}{\end:env}{}{}
554 \ConfigureEnv{fspec}{\start:env{fspec}}{\end:env}{}{}
555 \ConfigureEnv{rspec}{\start:env{rspec}}{\end:env}{}{}
556 \ConfigureEnv{sspec}{\start:env{sspec}}{\end:env}{}{}
557 \ConfigureEnv{tspec}{\start:env{tspec}}{\end:env}{}{}
558 \ConfigureEnv{dtext}{\start:env{dtext}}{\end:env}{}{}
559 \ConfigureEnv{attrlist}{\start:env{attrlist}}{\end:env}{}{}
560 \ConfigureEnv{fproplist}{\start:env{fproplist}}{\end:env}{}{}
561 \ConfigureEnv{iproplist}{\start:env{iproplist}}{\end:env}{}{}
562 \ConfigureEnv{enumlist}{\start:env{enumlist}}{\end:env}{}{}
563 \ConfigureEnv{arglist}{\start:env{arglist}}{\end:env}{}{}
564 \ConfigureEnv{majorsublist}{\start:env{majorsublist}}{\end:env}{}{}
565
566 \else
567 %%%% html4.0
568 \ConfigureEnv{espec}{\start:env{espec}}{\end:env}{}{}
569 \ConfigureEnv{fspec}{\start:env{fspec}}{\end:env}{}{}
570 \ConfigureEnv{rspec}{\start:env{rspec}}{\end:env}{}{}
571 \ConfigureEnv{sspec}{\start:env{sspec}}{\end:env}{}{}
572 \ConfigureEnv{tspec}{\start:env{tspec}}{\end:env}{}{}
573 \ConfigureEnv{dtext}{\start:env{dtext}}{\end:env}{}{}
574 \ConfigureEnv{attrlist}{\start:env{attrlist}}{\end:env}{}{}
575 \ConfigureEnv{fproplist}{\start:env{fproplist}}{\end:env}{}{}
576 \ConfigureEnv{iproplist}{\start:env{iproplist}}{\end:env}{}{}
577 \ConfigureEnv{enumlist}{\start:env{enumlist}}{\end:env}{}{}
578 \ConfigureEnv{arglist}{\start:env{arglist}}{\end:env}{}{}
579 \ConfigureEnv{majorsublist}{\start:env{majorsublist}}{\end:env}{}{}
580
581 \fi
582 \fi
583
584 % \end{macrocode}
585 % \end{environment}
586 % \end{environment}
587 % \end{environment}
588 % \end{environment}
589 % \end{environment}
590 % \end{environment}
591 % \end{environment}
592 % \end{environment}
593 % \end{environment}
594 % \end{environment}
595 % \end{environment}
596 % \end{environment}
597 %
598 % \begin{environment}{expdesc}
599 % This is a list environment, similar to the |description| environment,
600 % except that there is a colon after the label.
601 % It is called from within the |...list| environments after a local heading.
602 % \begin{macrocode}
603 \:CheckOption{0.0}
604 \if:Option
605 %%%% html0.0
606 \ConfigureList{expdesc}{}{}{}{}
607
608 \else
609 \:CheckOption{3.2}
610 \if:Option
611 %%%% html3.2
612 \ConfigureList{expdesc}%
613 {\HCode{<dl>}}
614 {\HCode{</dl>}\ShowPar}
615 {\HCode{<dt>\bgroup \bf}
616 {: \egroup\HCode{<dd\Hnewline>}}
617
618 \else
619 %%%% html4.0
620 \ConfigureList{expdesc}%
621 {\EndP\HCode{<dl class="expdesc">}\let\end:itm=\empty}
622 {\EndP\HCode{</dd></dl>}\ShowPar}
623 {\end:itm\def\end:itm{\EndP\Tg</dd>}
624 \HCode{<dt class="expdesc">}\bgroup \bf}
625 {: \egroup\EndP\HCode{</dt><dd\Hnewline class="expdesc">}}
626
627 \fi
628 \fi
629
630 % \end{macrocode}
631 % \end{environment}
632 %
633 % \begin{macrocode}
634 \endinput
635
636 % \end{macrocode}
637 %
638 % The end of the package
639 % \begin{macrocode}
640 %</usc>
641 % \end{macrocode}
642 %
643 % \subsection{Observations}
644 %
645 % There are three main aspects to developing \texht{} code and
646 % configurations for a new package:
647 % \begin{enumerate}
648 % \item Finding out what hooks and configurations are already available.
649 % \item Determining what additional hooks, and where they should be put, for
650 % the new package.
651 % \item Configuring all the hooks.
652 % \end{enumerate}
653 %
654 % \texht{} has added many hooks to the \LaTeX{} kernel and packages
655 % based on kernel code inherit those hooks. I found it advisable to run
656 % a test document with the new package(s) through \texht{} to see what
657 % the result looked like. Depending on the package it may be that
658 % the inherited hooks and configuration are sufficient and nothing needs
659 % to be done.
660 %
661 % For this particular package, only a few new hooks were required,
662 % but it was
663 % necessary in some cases to drastically revamp some of the package code ---
664 % most noticeably for the |\STEPcover| command. Actually, as I am also the
665 % author of the \Lpack{step} package I did have the luxury of being able to
666 % change some of the internal package code to make a better match between the
667 % \LaTeX{} typesetting view of the world and the \texht{} world view.
668 %
669 % There are other packages that, in their turn, use the \Lpack{step}
670 % package and it turned
671 % out that they required no new hooks or changes to the existing
672 % configurations.
673 %
674 % The rest of this section is concerned with item~2, namely
675 % adding hooks.
676 %
677 % \subsubsection{Colon is a letter}
678 %
679 % Within the \texht{} `environment', that is the \file{*.4ht}
680 % files, the colon character (|:|) acts as a letter in a similar manner
681 % as the at character (|@|) does in class and package files; |@| is also
682 % treated as a letter in the environment. Normally, something like
683 % |\start:env{myenv}| would be treated as the command |\start| followed by
684 % the text |:env{myenv}|. In the \texht{} environment it is the command
685 % |\start:env| with the argument |{myenv}|. If any commands like this
686 % occur in the preamble to a \LaTeX{} document, then they must be surrounded
687 % by |\makecolonletter| and |\restorecolon|, which may be defined
688 % as:\footnote{Note that a package may redefine the category code for
689 % the colon, which is why the old value is saved.}
690 % \begin{verbatim}
691 % \chardef\oldcolon=\thecatcode`\:
692 % \newcommand{\makecolonletter}{\catcode`\:11\relax}
693 % \newcommand{\restorecolon}{\catcode`\:=\oldcolon\relax}
694 % \end{verbatim}
695 %
696 % The fact that command names can include a colon means that you have
697 % to be careful in code that includes any colon characters. In \LaTeX,
698 % code like like |{footnote \thefootnote:}| will print the footnote number
699 % immediately followed by a colon (e.g., |footnote 3:|). In the \texht{}
700 % environment you are more likely to get an error message saying that
701 % |\thefootnote:| is undefined! Instead, this needs to be coded as
702 % |{footnote \thefootnote :}|, so that the |\thefootnote| command is ended
703 % by the space before the colon.
704 %
705 % \subsubsection{Adding code and hooks}
706 %
707 % A \LaTeX{} idiom for adding code at the start and/or end of
708 % an existing macro which takes no arguments called, say |\foo|, is:
709 % \begin{verbatim}
710 % \let\oldfoo\foo
711 % \renewcommand{\foo}{new-start-code \oldfoo new-end-code}
712 % \end{verbatim}
713 % Similarly for commands |\baz| and |\biz| which take one and two arguments
714 % respectively:
715 % \begin{verbatim}
716 % \let\oldbaz\baz
717 % \renewcommand{\baz}[1]{new-start-code \oldbaz{#1} new-end-code}
718 % \let\oldbiz\biz
719 % \renewcommand{\biz}[2]{new-start-code \oldbiz{#1}{#2} new-end-code}
720 % \end{verbatim}
721 %
722 % As these kinds of redefinitions are a common occurrence
723 % \file{tex4ht.sty} provides commands that encapsulate the above idiom.
724 % These are |\pend:def\foo{new-start-code}| and
725 % |\append:def\foo{new-end-code}| for when |\foo| is a macro without
726 % arguments, and there are similar commands for prepending and appending
727 % to macros with up to three arguments. Repeating and extending
728 % the \LaTeX{} example,
729 % in the \texht{} environment it could be coded as:
730 % \begin{verbatim}
731 % \pend:def\foo{new-start-code} % \foo has no arguments
732 % \append:def\foo{new-end-code}
733 % \pend:defI\baz{new-start-code} % \baz has one argument
734 % \append:defI\baz{new-end-code}
735 % \pend:defII\biz{new-start-code} % \biz has two arguments
736 % \append:defII\biz{new-end-code}
737 % \pend:defIII\boz{new-start-code} % \boz has three arguments
738 % \append:defIII\boz{new-end-code}
739 % \end{verbatim}
740 %
741 % The definition of a hook in a macro called, say |\buz|, takes
742 % the form |\X:buz| where X is a single letter. For example, adding a
743 % configurable hook
744 % at the start and end of the macro |\baz| can be done like this:
745 % \begin{verbatim}
746 % \pend:defI\baz{\a:baz} % hook at start
747 % \append:defI\baz{\b:baz} % hook at end
748 % \NewConfigure{baz}{2} % declare \baz has two configurable hooks
749 % \end{verbatim}
750 % Note that by default a |\NewConfigure{baz}{2}| command expects the hook
751 % corresponding to the first argument to be |\a:baz| and the hook
752 % corresponding to the second argument to be |\b:baz|. Extending the
753 % example, |\NewConfigure{foo}{9}| will expect the hook corresponding to
754 % the ninth argument to be |\i:foo| (`i' is the ninth letter of the
755 % alphabet). This default setting for |\NewConfigure| has been created via: \\
756 % |\Configure{NewConfigure}{a:}{b:}{c:}{d:}{e:}{f:}{g:}{h:}{i:}| \\
757 % in \file{tex4ht.sty}.
758 %
759 %
760 % As an example for hook insertion, assume a macro defined like: \\
761 % |\newcommand{\mac}[1]{START #1 END}| \\
762 % in which there are four potential places for hooks (call them h1 to h4): \\
763 % |{h1 START h2 #1 h3 END h4}|. Hooks h1 and h4 can be added via |\pend:defI|
764 % and |\append:defI|, but these are not sufficient by themselves. Other
765 % methods are required for inserting all four hooks. Two of these are:
766 % \begin{itemize}
767 % \item Redefine the whole macro from scratch:
768 % \begin{verbatim}
769 % \renewcommand{\mac}[1]{\a:mac START \c:mac #1 \d:mac END \b:mac}
770 % \NewConfigure{mac}{4}
771 % \end{verbatim}
772 %
773 % \item Reuse parts of the original macro
774 % (similar to the \LaTeX{} ap/pre-pending idiom):
775 % \begin{verbatim}
776 % \let\oldmac\mac
777 % \renewcommand{\mac}[1]{\a:mac\oldmac{\c:mac #1 \d:mac}\b:mac}
778 % \NewConfigure{mac}{4}
779 % \end{verbatim}
780 % \end{itemize}
781 % Either of these examples can be configured via:
782 % \begin{verbatim}
783 % \Configure{mac}%
784 % {first arg for a hook} % \a:mac at the start of the command
785 % {second arg for a hook} % \b:mac at the end of the command
786 % {third arg for a hook} % \c:mac immediately before the argument
787 % {fourth arg for a hook} % \d:mac immediately after the argument
788 % \end{verbatim}
789 % Note that the hooks do not have to be placed in the |\mac| command in
790 % alphabetical order.
791 %
792 %
793 %
794 %
795 % \bibliographystyle{alpha}
796 %
797 % \begin{thebibliography}{GMS94}
798 %
799 % \bibitem[GMS94]{GOOSSENS94}
800 % Michel Goossens, Frank Mittelbach, and Alexander Samarin.
801 % \newblock \textit{The LaTeX Companion}.
802 % \newblock Addison-Wesley Publishing Company, 1994.
803 %
804 % \bibitem[GR99]{GOOSSENS99}
805 % Michel Goossens and Sebastian Rahtz
806 % (with Eitan Gurari, Ross Moore, and Robert Sutor).
807 % \newblock \textit{The LaTeX Web Companion --- Integrating TeX, HTML, and XML}.
808 % \newblock Addison-Wesley Publishing Company, 1999.
809 %
810 % \bibitem[Wil96]{PRW96i}
811 % Peter~R. Wilson.
812 % \newblock \textit{{LaTeX for standards: The LaTeX package files user manual}}.
813 % \newblock NIST Report NISTIR, June 1996.
814 %
815 % \end{thebibliography}
816 %
817 %
818 % \Finale
819 % \PrintIndex
820 %
821 \endinput
822
823 %% \CharacterTable
824 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
825 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
826 %% Digits \0\1\2\3\4\5\6\7\8\9
827 %% Exclamation \! Double quote \" Hash (number) \#
828 %% Dollar \$ Percent \% Ampersand \&
829 %% Acute accent \' Left paren \( Right paren \)
830 %% Asterisk \* Plus \+ Comma \,
831 %% Minus \- Point \. Solidus \/
832 %% Colon \: Semicolon \; Less than \<
833 %% Equals \= Greater than \> Question mark \?
834 %% Commercial at \@ Left bracket \[ Backslash \\
835 %% Right bracket \] Circumflex \^ Underscore \_
836 %% Grave accent \` Left brace \{ Vertical bar \|
837 %% Right brace \} Tilde \~}
838
839