Index: trunk/doc/latex/html.sty
===================================================================
--- trunk/doc/latex/html.sty	(revision 26149)
+++ trunk/doc/latex/html.sty	(revision 26149)
@@ -0,0 +1,1083 @@
+%
+% $Id: html.sty,v 1.1 2006/02/14 22:30:19 isani Exp $
+% LaTeX2HTML Version 99.1 : html.sty
+% 
+% This file contains definitions of LaTeX commands which are
+% processed in a special way by the translator. 
+% For example, there are commands for embedding external hypertext links,
+% for cross-references between documents or for including raw HTML.
+% This file includes the comments.sty file v2.0 by Victor Eijkhout
+% In most cases these commands do nothing when processed by LaTeX.
+%
+% Place this file in a directory accessible to LaTeX (i.e., somewhere
+% in the TEXINPUTS path.)
+%
+% NOTE: This file works with LaTeX 2.09 or (the newer) LaTeX2e.
+%       If you only have LaTeX 2.09, some complex LaTeX2HTML features
+%       like support for segmented documents are not available.
+
+% Changes:
+% See the change log at end of file.
+
+
+% Exit if the style file is already loaded
+% (suggested by Lee Shombert <las@potomac.wash.inmet.com>
+\ifx \htmlstyloaded\relax \endinput\else\let\htmlstyloaded\relax\fi
+\makeatletter
+
+% protect against the hyperref package being loaded already
+
+\ifx\undefined\hyperref
+ \let\html@new=\newcommand
+\else
+ \let\html@new=\renewcommand
+\fi
+
+\providecommand{\latextohtml}{\LaTeX2\texttt{HTML}}
+
+%%% LINKS TO EXTERNAL DOCUMENTS
+%
+% This can be used to provide links to arbitrary documents.
+% The first argumment should be the text that is going to be
+% highlighted and the second argument a URL.
+% The hyperlink will appear as a hyperlink in the HTML 
+% document and as a footnote in the dvi or ps files.
+%
+\html@new{\htmladdnormallinkfoot}[2]{#1\footnote{#2}} 
+
+
+% This is an alternative definition of the command above which
+% will ignore the URL in the dvi or ps files.
+\html@new{\htmladdnormallink}[2]{#1}
+
+
+% This command takes as argument a URL pointing to an image.
+% The image will be embedded in the HTML document but will
+% be ignored in the dvi and ps files.
+%
+\html@new{\htmladdimg}[1]{}
+
+
+%%% CROSS-REFERENCES BETWEEN (LOCAL OR REMOTE) DOCUMENTS
+%
+% This can be used to refer to symbolic labels in other Latex 
+% documents that have already been processed by the translator.
+% The arguments should be:
+% #1 : the URL to the directory containing the external document
+% #2 : the path to the labels.pl file of the external document.
+% If the external document lives on a remote machine then labels.pl 
+% must be copied on the local machine.
+%
+%e.g. \externallabels{http://cbl.leeds.ac.uk/nikos/WWW/doc/tex2html/latex2html}
+%                    {/usr/cblelca/nikos/tmp/labels.pl}
+% The arguments are ignored in the dvi and ps files.
+%
+\newcommand{\externallabels}[2]{}
+
+
+% This complements the \externallabels command above. The argument
+% should be a label defined in another latex document and will be
+% ignored in the dvi and ps files.
+%
+\newcommand{\externalref}[1]{}
+
+
+% Suggested by  Uffe Engberg (http://www.brics.dk/~engberg/)
+% This allows the same effect for citations in external bibliographies.
+% An  \externallabels  command must be given, locating a labels.pl file
+% which defines the location and keys used in the external .html file.
+%  
+\newcommand{\externalcite}{\nocite}
+
+% This allows a section-heading in the TOC or mini-TOC to be just
+% a hyperlink to an external document.
+%
+%   \htmladdTOClink[<path_to_labels>]{<section-level>}{<title>}{<URL>}
+% where <section-level> is  'chapter' , 'section' , 'subsection' etc.
+% and <path_to_labels> is the path to find a  labels.pl  file,
+% so that external cross-referencing may work, as with \externallabels
+%
+\newcommand{\htmladdTOClink}[4][]{}
+
+
+%%% HTMLRULE
+% This command adds a horizontal rule and is valid even within
+% a figure caption.
+% Here we introduce a stub for compatibility.
+\newcommand{\htmlrule}{\protect\HTMLrule}
+\newcommand{\HTMLrule}{\@ifstar\htmlrulestar\htmlrulestar}
+\newcommand{\htmlrulestar}[1]{}
+
+%%% HTMLCLEAR
+% This command puts in a <BR> tag, with CLEAR="ALL"
+\newcommand{\htmlclear}{}
+
+% This command adds information within the <BODY> ... </BODY> tag
+%
+\newcommand{\bodytext}[1]{}
+\newcommand{\htmlbody}{}
+
+
+%%% HYPERREF 
+% Suggested by Eric M. Carol <eric@ca.utoronto.utcc.enfm>
+% Similar to \ref but accepts conditional text. 
+% The first argument is HTML text which will become ``hyperized''
+% (underlined).
+% The second and third arguments are text which will appear only in the paper
+% version (DVI file), enclosing the fourth argument which is a reference to a label.
+%
+%e.g. \hyperref{using the tracer}{using the tracer (see Section}{)}{trace}
+% where there is a corresponding \label{trace}
+%
+% avoid possible confict with  hyperref  package
+\ifx\undefined\hyperref
+ \newcommand{\hyperrefhyper}[4]{#4}%
+ \def\next{\newcommand}%
+\else
+ \let\hyperrefhyper\hyperref
+ \def\next{\renewcommand}%
+\fi
+\next{\hyperref}{\hyperrefi[]}\let\next=\relax
+
+\def\hyperrefi[#1]{{\def\next{#1}\def\tmp{}%
+ \ifx\next\tmp\aftergroup\hyperrefdef
+ \else\def\tmp{ref}\ifx\next\tmp\aftergroup\hyperrefref
+ \else\def\tmp{pageref}\ifx\next\tmp\aftergroup\hyperrefpageref
+ \else\def\tmp{page}\ifx\next\tmp\aftergroup\hyperrefpage
+ \else\def\tmp{noref}\ifx\next\tmp\aftergroup\hyperrefnoref
+ \else\def\tmp{no}\ifx\next\tmp\aftergroup\hyperrefno
+ \else\def\tmp{hyper}\ifx\next\tmp\aftergroup\hyperrefhyper
+ \else\def\tmp{html}\ifx\next\tmp\aftergroup\hyperrefhtml
+ \else\typeout{*** unknown option \next\space to  hyperref ***}%
+ \fi\fi\fi\fi\fi\fi\fi\fi}}
+\newcommand{\hyperrefdef}[4]{#2\ref{#4}#3}
+\newcommand{\hyperrefpageref}[4]{#2\pageref{#4}#3}
+\newcommand{\hyperrefnoref}[3]{#2}
+\let\hyperrefref=\hyperrefdef
+\let\hyperrefpage=\hyperrefpageref
+\let\hyperrefno=\hyperrefnoref
+\ifx\undefined\hyperrefhyper\newcommand{\hyperrefhyper}[4]{#4}\fi
+\let\hyperrefhtml=\hyperrefdef
+
+%%% HYPERCITE --- added by RRM
+% Suggested by Stephen Simpson <simpson@math.psu.edu>
+% effects the same ideas as in  \hyperref, but for citations.
+% It does not allow an optional argument to the \cite, in LaTeX.
+%
+%   \hypercite{<html-text>}{<LaTeX-text>}{<opt-text>}{<key>}
+%
+% uses the pre/post-texts in LaTeX, with a  \cite{<key>}
+%
+%   \hypercite[ext]{<html-text>}{<LaTeX-text>}{<key>}
+%   \hypercite[ext]{<html-text>}{<LaTeX-text>}[<prefix>]{<key>}
+%
+% uses the pre/post-texts in LaTeX, with a  \nocite{<key>}
+% the actual reference comes from an \externallabels  file.
+%
+\newcommand{\hypercite}{\hypercitei[]}
+\def\hypercitei[#1]{{\def\next{#1}\def\tmp{}%
+ \ifx\next\tmp\aftergroup\hypercitedef
+ \else\def\tmp{int}\ifx\next\tmp\aftergroup\hyperciteint
+ \else\def\tmp{cite}\ifx\next\tmp\aftergroup\hypercitecite
+ \else\def\tmp{ext}\ifx\next\tmp\aftergroup\hyperciteext
+ \else\def\tmp{nocite}\ifx\next\tmp\aftergroup\hypercitenocite
+ \else\def\tmp{no}\ifx\next\tmp\aftergroup\hyperciteno
+ \else\typeout{*** unknown option \next\space to  hypercite ***}%
+ \fi\fi\fi\fi\fi\fi}}
+\newcommand{\hypercitedef}[4]{#2{\def\tmp{#3}\def\emptyopt{}%
+ \ifx\tmp\emptyopt\cite{#4}\else\cite[#3]{#4}\fi}}
+\newcommand{\hypercitenocite}[2]{#2\hypercitenocitex[]}
+\def\hypercitenocitex[#1]#2{\nocite{#2}}
+\let\hypercitecite=\hypercitedef
+\let\hyperciteint=\hypercitedef
+\let\hyperciteext=\hypercitenocite
+\let\hyperciteno=\hypercitenocite
+
+%%% HTMLREF
+% Reference in HTML version only.
+% Mix between \htmladdnormallink and \hyperref.
+% First arg is text for in both versions, second is label for use in HTML
+% version.
+\html@new{\htmlref}[2]{#1}
+
+%%% HTMLCITE
+% Reference in HTML version only.
+% Mix between \htmladdnormallink and \hypercite.
+% First arg is text for in both versions, second is citation for use in HTML
+% version.
+\newcommand{\htmlcite}[2]{#1}
+
+
+%%% HTMLIMAGE
+% This command can be used inside any environment that is converted
+% into an inlined image (eg a "figure" environment) in order to change
+% the way the image will be translated. The argument of \htmlimage
+% is really a string of options separated by commas ie 
+% [scale=<scale factor>],[external],[thumbnail=<reduction factor>
+% The scale option allows control over the size of the final image.
+% The ``external'' option will cause the image not to be inlined 
+% (images are inlined by default). External images will be accessible
+% via a hypertext link. 
+% The ``thumbnail'' option will cause a small inlined image to be 
+% placed in the caption. The size of the thumbnail depends on the
+% reduction factor. The use of the ``thumbnail'' option implies
+% the ``external'' option.
+%
+% Example:
+% \htmlimage{scale=1.5,external,thumbnail=0.2}
+% will cause a small thumbnail image 1/5th of the original size to be
+% placed in the final document, pointing to an external image 1.5
+% times bigger than the original.
+% 
+\newcommand{\htmlimage}[1]{}
+
+
+% \htmlborder causes a border to be placed around an image or table
+% when the image is placed within a <TABLE> cell.
+\newcommand{\htmlborder}[1]{}
+
+% Put \begin{makeimage}, \end{makeimage} around LaTeX to ensure its
+% translation into an image.
+% This shields sensitive text from being translated.
+\newenvironment{makeimage}{}{}
+
+
+% A dummy environment that can be useful to alter the order
+% in which commands are processed, in LaTeX2HTML
+\newenvironment{tex2html_deferred}{}{}
+
+
+%%% HTMLADDTONAVIGATION
+% This command appends its argument to the buttons in the navigation
+% panel. It is ignored by LaTeX.
+%
+% Example:
+% \htmladdtonavigation{\htmladdnormallink
+%              {\htmladdimg{http://server/path/to/gif}}
+%              {http://server/path}}
+\newcommand{\htmladdtonavigation}[1]{}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% based upon Eijkhout's  comment.sty v2.0
+% with modifications to avoid conflicts with later versions
+% of this package, should a user be requiring it.
+%	Ross Moore,  10 March 1999
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Comment.sty   version 2.0, 19 June 1992
+% selectively in/exclude pieces of text: the user can define new
+% comment versions, and each is controlled separately.
+% This style can be used with plain TeX or LaTeX, and probably
+% most other packages too.
+%
+% Examples of use in LaTeX and TeX follow \endinput
+%
+% Author
+%    Victor Eijkhout
+%    Department of Computer Science
+%    University Tennessee at Knoxville
+%    104 Ayres Hall
+%    Knoxville, TN 37996
+%    USA
+%
+%    eijkhout@cs.utk.edu
+%
+% Usage: all text included in between
+%    \comment ... \endcomment
+% or \begin{comment} ... \end{comment}
+% is discarded. The closing command should appear on a line
+% of its own. No starting spaces, nothing after it.
+% This environment should work with arbitrary amounts
+% of comment.
+%
+% Other 'comment' environments are defined by
+% and are selected/deselected with
+% \includecomment{versiona}
+% \excludecoment{versionb}
+%
+% These environments are used as
+% \versiona ... \endversiona
+% or \begin{versiona} ... \end{versiona}
+% with the closing command again on a line of its own.
+%
+% Basic approach:
+% to comment something out, scoop up  every line in verbatim mode
+% as macro argument, then throw it away.
+% For inclusions, both the opening and closing comands
+% are defined as noop
+%
+% Changed \next to \html@next to prevent clashes with other sty files
+% (mike@emn.fr)
+% Changed \html@next to \htmlnext so the \makeatletter and
+% \makeatother commands could be removed (they were causing other
+% style files - changebar.sty - to crash) (nikos@cbl.leeds.ac.uk)
+% Changed \htmlnext back to \html@next...
+
+\def\makeinnocent#1{\catcode`#1=12 }
+\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
+
+\def\ThrowAwayComment#1{\begingroup
+    \def\CurrentComment{#1}%
+    \let\do\makeinnocent \dospecials
+    \makeinnocent\^^L% and whatever other special cases
+%%RRM
+%%  use \xhtmlComment for \xComment
+%%  use \html@next    for \next
+    \endlinechar`\^^M \catcode`\^^M=12 \xhtmlComment}
+{\catcode`\^^M=12 \endlinechar=-1 %
+ \gdef\xhtmlComment#1^^M{\def\test{#1}\edef\test{\meaning\test}
+      \csarg\ifx{PlainEnd\CurrentComment Test}\test
+          \let\html@next\endgroup
+      \else \csarg\ifx{LaLaEnd\CurrentComment Test}\test
+            \edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
+      \else \csarg\ifx{LaInnEnd\CurrentComment Test}\test
+            \edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
+      \else \let\html@next\xhtmlComment
+      \fi \fi \fi \html@next}
+}
+
+%%\def\includecomment	%%RRM
+\def\htmlincludecomment
+ #1{\expandafter\def\csname#1\endcsname{}%
+    \expandafter\def\csname end#1\endcsname{}}
+%%\def\excludecomment	%%RRM
+\def\htmlexcludecomment
+ #1{\expandafter\def\csname#1\endcsname{\ThrowAwayComment{#1}}%
+    {\escapechar=-1\relax
+     \edef\tmp{\string\\end#1}%
+      \csarg\xdef{PlainEnd#1Test}{\meaning\tmp}%
+     \edef\tmp{\string\\end\string\{#1\string\}}%
+      \csarg\xdef{LaLaEnd#1Test}{\meaning\tmp}%
+     \edef\tmp{\string\\end \string\{#1\string\}}%
+      \csarg\xdef{LaInnEnd#1Test}{\meaning\tmp}%
+    }}
+
+%%\excludecomment{comment}	%%RRM
+\htmlexcludecomment{comment}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% end Comment.sty
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\let\includecomment=\htmlincludecomment
+\let\excludecomment=\htmlexcludecomment
+
+%
+% Alternative code by Robin Fairbairns, 22 September 1997
+% revised to cope with % and unnested { }, by Ross Moore, 4 July 1998
+% further revised to cope with & and # in tables, 10 March 1999
+%
+\def\raw@catcodes{\catcode`\%=12 \catcode`\{=12 \catcode`\}=12
+ \catcode`\&=12 \catcode`\#=12 }
+\newcommand\@gobbleenv{\bgroup\raw@catcodes
+ \let\reserved@a\@currenvir\@gobble@nv}
+\bgroup
+ \def\expansionhead{\gdef\@gobble@nv@i##1}
+ \def\expansiontail{{\def\reserved@b{##1}\@gobble@nv@ii}}
+ \def\expansionheadii{\long\gdef\@gobble@nv##1\end}
+ \def\expansiontailii{{\@gobble@nv@i}}
+ \def\expansionmidii{##2}
+ \raw@catcodes\relax
+ \expandafter\expansionhead\expandafter}\expansiontail
+\egroup
+\long\gdef\@gobble@nv#1\end#2{\@gobble@nv@i}
+%\long\def\@gobble@nv#1\end#2{\def\reserved@b{#2}%
+\def\@gobble@nv@ii{%
+ \ifx\reserved@a\reserved@b
+  \edef\reserved@a{\egroup\noexpand\end{\reserved@a}}%
+  \expandafter\reserved@a
+ \else
+  \expandafter\@gobble@nv
+ \fi}
+
+\renewcommand{\htmlexcludecomment}[1]{%
+    \csname newenvironment\endcsname{#1}{\@gobbleenv}{}}
+\newcommand{\htmlreexcludecomment}[1]{%
+    \csname renewenvironment\endcsname{#1}{\@gobbleenv}{}}
+
+%%% RAW HTML 
+% 
+% Enclose raw HTML between a \begin{rawhtml} and \end{rawhtml}.
+% The html environment ignores its body
+%
+\htmlexcludecomment{rawhtml}
+
+
+%%% HTML ONLY
+%
+% Enclose LaTeX constructs which will only appear in the 
+% HTML output and will be ignored by LaTeX with 
+% \begin{htmlonly} and \end{htmlonly}
+%
+\htmlexcludecomment{htmlonly}
+% Shorter version
+\newcommand{\html}[1]{}
+
+% for images.tex only
+\htmlexcludecomment{imagesonly}
+
+%%% LaTeX ONLY
+% Enclose LaTeX constructs which will only appear in the 
+% DVI output and will be ignored by latex2html with 
+%\begin{latexonly} and \end{latexonly}
+%
+\newenvironment{latexonly}{}{}
+% Shorter version
+\newcommand{\latex}[1]{#1}
+
+
+%%% LaTeX or HTML
+% Combination of \latex and \html.
+% Say \latexhtml{this should be latex text}{this html text}
+%
+%\newcommand{\latexhtml}[2]{#1}
+\long\def\latexhtml#1#2{#1}
+
+
+%%% tracing the HTML conversions
+% This alters the tracing-level within the processing
+% performed by  latex2html  by adjusting  $VERBOSITY
+% (see  latex2html.config  for the appropriate values)
+%
+\newcommand{\htmltracing}[1]{}
+\newcommand{\htmltracenv}[1]{}
+
+
+%%%  \strikeout for HTML only
+% uses <STRIKE>...</STRIKE> tags on the argument
+% LaTeX just gobbles it up.
+\newcommand{\strikeout}[1]{}
+
+%%%  \htmlurl  and  \url
+%  implement \url as the simplest thing, if not already defined
+%  let \htmlurl#1  be equivalent to it 
+%
+\def\htmlurlx#1{\begin{small}\texttt{#1}\end{small}}%
+\expandafter\ifx\csname url\endcsname\relax
+ \let\htmlurl=\htmlurlx \else \let\htmlurl=\url \fi
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% JCL - stop input here if LaTeX2e is not present
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifx\if@compatibility\undefined
+  %LaTeX209
+  \makeatother\relax\expandafter\endinput
+\fi
+\if@compatibility
+  %LaTeX2e in LaTeX209 compatibility mode
+  \makeatother\relax\expandafter\endinput
+\fi
+
+%\let\real@TeXlogo = \TeX
+%\DeclareRobustCommand{\TeX}{\relax\real@TeXlogo}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Start providing LaTeX2e extension:
+% This is currently:
+%  - additional optional argument for \htmladdimg
+%  - support for segmented documents
+%
+
+%\ProvidesPackage{html}
+%          [1996/12/22 v1.1 hypertext commands for latex2html (nd, hws, rrm)]
+\ProvidesPackage{html}
+          [1999/03/12 v1.37 hypertext commands for latex2html (nd, hws, rrm)]
+
+%
+% Ensure that \includecomment and \excludecomment are bound
+% to the version defined here.
+%
+\AtBeginDocument{%
+ \let\includecomment=\htmlincludecomment
+ \let\excludecomment=\htmlexcludecomment
+ \htmlreexcludecomment{comment}}
+
+%%%  bind \htmlurl to \url if that is later loaded
+%
+\expandafter\ifx\csname url\endcsname\relax
+ \AtBeginDocument{\@ifundefined{url}{}{\let\htmlurl=\url}}\fi
+
+%%%%MG
+
+% This command takes as argument a URL pointing to an image.
+% The image will be embedded in the HTML document but will
+% be ignored in the dvi and ps files.  The optional argument
+% denotes additional HTML tags.
+%
+% Example:  \htmladdimg[ALT="portrait" ALIGN=CENTER]{portrait.gif}
+%
+\renewcommand{\htmladdimg}[2][]{}
+
+%%% HTMLRULE for LaTeX2e
+% This command adds a horizontal rule and is valid even within
+% a figure caption.
+%
+% This command is best used with LaTeX2e and HTML 3.2 support.
+% It is like \hrule, but allows for options via key--value pairs
+% as follows:  \htmlrule[key1=value1, key2=value2, ...] .
+% Use \htmlrule* to suppress the <BR> tag.
+% Eg. \htmlrule[left, 15, 5pt, "none", NOSHADE] produces
+% <BR CLEAR="left"><HR NOSHADE SIZE="15">.
+% Renew the necessary part.
+\renewcommand{\htmlrulestar}[1][all]{}
+
+%%% HTMLCLEAR for LaTeX2e
+% This command puts in a <BR> tag, with optional CLEAR="<attrib>"
+%
+\renewcommand{\htmlclear}[1][all]{}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  renew some definitions to allow optional arguments
+%
+% The description of the options is missing, as yet.
+%
+\renewcommand{\latextohtml}{\textup{\LaTeX2\texttt{HTML}}}
+\renewcommand{\htmladdnormallinkfoot}[3][]{#2\footnote{#3}} 
+\renewcommand{\htmladdnormallink}[3][]{#2}
+\renewcommand{\htmlbody}[1][]{}
+\renewcommand{\externallabels}[3][]{}
+\renewcommand{\externalref}[2][]{}
+\renewcommand{\externalcite}[1][]{\nocite}
+\renewcommand{\hyperref}[1][]{\hyperrefi[#1]}
+\renewcommand{\hypercite}[1][]{\hypercitei[#1]}
+\renewcommand{\hypercitenocite}[2]{#2\hypercitenocitex}
+\renewcommand{\hypercitenocitex}[2][]{\nocite{#2}}
+\let\hyperciteno=\hypercitenocite
+\let\hyperciteext=\hypercitenocite
+\renewcommand{\htmlref}[2][]{#2{\def\tmp{#1}\ifx\tmp\@empty
+ \aftergroup\htmlrefdef\else\aftergroup\htmlrefext\fi}}
+\newcommand{\htmlrefdef}[1]{}
+\newcommand{\htmlrefext}[2][]{}
+\renewcommand{\htmlcite}[2][]{#2{\def\tmp{#1}\ifx\tmp\@empty
+ \aftergroup\htmlcitedef\else\aftergroup\htmlciteext\fi}}
+\newcommand{\htmlcitedef}[1]{ \nocite{#1}}
+\newcommand{\htmlciteext}[2][]{}
+\renewcommand{\htmlimage}[2][]{}
+\renewcommand{\htmlborder}[2][]{}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  HTML  HTMLset  HTMLsetenv
+%
+%  These commands do nothing in LaTeX, but can be used to place
+%  HTML tags or set Perl variables during the LaTeX2HTML processing;
+%  They are intended for expert use only.
+
+\newcommand{\HTMLcode}[2][]{}
+\ifx\undefined\HTML\newcommand{\HTML}[2][]{}\else
+\typeout{*** Warning: \string\HTML\space had an incompatible definition ***}%
+\typeout{*** instead use \string\HTMLcode\space for raw HTML code ***}%
+\fi 
+\newcommand{\HTMLset}[3][]{}
+\newcommand{\HTMLsetenv}[3][]{}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The following commands pertain to document segmentation, and
+% were added by Herbert Swan <dprhws@edp.Arco.com> (with help from
+% Michel Goossens <goossens@cern.ch>):
+%
+%
+% This command inputs internal latex2html tables so that large
+% documents can to partitioned into smaller (more manageable)
+% segments.
+%
+\newcommand{\internal}[2][internals]{}
+
+%
+%  Define a dummy stub \htmlhead{}.  This command causes latex2html
+%  to define the title of the start of a new segment.  It is not
+%  normally placed in the user's document.  Rather, it is passed to
+%  latex2html via a .ptr file written by \segment.
+%
+\newcommand{\htmlhead}[3][]{}
+
+%  In the LaTeX2HTML version this will eliminate the title line
+%  generated by a \segment command, but retains the title string
+%  for use in other places.
+%
+\newcommand{\htmlnohead}{}
+
+
+%  In the LaTeX2HTML version this put a URL into a <BASE> tag
+%  within the <HEAD>...</HEAD> portion of a document.
+%
+\newcommand{\htmlbase}[1]{}
+
+
+%  Include style information into the stylesheet; e.g. CSS
+%
+\newcommand{\htmlsetstyle}[3][]{}
+\newcommand{\htmladdtostyle}[3][]{}
+
+%  Define a style-class for information in a particular language
+%
+\newcommand{\htmllanguagestyle}[2][]{}
+
+
+%
+%  The dummy command \endpreamble is needed by latex2html to
+%  mark the end of the preamble in document segments that do
+%  not contain a \begin{document}
+%
+\newcommand{\startdocument}{}
+
+
+% \tableofchildlinks, \htmlinfo
+%     by Ross Moore  ---  extensions dated 27 September 1997
+%
+%  These do nothing in LaTeX but for LaTeX2HTML they mark 
+%  where the table of child-links and info-page should be placed,
+%  when the user wants other than the default.
+%	\tableofchildlinks	 % put mini-TOC at this location
+%	\tableofchildlinks[off]	 % not on current page
+%	\tableofchildlinks[none] % not on current and subsequent pages
+%	\tableofchildlinks[on]   % selectively on current page
+%	\tableofchildlinks[all]  % on current and all subsequent pages
+%	\htmlinfo	 	 % put info-page at this location
+%	\htmlinfo[off]		 % no info-page in current document
+%	\htmlinfo[none]		 % no info-page in current document
+%  *-versions omit the preceding <BR> tag.
+%
+\newcommand{\tableofchildlinks}{%
+  \@ifstar\tableofchildlinksstar\tableofchildlinksstar}
+\newcommand{\tableofchildlinksstar}[1][]{}
+
+\newcommand{\htmlinfo}{\@ifstar\htmlinfostar\htmlinfostar}
+\newcommand{\htmlinfostar}[1][]{}
+
+
+%  This redefines  \begin  to allow for an optional argument
+%  which is used by LaTeX2HTML to specify `style-sheet' information
+
+\let\realLaTeX@begin=\begin
+\renewcommand{\begin}[1][]{\realLaTeX@begin}
+
+
+%
+%  Allocate a new set of section counters, which will get incremented
+%  for "*" forms of sectioning commands, and for a few miscellaneous
+%  commands.
+%
+
+\@ifundefined{c@part}{\newcounter{part}}{}%
+\newcounter{lpart}
+\newcounter{lchapter}[part]
+\@ifundefined{c@chapter}%
+ {\let\Hchapter\relax \newcounter{chapter}\newcounter{lsection}[part]}%
+ {\let\Hchapter=\chapter \newcounter{lsection}[chapter]}
+\newcounter{lsubsection}[section]
+\newcounter{lsubsubsection}[subsection]
+\newcounter{lparagraph}[subsubsection]
+\newcounter{lsubparagraph}[paragraph]
+%\newcounter{lequation}
+
+%
+%  Redefine "*" forms of sectioning commands to increment their
+%  respective counters.
+%
+\let\Hpart=\part
+%\let\Hchapter=\chapter
+\let\Hsection=\section
+\let\Hsubsection=\subsection
+\let\Hsubsubsection=\subsubsection
+\let\Hparagraph=\paragraph
+\let\Hsubparagraph=\subparagraph
+\let\Hsubsubparagraph=\subsubparagraph
+
+\ifx\c@subparagraph\undefined
+ \newcounter{lsubsubparagraph}[lsubparagraph]
+\else
+ \newcounter{lsubsubparagraph}[subparagraph]
+\fi
+
+%
+%  The following definitions are specific to LaTeX2e:
+%  (They must be commented out for LaTeX 2.09)
+%
+\expandafter\ifx\csname part\endcsname\relax\else
+\renewcommand{\part}{\@ifstar{\stepcounter{lpart}%
+  \bgroup\def\tmp{*}\H@part}{\bgroup\def\tmp{}\H@part}}\fi
+\newcommand{\H@part}[1][]{\def\tmp@a{#1}\check@align
+ \expandafter\egroup\expandafter\Hpart\tmp}
+
+\ifx\Hchapter\relax\else
+ \def\chapter{\resetsections \@ifstar{\stepcounter{lchapter}%
+   \bgroup\def\tmp{*}\H@chapter}{\bgroup\def\tmp{}\H@chapter}}\fi
+\newcommand{\H@chapter}[1][]{\def\tmp@a{#1}\check@align
+ \expandafter\egroup\expandafter\Hchapter\tmp}
+
+\renewcommand{\section}{\resetsubsections
+ \@ifstar{\stepcounter{lsection}\bgroup\def\tmp{*}%
+   \H@section}{\bgroup\def\tmp{}\H@section}}
+\newcommand{\H@section}[1][]{\def\tmp@a{#1}\check@align
+ \expandafter\egroup\expandafter\Hsection\tmp}
+
+\renewcommand{\subsection}{\resetsubsubsections
+ \@ifstar{\stepcounter{lsubsection}\bgroup\def\tmp{*}%
+   \H@subsection}{\bgroup\def\tmp{}\H@subsection}}
+\newcommand{\H@subsection}[1][]{\def\tmp@a{#1}\check@align
+ \expandafter\egroup\expandafter\Hsubsection\tmp}
+
+\renewcommand{\subsubsection}{\resetparagraphs
+ \@ifstar{\stepcounter{lsubsubsection}\bgroup\def\tmp{*}%
+   \H@subsubsection}{\bgroup\def\tmp{}\H@subsubsection}}
+\newcommand{\H@subsubsection}[1][]{\def\tmp@a{#1}\check@align
+ \expandafter\egroup\expandafter\Hsubsubsection\tmp}
+
+\renewcommand{\paragraph}{\resetsubparagraphs
+ \@ifstar{\stepcounter{lparagraph}\bgroup\def\tmp{*}%
+   \H@paragraph}{\bgroup\def\tmp{}\H@paragraph}}
+\newcommand\H@paragraph[1][]{\def\tmp@a{#1}\check@align
+ \expandafter\egroup\expandafter\Hparagraph\tmp}
+
+\ifx\Hsubparagraph\relax\else\@ifundefined{subparagraph}{}{%
+\renewcommand{\subparagraph}{\resetsubsubparagraphs
+ \@ifstar{\stepcounter{lsubparagraph}\bgroup\def\tmp{*}%
+   \H@subparagraph}{\bgroup\def\tmp{}\H@subparagraph}}}\fi
+\newcommand\H@subparagraph[1][]{\def\tmp@a{#1}\check@align
+ \expandafter\egroup\expandafter\Hsubparagraph\tmp}
+
+\ifx\Hsubsubparagraph\relax\else\@ifundefined{subsubparagraph}{}{%
+\def\subsubparagraph{%
+ \@ifstar{\stepcounter{lsubsubparagraph}\bgroup\def\tmp{*}%
+   \H@subsubparagraph}{\bgroup\def\tmp{}\H@subsubparagraph}}}\fi
+\newcommand\H@subsubparagraph[1][]{\def\tmp@a{#1}\check@align
+ \expandafter\egroup\expandafter\Hsubsubparagraph\tmp}
+
+\def\check@align{\def\empty{}\ifx\tmp@a\empty
+ \else\def\tmp@b{center}\ifx\tmp@a\tmp@b\let\tmp@a\empty
+ \else\def\tmp@b{left}\ifx\tmp@a\tmp@b\let\tmp@a\empty
+ \else\def\tmp@b{right}\ifx\tmp@a\tmp@b\let\tmp@a\empty
+ \else\expandafter\def\expandafter\tmp@a\expandafter{\expandafter[\tmp@a]}%
+ \fi\fi\fi \def\empty{}\ifx\tmp\empty\let\tmp=\tmp@a \else 
+  \expandafter\def\expandafter\tmp\expandafter{\expandafter*\tmp@a}%
+ \fi\fi}
+%
+\def\resetsections{\setcounter{section}{0}\setcounter{lsection}{0}%
+ \reset@dependents{section}\resetsubsections }
+\def\resetsubsections{\setcounter{subsection}{0}\setcounter{lsubsection}{0}%
+ \reset@dependents{subsection}\resetsubsubsections }
+\def\resetsubsubsections{\setcounter{subsubsection}{0}\setcounter{lsubsubsection}{0}%
+ \reset@dependents{subsubsection}\resetparagraphs }
+%
+\def\resetparagraphs{\setcounter{lparagraph}{0}\setcounter{lparagraph}{0}%
+ \reset@dependents{paragraph}\resetsubparagraphs }
+\def\resetsubparagraphs{\ifx\c@subparagraph\undefined\else
+  \setcounter{subparagraph}{0}\fi \setcounter{lsubparagraph}{0}%
+ \reset@dependents{subparagraph}\resetsubsubparagraphs }
+\def\resetsubsubparagraphs{\ifx\c@subsubparagraph\undefined\else
+  \setcounter{subsubparagraph}{0}\fi \setcounter{lsubsubparagraph}{0}}
+%
+\def\reset@dependents#1{\begingroup\let \@elt \@stpelt
+ \csname cl@#1\endcsname\endgroup}
+%
+%
+%  Define a helper macro to dump a single \secounter command to a file.
+%
+\newcommand{\DumpPtr}[2]{%
+\count255=\arabic{#1}\def\dummy{dummy}\def\tmp{#2}%
+\ifx\tmp\dummy\def\ctr{#1}\else
+ \def\ctr{#2}\advance\count255 by \arabic{#2}\fi
+\immediate\write\ptrfile{%
+\noexpand\setcounter{\ctr}{\number\count255}}}
+%\expandafter\noexpand\expandafter\setcounter\expandafter{\ctr}{\number\count255}}}
+
+%
+%  Define a helper macro to dump all counters to the file.
+%  The value for each counter will be the sum of the l-counter
+%      actual LaTeX section counter.
+%  Also dump an \htmlhead{section-command}{section title} command
+%      to the file.
+%
+\newwrite\ptrfile
+\def\DumpCounters#1#2#3#4{%
+\begingroup\let\protect=\noexpand
+\immediate\openout\ptrfile = #1.ptr
+\DumpPtr{part}{lpart}%
+\ifx\Hchapter\relax\else\DumpPtr{chapter}{lchapter}\fi
+\DumpPtr{section}{lsection}%
+\DumpPtr{subsection}{lsubsection}%
+\DumpPtr{subsubsection}{lsubsubsection}%
+\DumpPtr{paragraph}{lparagraph}%
+\DumpPtr{subparagraph}{lsubparagraph}%
+\DumpPtr{equation}{dummy}%
+\DumpPtr{footnote}{dummy}%
+\def\tmp{#4}\ifx\tmp\@empty
+\immediate\write\ptrfile{\noexpand\htmlhead{#2}{#3}}\else
+\immediate\write\ptrfile{\noexpand\htmlhead[#4]{#2}{#3}}\fi
+\dumpcitestatus \dumpcurrentcolor
+\immediate\closeout\ptrfile
+\endgroup }
+
+
+%% interface to natbib.sty
+
+\def\dumpcitestatus{}
+\def\loadcitestatus{\def\dumpcitestatus{%
+  \ifciteindex\immediate\write\ptrfile{\noexpand\citeindextrue}%
+  \else\immediate\write\ptrfile{\noexpand\citeindexfalse}\fi }%
+}
+\@ifpackageloaded{natbib}{\loadcitestatus}{%
+ \AtBeginDocument{\@ifpackageloaded{natbib}{\loadcitestatus}{}}}
+
+
+%% interface to color.sty
+
+\def\dumpcurrentcolor{}
+\def\loadsegmentcolors{%
+ \let\real@pagecolor=\pagecolor
+ \let\pagecolor\segmentpagecolor
+ \let\segmentcolor\color
+ \ifx\current@page@color\undefined \def\current@page@color{{}}\fi
+ \def\dumpcurrentcolor{\bgroup\def\@empty@{{}}%
+   \expandafter\def\expandafter\tmp\space####1@{\def\thiscol{####1}}%
+  \ifx\current@color\@empty@\def\thiscol{}\else
+   \expandafter\tmp\current@color @\fi
+  \immediate\write\ptrfile{\noexpand\segmentcolor{\thiscol}}%
+  \ifx\current@page@color\@empty@\def\thiscol{}\else
+   \expandafter\tmp\current@page@color @\fi
+  \immediate\write\ptrfile{\noexpand\segmentpagecolor{\thiscol}}%
+ \egroup}%
+ \global\let\loadsegmentcolors=\relax
+}
+
+% These macros are needed within  images.tex  since this inputs
+% the <segment>.ptr files for a segment, so that counters are
+% colors are synchronised.
+%
+\newcommand{\segmentpagecolor}[1][]{%
+ \@ifpackageloaded{color}{\loadsegmentcolors\bgroup
+  \def\tmp{#1}\ifx\@empty\tmp\def\next{[]}\else\def\next{[#1]}\fi
+  \expandafter\segmentpagecolor@\next}%
+ {\@gobble}}
+\def\segmentpagecolor@[#1]#2{\def\tmp{#1}\def\tmpB{#2}%
+ \ifx\tmpB\@empty\let\next=\egroup
+ \else
+  \let\realendgroup=\endgroup
+  \def\endgroup{\edef\next{\noexpand\realendgroup
+   \def\noexpand\current@page@color{\current@color}}\next}%
+  \ifx\tmp\@empty\real@pagecolor{#2}\def\model{}%
+  \else\real@pagecolor[#1]{#2}\def\model{[#1]}%
+  \fi
+  \edef\next{\egroup\def\noexpand\current@page@color{\current@page@color}%
+  \noexpand\real@pagecolor\model{#2}}%
+ \fi\next}
+%
+\newcommand{\segmentcolor}[2][named]{\@ifpackageloaded{color}%
+ {\loadsegmentcolors\segmentcolor[#1]{#2}}{}}
+
+\@ifpackageloaded{color}{\loadsegmentcolors}{\let\real@pagecolor=\@gobble
+ \AtBeginDocument{\@ifpackageloaded{color}{\loadsegmentcolors}{}}}
+
+
+%  Define the \segment[align]{file}{section-command}{section-title} command,
+%  and its helper macros.  This command does four things:
+%       1)  Begins a new LaTeX section;
+%       2)  Writes a list of section counters to file.ptr, each
+%           of which represents the sum of the LaTeX section
+%           counters, and the l-counters, defined above;
+%       3)  Write an \htmlhead{section-title} command to file.ptr;
+%       4)  Inputs file.tex.
+
+\newcommand{\segment}{\@ifstar{\@@htmls}{\@@html}}
+%\tracingall
+\newcommand{\@endsegment}[1][]{}
+\let\endsegment\@endsegment
+\newcommand{\@@htmls}[1][]{\@@htmlsx{#1}}
+\newcommand{\@@html}[1][]{\@@htmlx{#1}}
+\def\@@htmlsx#1#2#3#4{\csname #3\endcsname* {#4}%
+                   \DumpCounters{#2}{#3*}{#4}{#1}\input{#2}}
+\def\@@htmlx#1#2#3#4{\csname #3\endcsname {#4}%
+                   \DumpCounters{#2}{#3}{#4}{#1}\input{#2}}
+
+\makeatother
+\endinput
+
+
+% Modifications:
+%
+% (The listing of Initiales see Changes)
+
+% $Log: html.sty,v $
+% Revision 1.1  2006/02/14 22:30:19  isani
+% Adding style and def files corresponding to LaTeX2HTML-99.1 which Camera group uses.
+% Modify panstarrs.cls to include package html (must be included before hyperref) and expanded hyperref options to produce bookmarks in the PDF.
+%
+% Revision 1.37  1999/03/12 07:02:38  RRM
+%  --  change macro name from \addTOCsection to \htmladdTOClink
+%  --  it has 3 + 1 optional argument, to allow a local path to a labels.pl
+%  	file for the external document, for cross-references
+%
+% Revision 1.36  1999/03/10 05:46:00  RRM
+%  --  extended the code for compatibilty with comment.sty
+%  --  allow excluded environments to work within tables,
+%  	with the excluded material spanning headers and several cells
+%  	thanks Avinash Chopde for recognising the need for this.
+%  --  added LaTeX support (ignores it) for  \htmladdTOCsection
+%  	thanks to Steffen Klupsch and Uli Wortmann for this idea.
+%
+% Revision 1.35  1999/03/08 11:16:16  RRM
+% 	html.sty  for LaTeX2HTML V99.1
+%
+%  --  ensure that html.sty can be loaded *after* hyperref.sty
+%  --  support new command  \htmlclear for <BR> in HTML, ignored by LaTeX
+%  --  ensure {part} and {chapter} counters are defined, even if not used
+%
+% Revision 1.34  1998/09/19 10:37:29  RRM
+%  --  fixed typo with \next{\hyperref}{....}
+%
+% Revision 1.33  1998/09/08 12:47:51  RRM
+%  --  changed macro-names for the \hyperref and \hypercite options
+% 	allows easier compatibility with other packages
+%
+% Revision 1.32  1998/08/24 12:15:14  RRM
+%  --  new command  \htmllanguagestyle  to associate a style class
+%  	with text declared as a particular language
+%
+% Revision 1.31  1998/07/07 14:15:41  RRM
+%  --  new commands  \htmlsetstyle  and  \htmladdtostyle
+%
+% Revision 1.30  1998/07/04 02:42:22  RRM
+%  --  cope with catcodes of % { } in rawhtml/comment/htmlonly environments
+%
+% Revision 1.29  1998/06/23 13:33:23  RRM
+%  --  use \begin{small} with the default for URLs
+%
+% Revision 1.28  1998/06/21 09:38:39  RRM
+%  --  implement \htmlurl  to agree with \url if already defined
+%     or loaded subsequently (LaTeX-2e only)
+%  --  get LaTeX to print the revision number when loading
+%
+% Revision 1.27  1998/06/20 15:13:10  RRM
+%  --  \TeX is already protected in recent versions of LaTeX
+% 	so \DeclareRobust doesn't work --- causes looping
+%  --  \part and \subparagraph need not be defined in some styles
+%
+% Revision 1.26  1998/06/01 08:36:49  latex2html
+%  --  implement optional argument for \endsegment
+%  --  made the counter value output from \DumpPtr more robust
+%
+% Revision 1.25  1998/05/09 05:43:35  latex2html
+%  --   conditionals for avoiding undefined counters
+%
+% Revision 1.23  1998/02/26 10:32:24  latex2html
+%  --  use \providecommand for  \latextohtml
+%  --  implemented \HTMLcode to do what \HTML did previously
+% 	\HTML still works, unless already defined by another package
+%  --  fixed problems remaining with undefined \chapter
+%  --  defined \endsegment
+%
+% Revision 1.22  1997/12/05 11:38:18  RRM
+%  --  implemented an optional argument to \begin for style-sheet info.
+%  --  modified use of an optional argument with sectioning-commands
+%
+% Revision 1.21  1997/11/05 10:28:56  RRM
+%  --  replaced redefinition of \@htmlrule with \htmlrulestar
+%
+% Revision 1.20  1997/10/28 02:15:58  RRM
+%  --  altered the way some special html-macros are defined, so that
+% 	star-variants are explicitly defined for LaTeX
+% 	 -- it is possible for these to occur within  images.tex
+% 	e.g. \htmlinfostar \htmlrulestar \tableofchildlinksstar
+%
+% Revision 1.19  1997/10/11 05:47:48  RRM
+%  --  allow the dummy {tex2html_nowrap} environment in LaTeX
+% 	use it to make its contents be evaluated in environment order
+%
+% Revision 1.18  1997/10/04 06:56:50  RRM
+%  --  uses Robin Fairbairns' code for ignored environments,
+%      replacing the previous  comment.sty  stuff.
+%  --  extensions to the \tableofchildlinks command
+%  --  extensions to the \htmlinfo command
+%
+% Revision 1.17  1997/07/08 11:23:39  RRM
+%     include value of footnote counter in .ptr files for segments
+%
+% Revision 1.16  1997/07/03 08:56:34  RRM
+%     use \textup  within the \latextohtml macro
+%
+% Revision 1.15  1997/06/15 10:24:58  RRM
+%      new command  \htmltracenv  as environment-ordered \htmltracing
+%
+% Revision 1.14  1997/06/06 10:30:37  RRM
+%  -   new command:  \htmlborder  puts environment into a <TABLE> cell
+%      with a border of specified width, + other attributes.
+%  -   new commands: \HTML  for setting arbitrary HTML tags, with attributes
+%                    \HTMLset  for setting Perl variables, while processing
+%                    \HTMLsetenv  same as \HTMLset , but it gets processed
+%                                 as if it were an environment.
+%  -   new command:  \latextohtml  --- to set the LaTeX2HTML name/logo
+%  -   fixed some remaining problems with \segmentcolor & \segmentpagecolor
+%
+% Revision 1.13  1997/05/19 13:55:46  RRM
+%      alterations and extra options to  \hypercite
+%
+% Revision 1.12  1997/05/09 12:28:39  RRM
+%  -  Added the optional argument to \htmlhead, also in \DumpCounters
+%  -  Implemented \HTMLset as a no-op in LaTeX.
+%  -  Fixed a bug in accessing the page@color settings.
+%
+% Revision 1.11  1997/03/26 09:32:40  RRM
+%  -  Implements LaTeX versions of  \externalcite  and  \hypercite  commands.
+%     Thanks to  Uffe Engberg  and  Stephen Simpson  for the suggestions.
+%
+% Revision 1.10  1997/03/06 07:37:58  RRM
+% Added the  \htmltracing  command, for altering  $VERBOSITY .
+%
+% Revision 1.9  1997/02/17 02:26:26  RRM
+% - changes to counter handling (RRM)
+% - shuffled around some definitions
+% - changed \htmlrule of 209 mode
+%
+% Revision 1.8  1997/01/26 09:04:12  RRM
+% RRM: added optional argument to sectioning commands
+%      \htmlbase  sets the <BASE HREF=...> tag
+%      \htmlinfo  and  \htmlinfo* allow the document info to be positioned
+%
+% Revision 1.7  1997/01/03 12:15:44  L2HADMIN
+% % - fixes to the  color  and  natbib  interfaces
+% % - extended usage of  \hyperref, via an optional argument.
+% % - extended use comment environments to allow shifting expansions
+% %     e.g. within \multicolumn  (`bug' reported by Luc De Coninck).
+% % - allow optional argument to: \htmlimage, \htmlhead,
+% %     \htmladdimg, \htmladdnormallink, \htmladdnormallinkfoot
+% % - added new commands: \htmlbody, \htmlnohead
+% % - added new command: \tableofchildlinks
+%
+% Revision 1.6  1996/12/25 03:04:54  JCL
+% added patches to segment feature from Martin Wilck
+%
+% Revision 1.5  1996/12/23 01:48:06  JCL
+%  o introduced the environment makeimage, which may be used to force
+%    LaTeX2HTML to generate an image from the contents.
+%    There's no magic, all what we have now is a defined empty environment
+%    which LaTeX2HTML will not recognize and thus pass it to images.tex.
+%  o provided \protect to the \htmlrule commands to allow for usage
+%    within captions.
+%
+% Revision 1.4  1996/12/21 19:59:22  JCL
+% - shuffled some entries
+% - added \latexhtml command
+%
+% Revision 1.3  1996/12/21 12:22:59  JCL
+% removed duplicate \htmlrule, changed \htmlrule back not to create a \hrule
+% to allow occurrence in caption
+%
+% Revision 1.2  1996/12/20 04:03:41  JCL
+% changed occurrence of \makeatletter, \makeatother
+% added new \htmlrule command both for the LaTeX2.09 and LaTeX2e
+% sections
+%
+%
+% jcl 30-SEP-96
+%  - Stuck the commands commonly used by both LaTeX versions to the top,
+%    added a check which stops input or reads further if the document
+%    makes use of LaTeX2e.
+%  - Introduced rrm's \dumpcurrentcolor and \bodytext
+% hws 31-JAN-96 - Added support for document segmentation
+% hws 10-OCT-95 - Added \htmlrule command
+% jz 22-APR-94 - Added support for htmlref
+% nd  - Created
Index: trunk/doc/latex/panstarrs.cls
===================================================================
--- trunk/doc/latex/panstarrs.cls	(revision 26114)
+++ trunk/doc/latex/panstarrs.cls	(revision 26149)
@@ -11,11 +11,16 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{panstarrs}[2003/06/29 LaTeX class for PanSTARRS]
-\LoadClass[12pt]{article}
-\RequirePackage{tocloft,ifthen,fancyhdr,vmargin}
-\RequirePackage{hyperref,times,amsmath,amssymb}
+\LoadClass[11pt,letterpaper]{article}
+\RequirePackage{tocloft,ifthen,fancyhdr,vmargin,longtable}
+\RequirePackage{html}
+\RequirePackage[colorlinks,ps2pdf,bookmarks=true,bookmarksnumbered=true,plainpages=false]{hyperref} %avoid ``destination with the same identifier'' errors
+\RequirePackage{times,amsmath,amssymb,multirow}
 \RequirePackage{color,fullpage,boxedminipage,acronym,epsfig}
+\RequirePackage{psmisc}
+\RequirePackage{fancyvrb}
 
 % -- panstarrs definitions--
 \DeclareOption{panstarrs}{\input{panstarrs.def}}
+\DeclareOption{spec}{\input{spec.def}}
 
 % -- page layout options --
@@ -29,5 +34,5 @@
 \textheight=9.0in
 \textwidth=7.35in
-\headheight=12pt
+\headheight=15pt
 \headsep = 24pt
 \footskip=30pt
@@ -38,26 +43,57 @@
 \addtolength{\cftfignumwidth}{2em}
 
-% -- section numbering --
-\let\@section=\section \let\@subsection=\subsection
-\let\@subsubsection=\subsubsection
-\def\section{\renewcommand{\thefigure}{\thesection -\arabic{figure}} \setcounter{figure}{0} \@section}
-\def\subsection{\renewcommand{\thefigure}{\thesubsection -\arabic{figure}} \setcounter{figure}{0} \@subsection}
-\def\subsubsection{\renewcommand{\thefigure}{\thesubsubsection -\arabic{figure}} \setcounter{figure}{0} \@subsubsection}
-\def\paragraph{\@startsection{paragraph}{4}{\z@}%
-  {-3.5ex\@plus -1ex \@minus -.2ex}%
-  {1.5ex \@plus .2ex}%
-  {\normalsize\bf}}
-\def\subparagraph{\@startsection{subparagraph}{5}{\z@}%
-  {-3.5ex\@plus -1ex \@minus -.2ex}%
-  {1.5ex \@plus .2ex}%
-  {\normalsize\bf}}
-\def\subsubparagraph{\@startsection{subsubparagraph}{6}{\z@}%
-  {-3.5ex\@plus -1ex \@minus -.2ex}%
-  {1.5ex \@plus .2ex}%
-  {\normalsize\it}}
-\let\subsubsubsection=\paragraph
+%  % -- SRS section numbering / plain enumerate types --
+%  \let\@section=\section 
+%  \let\@subsection=\subsection
+%  \let\@subsubsection=\subsubsection
+%  
+%  \def\section{
+%  %  uncomment these to label figures by section number
+%  %  \renewcommand{\thefigure}{\thesection -\arabic{figure}} 
+%  %  \setcounter{figure}{0} 
+%    \@section
+%  }
+%  
+%  \def\subsection{
+%  %  uncomment these to label figures by section number
+%  %  \renewcommand{\thefigure}{\thesubsection -\arabic{figure}} 
+%  %  \setcounter{figure}{0} 
+%    \@subsection
+%  }
+%  
+%  \def\subsubsection{
+%  %  uncomment these to label figures by section number
+%  %  \renewcommand{\thefigure}{\thesubsubsection -\arabic{figure}} 
+%  %  \setcounter{figure}{0} 
+%    \@subsubsection
+%  }
+%  
+%  \def\paragraph{
+%    \@startsection{paragraph}{4}{\z@}%
+%      {-3.5ex\@plus -1ex \@minus -.2ex}%
+%      {1.5ex \@plus .2ex}%
+%      {\normalsize\bf}
+%  }
+%  
+%  \def\subparagraph{
+%    \@startsection{subparagraph}{5}{\z@}%
+%      {-3.5ex\@plus -1ex \@minus -.2ex}%
+%      {1.5ex \@plus .2ex}%
+%      {\normalsize\bf}
+%  }
+%  
+%  \def\subsubparagraph{
+%    \@startsection{subsubparagraph}{6}{\z@}%
+%      {-3.5ex\@plus -1ex \@minus -.2ex}%
+%      {1.5ex \@plus .2ex}%
+%      {\normalsize\it}
+%  } 
+%  
+%  \let\subsubsubsection=\paragraph
+%  \let\subsubsubsubsection=\subparagraph
+
 
 % -- section display --
-\setcounter{secnumdepth}{4} % lowest level at which counters are displayed
+\setcounter{secnumdepth}{5} % lowest level at which counters are displayed
 \setcounter{tocdepth}{3} % lowest level to be included in toc
 
@@ -71,4 +107,5 @@
 \newcommand\thesubtitle{} 
 \newcommand\thedistribution{Approved for Public Release -- Distribution is Unlimited}
+\newcommand\theaudience{panstarrs team} 
 
 \newcommand{\docnumber}[1]{\renewcommand\thedocnumber{#1} }
@@ -80,4 +117,28 @@
 \newcommand{\subtitle}[1]{ \renewcommand\thesubtitle{#1} }
 \newcommand{\distribution}[1]{ \renewcommand\thedistribution{#1} }
+\newcommand{\audience}[1]{ \renewcommand\theaudience{#1} }
+
+%%%%%%%%%%%%%%%%%%%% start of time code %%%%%%%%%%%%%%%%%%%% 
+%
+% Code for printing the time by Michael Doob <mdoob@cc.umanitoba.ca>
+%
+\newcount\hour \newcount\minute
+\hour=\time  \divide \hour by 60
+\minute=\time
+\loop \ifnum \minute > 59 \advance \minute by -60 \repeat
+\def\nowtwelve{\ifnum \hour<13 \number\hour:% 		% supresses leading 0's
+                      \ifnum \minute<10 0\fi%		% so add it it
+                      \number\minute
+                      \ifnum \hour<12 \ A.M.\else \ P.M.\fi
+	 \else \advance \hour by -12 \number\hour:% 	% supresses leading 0's
+                      \ifnum \minute<10 0\fi%		% add it in
+                      \number\minute \ P.M.\fi}
+\def\nowtwentyfour{\ifnum \hour<10 0\fi% 		% need a leading 0 
+		\number\hour:% 				% supresses leading 0's
+         	\ifnum \minute<10 0\fi% 		% add it in
+         	\number\minute}
+\def\now{\nowtwelve}
+%%%%%%%%%%%%%%%%%%%% end of time code %%%%%%%%%%%%%%%%%%%%
+
 
 % -- MAKETITLE --
@@ -101,64 +162,64 @@
 
 \def\@maketitle{
-  \pagenumbering{roman} 
-  \thispagestyle{empty} 
-  \unitlength 1.0in
-  \begin{picture}(0.0,0.0)(0.0,9.375)
-  \small
-
-  \put (7.50, 9.85){\makebox(0,0)[br]{\small      {\bf Pan-STARRS Document Control}}}
-  \put (7.50, 9.70){\makebox(0,0)[br]{\small      {\bf \thedocnumber-\theversion}}}
-
-  \put (4.006, 8.30){\line(1,0){0.1}} % put the macron on Manoa
-  \put (0.50, 8.10){\makebox(0,0)[bl]{\fontA UNIVERSITY OF HAWAII AT MANOA}}
-  \put (0.50, 7.88){\makebox(0,0)[bl]{\fontB Institute for Astrononmy}}
-
-  \put (0.50, 7.83){\line(1,0){6.5}}
-  \put (0.50, 7.63){\makebox(0,0)[bl]{\small      {\bf Pan-STARRS Project Management System}}}
-
-  \put (3.75, 5.25){\makebox(0,0)[bc]{\large {\bf \@title}}}
-  \put (3.75, 5.00){\makebox(0,0)[bc]{\large {\bf \thesubtitle}}}
-
-  \put (2.15, 4.75){\makebox(0,0)[l]{{\bf Grant Award No. }}}
-  \put (2.15, 4.57){\makebox(0,0)[l]{{\bf Prepared For    }}}
-  \put (2.15, 4.39){\makebox(0,0)[l]{{\bf Prepared By     }}}
-  \put (2.15, 4.21){\makebox(0,0)[l]{{\bf Document No.    }}}
-  \put (2.15, 4.03){\makebox(0,0)[l]{{\bf Document Date   }}}
-  \put (2.15, 3.85){\makebox(0,0)[l]{{\bf Revision        }}}
-
-  \put (3.75, 4.75){\makebox(0,0)[l]{{\bf : F29601-02-1-0268}}}
-  \put (3.75, 4.57){\makebox(0,0)[l]{{\bf : Pan-STARRS Team}}}
-  \put (3.75, 4.39){\makebox(0,0)[l]{{\bf : \@author}}}
-  \put (3.75, 4.21){\makebox(0,0)[l]{{\bf : \thedocnumber-\theversion}}}
-  \put (3.75, 4.03){\makebox(0,0)[l]{{\bf : \today}}}
-  \put (3.75, 3.85){\makebox(0,0)[l]{{\bf : \theversion}}}
-
-  \put (3.75, 2.50){\makebox(0,0)[c]{{\bf DISTRIBUTION STATEMENT}}}
-  \put (3.75, 2.30){\makebox(0,0)[c]{{\bf \thedistribution}}}
-
-  \put (3.75, 1.30){\makebox(0,0)[bc]{\scriptsize {\bf \copyright Institute for Astronomy, University of Hawaii}}}
-  \put (3.75, 1.15){\makebox(0,0)[bc]{\scriptsize {\bf 2680 Woodlawn Drive, Honolulu, Hawaii 96822}}}
-  \put (3.75, 1.00){\makebox(0,0)[bc]{\scriptsize {\bf An Equal Opportunity/Affirmative Action Institution}}}
-  \end{picture}
-
-  \pagebreak 
-  \unitlength 1.0in
-  \begin{picture}(0.0,0.0)(0.5,9.375)
-  \small
-
-  \put (1.00, 8.50){\makebox(0,0)[l]{Submitted By:}}
-  \put (1.00, 8.00){\line(1,0){5.5}}
-  \put (6.70, 8.00){\line(1,0){0.8}}
-  \put (1.00, 7.90){\makebox(0,0)[l]{[Insert Signature Block of Authorized Developer Representative]}}
-  \put (6.70, 7.90){\makebox(0,0)[l]{Date}}
-
-  \put (1.00, 7.00){\makebox(0,0)[l]{Approved By:}}
-  \put (1.00, 6.50){\line(1,0){5.5}}
-  \put (6.70, 6.50){\line(1,0){0.8}}
-  \put (1.00, 6.40){\makebox(0,0)[l]{[Insert Signature Block of Customer Developer Representative]}}
-  \put (6.70, 6.40){\makebox(0,0)[l]{Date}}
-
-  \end{picture}
-  \pagebreak 
+      \pagenumbering{roman} 
+      \thispagestyle{empty} 
+      \unitlength 1.0in
+      \begin{picture}(0.0,0.0)(0.0,9.375)
+      \small
+    
+      \put (7.50, 9.85){\makebox(0,0)[br]{\small      {\bf Pan-STARRS Document Control}}}
+      \put (7.50, 9.70){\makebox(0,0)[br]{\small      {\bf \thedocnumber-\theversion}}}
+    
+      \put (4.006, 8.30){\line(1,0){0.1}} % put the macron on Manoa
+      \put (0.50, 8.10){\makebox(0,0)[bl]{\fontA UNIVERSITY OF HAWAII AT MANOA}}
+      \put (0.50, 7.88){\makebox(0,0)[bl]{\fontB Institute for Astrononmy}}
+    
+      \put (0.50, 7.83){\line(1,0){6.5}}
+      \put (0.50, 7.63){\makebox(0,0)[bl]{\small      {\bf Pan-STARRS Project Management System}}}
+    
+      \put (3.75, 5.25){\makebox(0,0)[bc]{\large {\bf \@title}}}
+      \put (3.75, 5.00){\makebox(0,0)[bc]{\large {\bf \thesubtitle}}}
+    
+      \put (2.15, 4.75){\makebox(0,0)[l]{{\bf Coop. Agreement No. }}}
+      \put (2.15, 4.57){\makebox(0,0)[l]{{\bf Prepared For    }}}
+      \put (2.15, 4.39){\makebox(0,0)[l]{{\bf Prepared By     }}}
+      \put (2.15, 4.21){\makebox(0,0)[l]{{\bf Document No.    }}}
+      \put (2.15, 4.03){\makebox(0,0)[l]{{\bf Document Date   }}}
+      \put (2.15, 3.85){\makebox(0,0)[l]{{\bf Revision        }}}
+    
+      \put (3.75, 4.75){\makebox(0,0)[l]{{\bf : FA9451-06-2-0338}}}
+      \put (3.75, 4.57){\makebox(0,0)[l]{{\bf : \theaudience}}}
+      \put (3.75, 4.39){\makebox(0,0)[l]{{\bf : \@author}}}
+      \put (3.75, 4.21){\makebox(0,0)[l]{{\bf : \thedocnumber-\theversion}}}
+      \put (3.75, 4.03){\makebox(0,0)[l]{{\bf : \today}}}
+      \put (3.75, 3.85){\makebox(0,0)[l]{{\bf : \theversion}}}
+    
+      \put (3.75, 2.50){\makebox(0,0)[c]{{\bf DISTRIBUTION STATEMENT}}}
+      \put (3.75, 2.30){\makebox(0,0)[c]{{\bf \thedistribution}}}
+    
+      \put (3.75, 1.30){\makebox(0,0)[bc]{\footnotesize {\copyright Institute for Astronomy, University of Hawaii}}}
+      \put (3.75, 1.15){\makebox(0,0)[bc]{\footnotesize {2680 Woodlawn Drive, Honolulu, Hawaii 96822}}}
+      \put (3.75, 1.00){\makebox(0,0)[bc]{\footnotesize {An Equal Opportunity/Affirmative Action Institution}}}
+      \end{picture}
+    
+      \pagebreak 
+      \unitlength 1.0in
+      \begin{picture}(0.0,0.0)(0.5,9.375)
+      \small
+    
+      \put (1.00, 8.50){\makebox(0,0)[l]{Submitted By:}}
+      \put (1.00, 8.00){\line(1,0){5.5}}
+      \put (6.70, 8.00){\line(1,0){0.8}}
+      \put (1.00, 7.90){\makebox(0,0)[l]{[Insert Signature Block of Authorized Developer Representative]}}
+      \put (6.70, 7.90){\makebox(0,0)[l]{Date}}
+    
+      \put (1.00, 7.00){\makebox(0,0)[l]{Approved By:}}
+      \put (1.00, 6.50){\line(1,0){5.5}}
+      \put (6.70, 6.50){\line(1,0){0.8}}
+      \put (1.00, 6.40){\makebox(0,0)[l]{[Insert Signature Block of Customer Developer Representative]}}
+      \put (6.70, 6.40){\makebox(0,0)[l]{Date}}
+    
+      \end{picture}
+      \pagebreak 
 }               
 
@@ -174,5 +235,5 @@
 % Make verbatim use a \footnotesize font (to allow 110-character lines)
 \let\oldverbatim@font=\verbatim@font
-\def\verbatim@font{\oldverbatim@font\footnotesize}
+\def\verbatim@font{\oldverbatim@font\scriptsize}
 
 \def\RevisionsStart{
Index: trunk/doc/latex/panstarrs.def
===================================================================
--- trunk/doc/latex/panstarrs.def	(revision 26114)
+++ trunk/doc/latex/panstarrs.def	(revision 26149)
@@ -6,6 +6,4 @@
 % LaTeX variables (cntl sequences) for entities significant to Pan-STARRS.
    \newcommand{\PS}{Pan-STARRS}
-   \newcommand{\pipelinename}{Image Processing Pipeline}
-   \newcommand{\thisdocument}{\PS/ \pipelinename\ Software Design Description}
    \newcommand\Object{\ensuremath{f}}                % an object
    \newcommand\ObjectSet{\ensuremath{\mathbf{f}}}    % a set of objects
@@ -27,4 +25,8 @@
    \newcommand\AngularPitch{\ensuremath{p_{\text{\scriptsize pixel}}}}   % angular pitch of a pixel (e.g. 0.3 arcsec)
 
+   \def\degree{\hbox{$^\circ$}}
+   \def\arcmin{\hbox{$^\prime$}}
+   \def\arcsec{\hbox{$^{\prime\prime}$}}
+
 %
 % Typsetting documentation
@@ -37,4 +39,5 @@
 % \begin{verbatim}...\end{verbatim} for longer blocks
 %
+
 \def\uncatcodespecials{\def\do##1{\catcode`##1=12}\dospecials}%
 {\catcode`\`=\active\gdef`{\relax\lq}}% this line inhibits Spanish 
@@ -44,5 +47,5 @@
      \spaceskip=0pt \xspaceskip=0pt % just in case...
      \catcode`\`=\active
-     \obeylines \uncatcodespecials \obeyspaces
+     \uncatcodespecials \obeyspaces
      \catcode`\{=1\catcode`\}=2
     }%
@@ -51,5 +54,5 @@
      \spaceskip=0pt \xspaceskip=0pt % just in case...
      \catcode`\`=\active
-     \obeylines \uncatcodespecials \obeyspaces
+     \uncatcodespecials \obeyspaces
     }%
 
@@ -60,9 +63,21 @@
 \def\CODE{\begingroup\SETUPC@DE\D@CODE}%
 
-\newcommand\note[1]{{\bf #1}}
-\newcommand\tbd[1]{\textbf{[{\color{red}#1}]}}
+\newcommand\note[1]{\textbf{\color{red}#1}}
+%\newcommand\tbd[1]{\textbf{\color{red}#1 (TBD)}}
+%\newcommand\tbr[1]{\textbf{\color{blue}#1 (TBR)}}
 \newcommand\TBD[1]{\par\tbd{#1}\par}
+\renewcommand\comment[1]{\footnote{{\color{red}#1}}}
 
 \newcommand{\file}[1]{\textit{#1}}%
+
+%
+% embedded software function prototypes and datatypes
+%
+
+\DefineVerbatimEnvironment%
+  {prototype}{Verbatim}{fontsize=\footnotesize}
+
+\DefineVerbatimEnvironment%
+  {datatype}{Verbatim}{fontsize=\footnotesize}
 
 %------------------------------------------------------------------------------
Index: trunk/doc/latex/panstarrsl2h.def
===================================================================
--- trunk/doc/latex/panstarrsl2h.def	(revision 26149)
+++ trunk/doc/latex/panstarrsl2h.def	(revision 26149)
@@ -0,0 +1,79 @@
+
+\def\RevisionsStart{
+{ \Large \bf Revision History}
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{1in}|p{4in}|}
+\hline
+{\bf Revision Number} & {\bf Release Date} & {\bf Description} \\
+\hline
+}
+\def\RevisionsEnd{
+\hline
+\end{tabular}
+\end{center}
+\pagebreak
+}
+
+\def\TBDsStart{
+{ \Large \bf TBD / TBR Listing}
+\begin{center}
+\begin{tabular}{|p{1in}|p{0.8in}|p{0.8in}|p{3.45in}|}
+\hline
+{\bf Section No.} & {\bf Page No.} & {\bf TBD/R No.} & {\bf Description} \\
+\hline
+}
+\def\TBDsEnd{
+\hline
+\end{tabular}
+\end{center}
+\pagebreak
+}
+
+\def\DocumentsInternalSection{
+\section{Referenced Documents}
+\subsection{Internal Documents}
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{5in}|}
+\hline
+{\bf Reference} & {\bf Title} \\
+\hline}
+
+\def\DocumentsExternalSection{
+\hline
+\end{tabular}
+\end{center}
+\par
+\subsection{External Documents}
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{5in}|}
+\hline
+{\bf Reference} & {\bf Title} \\
+\hline}
+
+\def\DocumentsInternal{
+{\large \bf Referenced Documents}\par
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{5in}|}
+\multicolumn{1}{l}{\bf Internal Documents} \\
+\hline
+{\bf Reference} & {\bf Title} \\
+\hline}
+
+\def\DocumentsExternal{
+\hline
+\end{tabular}
+\end{center}
+\par
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{5in}|}
+\multicolumn{1}{l}{\bf External Documents} \\
+\hline
+{\bf Reference} & {\bf Title} \\
+\hline}
+
+\def\DocumentsEnd{
+\hline
+\end{tabular}
+\end{center}
+\pagebreak }
+
Index: trunk/doc/latex/psmisc.sty
===================================================================
--- trunk/doc/latex/psmisc.sty	(revision 26149)
+++ trunk/doc/latex/psmisc.sty	(revision 26149)
@@ -0,0 +1,287 @@
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%       ****************************************
+%       *              ENDNOTES                *
+%       ****************************************
+%
+%       ****************************************
+%       *           ENDNOTE MACROS             *
+%       ****************************************
+%
+
+\@definecounter{endnote}
+\def\theendnote{\arabic{endnote}}
+
+% Default definition
+\def\@makeenmark{\hbox{$^{\@theenmark}$}}
+
+\newdimen\endnotesep
+
+\def\endnote{\@ifnextchar[{\@xendnote}{\stepcounter
+   {endnote}\xdef\@theenmark{\theendnote}\@endnotemark\@endnotetext}}
+
+\def\@xendnote[#1]{\begingroup \c@endnote=#1\relax
+   \xdef\@theenmark{\theendnote}\endgroup
+   \@endnotemark\@endnotetext}
+
+%  Here begins endnote code that's really different from the footnote
+% code of LaTeX.
+
+\let\@doanenote=0
+\let\@endanenote=0
+
+\newwrite\@enotes
+\newif\if@enotesopen \global\@enotesopenfalse
+
+\def\@openenotes{\immediate\openout\@enotes=\jobname.ent\relax
+      \global\@enotesopentrue}
+
+%  The stuff with \next and \meaning is a trick from the TeXbook, 382,
+% there intended for setting verbatim text, but here used to avoid
+% macro expansion when the footnote text is written.  \next will have
+% the entire text of the footnote as one long line, which might well
+% overflow limits on output line length; the business with \newlinechar
+% makes every space become a newline in the \@enotes file, so that all
+% of the lines wind up being quite short.
+
+\long\def\@endnotetext#1{%
+     \if@enotesopen \else \@openenotes \fi
+     \immediate\write\@enotes{\@doanenote{\@theenmark}}%
+     \begingroup
+        \def\next{#1}%
+        \newlinechar='40
+        \immediate\write\@enotes{\meaning\next}%
+     \endgroup
+     \immediate\write\@enotes{\@endanenote}}
+
+% \addtoendnotes works the way the other endnote macros probably should
+% have, requiring the use of \protect for fragile commands.
+
+\long\def\addtoendnotes#1{%
+     \if@enotesopen \else \@openenotes \fi
+     \begingroup
+        \newlinechar='40
+        \let\protect\string
+        \immediate\write\@enotes{#1}%
+     \endgroup}
+
+%  End of unique endnote code
+
+\def\endnotemark{\@ifnextchar[{\@xendnotemark
+    }{\stepcounter{endnote}\xdef\@theenmark{\theendnote}\@endnotemark}}
+
+\def\@xendnotemark[#1]{\begingroup \c@endnote #1\relax
+   \xdef\@theenmark{\theendnote}\endgroup \@endnotemark}
+
+\def\@endnotemark{\leavevmode\ifhmode
+  \edef\@x@sf{\the\spacefactor}\fi \@makeenmark
+   \ifhmode\spacefactor\@x@sf\fi\relax}
+
+\def\endnotetext{\@ifnextchar
+    [{\@xendnotenext}{\xdef\@theenmark{\theendnote}\@endnotetext}}
+
+\def\@xendnotenext[#1]{\begingroup \c@endnote=#1\relax
+   \xdef\@theenmark{\theendnote}\endgroup \@endnotetext}
+
+
+%  \theendnotes actually prints out the endnotes.
+
+%  The user may want separate endnotes for each chapter, or a big
+% block of them at the end of the whole document.  As it stands,
+% either will work; you just say \theendnotes wherever you want the
+% endnotes so far to be inserted.  However, you must add
+% \setcounter{endnote}{0} after that if you want subsequent endnotes
+% to start numbering at 1 again.
+
+%  \enoteformat is provided so user can specify some special formatting
+% for the endnotes.  It needs to set up the paragraph parameters, start
+% the paragraph, and print the label.  The \leavemode stuff is to make
+% and undo a dummy paragraph, to get around the games \section*
+% plays with paragraph indenting.
+
+\def\notesname{Notes}% <------ JK
+\def\enoteheading{\section*{\notesname
+  \@mkboth{\uppercase{\notesname}}{\uppercase{\notesname}}}%
+     \leavevmode\par\vskip-\baselineskip}
+
+\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=1.8em
+     \leavevmode\llap{\hbox{$^{\@theenmark}$}}}
+
+\def\enotesize{\footnotesize}
+
+% The definition of \ETC. is needed only for versions of TeX prior
+% to 2.992.  Those versions limited \meaning expansions to 1000
+% characters; in 2.992 and beyond there is no limit.  At Brandeis the
+% BIGLATEX program changed the code in the token_show procedure of
+% TeX to eliminate this problem, but most ``big'' versions of TeX
+% will not solve this problem.
+
+\def\theendnotes{
+% only try to open the endnotes file (\jobname.ent) if endnotes have been made
+  \if@enotesopen 
+   \immediate\closeout\@enotes 
+   \global\@enotesopenfalse
+   \begingroup
+   \makeatletter
+% the following is to save catcode of ``>'' and restore it in \@endanenote
+   \edef\@tempa{`\string >}%
+   \ifnum\catcode\@tempa=11\let\@ResetGT\relax% accepts also that > were active
+     \else\edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
+     \fi%
+   \catcode`>=12% char > will be read as char so force it to \catcode 12 --bg\edef\GOfrench{`\string @}% temp def futher correctly defined
+   \def\@doanenote##1##2>{\def\@theenmark{##1}\par\begingroup
+     \@ResetGT%\catcode`>=13
+     \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark} %DW
+     \enoteformat}
+   \def\@endanenote{\par\endgroup}%
+   \def\ETC.{\errmessage{Some long endnotes will be truncated; %
+                            use BIGLATEX to avoid this}%
+   \def\ETC.{\relax}}
+   \enoteheading
+   \enotesize
+   \input{\jobname.ent}%
+   \endgroup
+  \else \fi
+}
+
+\def\endnotesection{
+\begingroup
+\parindent 0pt
+\parskip 2ex
+\def\enotesize{\normalsize}
+\theendnotes
+\endgroup
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%% TBD Generation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newread\@infile
+\newwrite\@tbdfile
+
+\newif\if@tbdfileopen \global\@tbdfileopenfalse
+
+\@definecounter{tbdcount}
+
+\def\thetbd{\arabic{tbdcount}}
+\def\thetbdsec{\thesection}
+\let\ttnl\relax
+
+\def\tbd#1{
+ \textbf{\color{red}#1 (TBD)}
+ \stepcounter{tbdcount}
+ \if@tbdfileopen \else \@opentbdfile \fi
+ \immediate\write\@tbdfile{\thetbdsec\ & \thepage\ & \thetbd\ & #1 \ttnl }%
+}
+
+\def\@opentbdfile{
+ \immediate
+ \openout
+ \@tbdfile=\jobname.tbd 
+ \global\@tbdfileopentrue
+}
+
+% command to add TBDs at end of file processing:
+\def\dumptbd{
+  % only try to open the file (\jobname.tbd) if tbds have been made
+  \if@tbdfileopen 
+    \immediate\closeout\@tbdfile 
+    \global\@tbdfileopenfalse
+    \def\ttnl{\tabularnewline \hline}
+    { \Large \bf TBD Listing}
+    \begin{center}
+    \begin{longtable}{|p{1in}|p{0.8in}|p{0.8in}|p{3.45in}|}
+    \hline
+    {\bf Section No.} & {\bf Page No.} & {\bf TBD No.} & {\bf Description} \\
+    \hline
+    \input{\jobname.tbd}
+    \end{longtable}
+    \end{center}
+  \else \fi
+}
+
+\def\inserttbd{
+  \openin\@infile=\jobname.tbd
+  \ifeof\@infile
+  \else
+    \immediate\closeout\@infile
+    \def\ttnl{\tabularnewline \hline}
+    { \Large \bf TBD Listing}
+    \begin{center}
+    \begin{longtable}{|p{1in}|p{0.8in}|p{0.8in}|p{3.45in}|}
+    \hline
+    {\bf Section No.} & {\bf Page No.} & {\bf TBD No.} & {\bf Description} \\
+    \hline
+    \input{\jobname.tbd}
+    \end{longtable}
+    \end{center}
+    \let\ttnl\relax
+  \fi
+}
+
+%%% TBR Generation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newread\@infile
+\newwrite\@tbrfile
+
+\newif\if@tbrfileopen \global\@tbrfileopenfalse
+
+\@definecounter{tbrcount}
+
+\def\thetbr{\arabic{tbrcount}}
+\let\ttnl\relax
+
+\def\tbr#1{\stepcounter{tbrcount}
+ \if@tbrfileopen \else \@opentbrfile \fi
+ \immediate\write\@tbrfile{\thetbdsec\ & \thepage\ & \thetbr\ & #1 \ttnl}%
+ \textbf{\color{blue}#1 (TBR)}}
+
+\def\@opentbrfile{
+ \immediate
+ \openout
+ \@tbrfile=\jobname.tbr 
+ \global\@tbrfileopentrue
+}
+
+% command to add TBRs at end of file processing:
+\def\dumptbr{
+  % only try to open the file (\jobname.tbr) if tbrs have been made
+  \if@tbrfileopen 
+    \immediate\closeout\@tbrfile 
+    \global\@tbrfileopenfalse
+    \def\ttnl{\tabularnewline \hline}
+    { \Large \bf TBR Listing}
+    \begin{center}
+    \begin{longtable}{|p{1in}|p{0.8in}|p{0.8in}|p{3.45in}|}
+    \hline
+    {\bf Section No.} & {\bf Page No.} & {\bf TBR No.} & {\bf Description} \\
+    \hline
+    \input{\jobname.tbr}
+    \end{longtable}
+    \end{center}
+  \else \fi
+}
+
+\def\inserttbr{
+  \openin\@infile=\jobname.tbr
+  \ifeof\@infile
+  \else
+    \immediate\closeout\@infile
+    \def\ttnl{\tabularnewline \hline}
+    { \Large \bf TBR Listing}
+    \begin{center}
+    \begin{longtable}{|p{1in}|p{0.8in}|p{0.8in}|p{3.45in}|}
+    \hline
+    {\bf Section No.} & {\bf Page No.} & {\bf TBR No.} & {\bf Description} \\
+    \hline
+    \input{\jobname.tbr}
+    \end{longtable}
+    \end{center}
+    \let\ttnl\relax
+  \fi
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: trunk/doc/latex/psreport.def
===================================================================
--- trunk/doc/latex/psreport.def	(revision 26114)
+++ trunk/doc/latex/psreport.def	(revision 26149)
@@ -36,8 +36,13 @@
   \put (3.75, 5.00){\makebox(0,0)[bc]{\Large {\bf \@title}}}
 
-  \put (3.75, 4.70){\makebox(0,0)[bc]{\small      {\bf \@author}}}
-  \put (3.75, 4.53){\makebox(0,0)[bc]{\small      {\bf \thegroup}}}
-  \put (3.75, 4.36){\makebox(0,0)[bc]{\small      {\bf \theorganization}}}
-  \put (3.75, 4.19){\makebox(0,0)[bc]{\small      {\bf \today}}}
+%  \put (3.75, 4.70){\makebox(0,0)[bc]{\small      {\bf \@author}}}
+%  \put (3.75, 4.53){\makebox(0,0)[bc]{\small      {\bf \thegroup}}}
+%  \put (3.75, 4.36){\makebox(0,0)[bc]{\small      {\bf \theorganization}}}
+%  \put (3.75, 4.19){\makebox(0,0)[bc]{\small      {\bf \today}}}
+  \put (3.75, 4.70){\makebox(0,0)[bc]{\normalsize      {\bf \@author}}}
+  \put (3.75, 4.53){\makebox(0,0)[bc]{\normalsize      {\bf \thegroup}}}
+  \put (3.75, 4.36){\makebox(0,0)[bc]{\normalsize      {\bf \theorganization}}}
+  \put (3.75, 4.19){\makebox(0,0)[bc]{\normalsize      {\bf \today}}}
+
 
   \put (3.75, 1.26){\makebox(0,0)[bc]{\scriptsize {\bf \copyright Institute for Astronomy}}}
Index: trunk/doc/latex/spec.def
===================================================================
--- trunk/doc/latex/spec.def	(revision 26149)
+++ trunk/doc/latex/spec.def	(revision 26149)
@@ -0,0 +1,103 @@
+
+% -- SRS section numbering / enumerate types --
+\let\@section=\section \let\@subsection=\subsection
+\let\@subsubsection=\subsubsection
+
+\def\section{
+  \setlength{\leftmargini}{2.5em} 
+  \renewcommand{\theenumi}{\thesection.\arabic{enumi}}
+  \renewcommand{\labelenumi}{\theenumi}
+
+  \setlength{\leftmarginii}{1.7em} 
+  \renewcommand{\theenumii}{.\arabic{enumii}}
+  \renewcommand{\labelenumii}{\thesection.\arabic{enumi}\theenumii}
+  \renewcommand{\thetbdsec}{\thesection}
+
+%  uncomment these to label figures by section number
+%  \renewcommand{\thefigure}{\thesection -\arabic{figure}} 
+%  \setcounter{figure}{0} 
+  \@section
+}
+
+\def\subsection{
+  \setlength{\leftmargini}{3.5em} 
+  \renewcommand{\theenumi}{\thesubsection.\arabic{enumi}}
+  \renewcommand{\labelenumi}{\theenumi}
+
+  \setlength{\leftmarginii}{1.7em} 
+  \renewcommand{\theenumii}{.\arabic{enumii}}
+  \renewcommand{\labelenumii}{\thesubsection.\arabic{enumi}\theenumii}
+  \renewcommand{\thetbdsec}{\thesubsection}
+
+%  uncomment these to label figures by section number
+%  \renewcommand{\thefigure}{\thesubsection -\arabic{figure}} 
+%  \setcounter{figure}{0} 
+  \@subsection
+}
+
+\def\subsubsection{
+  \setlength{\leftmargini}{4.5em} 
+  \renewcommand{\theenumi}{\thesubsubsection.\arabic{enumi}}
+  \renewcommand{\labelenumi}{\theenumi}
+
+  \setlength{\leftmarginii}{1.7em} 
+  \renewcommand{\theenumii}{.\arabic{enumii}}
+  \renewcommand{\labelenumii}{\thesubsubsection.\arabic{enumi}\theenumii}
+  \renewcommand{\thetbdsec}{\thesubsubsection}
+
+%  uncomment these to label figures by section number
+%  \renewcommand{\thefigure}{\thesubsubsection -\arabic{figure}} 
+%  \setcounter{figure}{0} 
+  \@subsubsection
+}
+
+\def\paragraph{
+  \setlength{\leftmargini}{5.5em} 
+  \renewcommand{\theenumi}{\theparagraph.\arabic{enumi}}
+  \renewcommand{\labelenumi}{\theenumi}
+
+  \setlength{\leftmarginii}{1.7em} 
+  \renewcommand{\theenumii}{.\arabic{enumii}}
+  \renewcommand{\labelenumii}{\theparagraph.\arabic{enumi}\theenumii}
+  \renewcommand{\thetbdsec}{\theparagraph}
+
+  \@startsection{paragraph}{4}{\z@}%
+    {-3.5ex\@plus -1ex \@minus -.2ex}%
+    {1.5ex \@plus .2ex}%
+    {\normalsize\bf}
+}
+
+\def\subparagraph{
+  \setlength{\leftmargini}{6.5em} 
+  \renewcommand{\theenumi}{\thesubparagraph.\arabic{enumi}}
+  \renewcommand{\labelenumi}{\theenumi}
+
+  \setlength{\leftmarginii}{1.7em} 
+  \renewcommand{\theenumii}{\thesubparagraph.\arabic{enumii}}
+  \renewcommand{\labelenumii}{\theenumii}
+  \renewcommand{\thetbdsec}{\thesubparagraph}
+
+  \@startsection{subparagraph}{5}{\z@}%
+    {-3.5ex\@plus -1ex \@minus -.2ex}%
+    {1.5ex \@plus .2ex}%
+    {\normalsize\bf}
+}
+
+\def\subsubparagraph{
+%  \setlength{\leftmargini}{2.5em} 
+%  \renewcommand{\theenumi}{\thesubsubparagraph.\arabic{enumi}}
+%  \renewcommand{\labelenumi}{\theenumi}
+
+%  \setlength{\leftmarginii}{2.5em} 
+%  \renewcommand{\theenumii}{\thesubsubparagraph.\arabic{enumi}.\arabic{enumii}}
+%  \renewcommand{\labelenumii}{\theenumii}
+
+  \@startsection{subsubparagraph}{6}{\z@}%
+    {-3.5ex\@plus -1ex \@minus -.2ex}%
+    {1.5ex \@plus .2ex}%
+    {\normalsize\it}
+} 
+
+\let\subsubsubsection=\paragraph
+\let\subsubsubsubsection=\subparagraph
+
