% guide.sty based on report.sty  ---  CDS January 1992
%

\typeout{SIMBAD User's Guide}

\def\@ptsize{0} \@namedef{ds@11pt}{\def\@ptsize{1}}
\@namedef{ds@12pt}{\def\@ptsize{2}}
\def\ds@twoside{\@twosidetrue \@mparswitchtrue} \def\ds@draft{\overfullrule
5pt}
\@options
\input rep1\@ptsize.sty\relax

\def\part{\cleardoublepage \thispagestyle{plain} \if@twocolumn \onecolumn
\@tempswatrue \else \@tempswafalse \fi \hbox{}\vfil \bgroup \centering
\secdef\@part\@spart}

\def\@part[#1]#2{\ifnum \c@secnumdepth >-2\relax \refstepcounter{part}
\addcontentsline{toc}{part}{\thepart \hspace{1em}#1}\else
\addcontentsline{toc}{part}{#1}\fi \markboth{}{}
 \ifnum \c@secnumdepth >-2\relax \huge\bf Part \thepart \par \vskip 20pt \fi
\Huge \bf #1\@endpart}
\def\@endpart{\par\egroup \vfil\newpage \if@twoside \hbox{}
\thispagestyle{empty}
 \newpage
 \fi \if@tempswa \twocolumn \fi}
\def\@spart#1{\Huge \bf #1\@endpart}


\def\labelenumi{\arabic{enumi}.}
\def\theenumi{\arabic{enumi}}
\def\labelenumii{(\alph{enumii})}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}
\def\labelenumiii{\roman{enumiii}.}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\theenumi(\theenumii)}
\def\labelenumiv{\Alph{enumiv}.}
\def\theenumiv{\Alph{enumiv}}
\def\p@enumiv{\p@enumiii\theenumiii}

\def\labelitemi{$\bullet$}
\def\labelitemii{\bf --}
\def\labelitemiii{$\ast$}
\def\labelitemiv{$\cdot$}

\def\verse{\let\\=\@centercr
 \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent
 \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
\let\endverse\endlist
\def\quotation{\list{}{\listparindent 1.5em
 \itemindent\listparindent
 \rightmargin\leftmargin\parsep 0pt plus 1pt}\item[]}
\let\endquotation=\endlist
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist

\def\descriptionlabel#1{\hspace\labelsep \bf #1}
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
 \let\makelabel\descriptionlabel}}
\let\enddescription\endlist
\newdimen\descriptionmargin
\descriptionmargin=3em


\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \else \newpage \fi \thispagestyle{empty}\c@page\z@}
\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}

\arraycolsep 5pt \tabcolsep 6pt \arrayrulewidth .4pt \doublerulesep 2pt
\tabbingsep \labelsep
\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = 1pt

\newcounter{part}
\newcounter {chapter}
\newcounter {section}[chapter]
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]

\def\thepart {\Roman{part}}
\def\thechapter {\arabic{chapter}}
\def\thesection {\thechapter.\arabic{section}}
\def\thesubsection {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}
\def\theparagraph {\thesubsubsection.\arabic{paragraph}}
\def\thesubparagraph {\theparagraph.\arabic{subparagraph}}
\def\@chapapp{Chapter}


\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{0}


\def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{Table of Contents\@mkboth{CONTENTS}{CONTENTS}}
 \@starttoc{toc}\if@restonecol\twocolumn\fi}
\def\l@part#1#2{\addpenalty{-\@highpenalty}
 \addvspace{2.25em plus 1pt} \begingroup
 \@tempdima 3em \parindent \z@ \rightskip \@pnumwidth \parfillskip
-\@pnumwidth
 {\large \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
 \nobreak \endgroup}

\def\l@chapter#1#2{\pagebreak[3]
 \vskip 0em plus 1pt \@tempdima 1.5em \begingroup
 \parindent \z@ \rightskip \@pnumwidth
 \parfillskip -\@pnumwidth
 \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
 \endgroup}
\def\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
\def\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\def\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\def\l@paragraph{\@dottedtocline{4}{10em}{5em}}
\def\l@subparagraph{\@dottedtocline{5}{12em}{6em}}


\newif\if@restonecol
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@
\columnsep 35pt\twocolumn[\@makeschapterhead{Index}]
 \addcontentsline{toc}{part}{INDEX} 
\@mkboth{INDEX}{INDEX}\thispagestyle{chapcover}\parindent\z@
 \parskip\z@ plus .3pt\relax\let\item\@idxitem}
\def\@idxitem{\par\hangindent 40pt}
\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
\def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}

\def\footnoterule{\kern-3\p@
 \hrule width .4\columnwidth
 \kern 2.6\p@}
\@addtoreset{footnote}{chapter}
\long\def\@makefntext#1{\parindent 1em\noindent
 \hbox to 1.8em{\hss$^{\@thefnmark}$}#1}


\setcounter{topnumber}{2}
\def\topfraction{.7}
\setcounter{bottomnumber}{1}
\def\bottomfraction{.3}
\setcounter{totalnumber}{3}
\def\textfraction{.2}
\def\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}

\long\def\@makecaption#1#2{
 \vskip 10pt
 \setbox\@tempboxa\hbox{#1: #2}
 \ifdim \wd\@tempboxa >\hsize \unhbox\@tempboxa\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil}
 \fi}


\newcounter{figure}[chapter]
\def\thefigure{\thechapter.\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\fnum@figure{Figure \thefigure}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
\newcounter{table}[chapter]
\def\thetable{\thechapter.\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\fnum@table{Table \thetable}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}

\input titlepage.sty

\mark{{}{}}

\if@twoside \def\ps@headings{\let\@mkboth\markboth
\def\@oddfoot{}\def\@evenfoot{}\def\@evenhead{\rm \thepage\hfil \sl
\leftmark}\def\@oddhead{\hbox{}\sl \rightmark \hfil
\rm\thepage}\def\chaptermark##1{\markboth {\uppercase{\ifnum \c@secnumdepth
>\m@ne
 \@chapapp\ \thechapter. \ \fi ##1}}{}}\def\sectionmark##1{\markright
{\uppercase{\ifnum \c@secnumdepth >\z@
 \thesection. \ \fi ##1}}}}
\else \def\ps@headings{\let\@mkboth\markboth
\def\@oddfoot{}\def\@evenfoot{}\def\@oddhead{\hbox {}\sl \rightmark \hfil
\rm\thepage}\def\chaptermark##1{\markright {\uppercase{\ifnum \c@secnumdepth
>\m@ne
 \@chapapp\ \thechapter. \ \fi ##1}}}}
\fi
\def\ps@myheadings{\let\@mkboth\@gobbletwo
\def\@oddhead{\hbox{}\sl\rightmark \hfil
\rm\thepage}\def\@oddfoot{}\def\@evenhead{\rm \thepage\hfil\sl\leftmark\hbox
{}}\def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}}

\def\ps@chapcover{\let\@mkboth\@gobbletwo
		\def\@oddhead{\hbox{}\hfil\rm\thepage}
	\def\@oddfoot{}
	\def\@evenhead{\rm\thepage\hfil\hbox{}}
	\def\@evenfoot{}}


\def\today{\ifcase\month\or
 January\or February\or March\or April\or May\or June\or
 July\or August\or September\or October\or November\or December\fi
 \space\number\day, \number\year}
\@addtoreset{equation}{chapter}
\def\theequation{\thechapter.\arabic{equation}}


\ps@plain \pagenumbering{arabic} \onecolumn \if@twoside\else\raggedbottom\fi

\def\@part[#1]#2{\ifnum \c@secnumdepth >-2\relax \refstepcounter{part}
\addcontentsline{toc}{part}{\thepart \hspace{1em}#1}\else
\addcontentsline{toc}{part}{#1}\fi \markboth{}{}
 \ifnum \c@secnumdepth >-2\relax \huge\bf\hPB Part \thepart
\par \vskip 20pt \fi \Huge \bf\hPB #1\@endpart}
\def\@endpart{\par\egroup \vfil\newpage \if@twoside \hbox{}
\thispagestyle{empty}
 \newpage
 \fi \if@tempswa \twocolumn \fi}
\def\@spart#1{\Huge \bf\hPB #1\@endpart}

\def\@makechapterhead#1{ \vspace*{20pt} { \parindent 0pt
\raggedright
 \ifnum \c@secnumdepth >\m@ne \huge\bf\hPB \@chapapp{}
\thechapter \par
 \vskip 20pt \fi \Huge \bf\hPB #1\par
 \nobreak \vskip 30pt } }

\def\@makeschapterhead#1{ \vspace*{20pt} { \parindent 0pt
\raggedright
 \Huge \bf\hPB #1\par
 \nobreak \vskip 30pt } }

\def\chapter{\clearpage \thispagestyle{chapcover} \global\@topnum\z@
\@afterindentfalse \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
 \refstepcounter{chapter}
 \typeout{\@chapapp\space\thechapter.}
 \addcontentsline{toc}{chapter}{\protect
 \numberline{\thechapter}#1}\else
 \addcontentsline{toc}{chapter}{#1}\fi
 \chaptermark{#1}
 \if@twocolumn
\@topnewpage[\@makechapterhead{#2}]
 \else \@makechapterhead{#2}
 \@afterheading \fi}
\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]
 \else \@makeschapterhead{#1}
 \@afterheading\fi}

\tolerance=10000              % prevents overfull boxes

%--- Special CDS & SIMBAD macros
%

\raggedbottom

%           Special fonts
%

\def\fpp{\bf}     %   keyboard input
\def\fvv{\bf\em}  %   parameterized keyboard input
\def\ttc{\tt}     %   tty mode
\def\hPB{\relax}  %   huge bold face

%

\newcommand{\largearraystretch}{\renewcommand{\arraystretch}{1.5}}
                  % controls interline space in tables
\newcommand{\medarraystretch}{\renewcommand{\arraystretch}{1.25}}
\newcommand{\smallarraystretch}{\renewcommand{\arraystretch}{1}}

\newcommand{\CarriageReturn}{[{C}\hspace{-0.037cm}{R}]}
\def\meta#1{$\langle${\it#1}$\rangle$}  % <Text within angle brackets>
\def\Ctrl#1{\meta{Ctrl-{\tt #1}}}  	% Control Character
\def\Esc{\meta{{\em Escape}}}		% The Escape key

\newcommand{\prompt}[1]{{\tt \hspace{1cm} #1}}
\newcommand{\reply}[1]{{\tt \hspace{.25cm}{\fpp #1}}\par}
\newcommand{\prompto}[1]{{\tt #1}}
\newcommand{\replyo}[1]{{\tt {\fpp #1}}}

\newenvironment{classdescr}[2]  % class-name,short description
          {\vspace{1cm}\small
           \begin{tabular}{|p{2cm}|p{4cm}|p{9cm}|}           \hline
             \multicolumn{1}{|c|}{{\Large\bf #1}}&
                  \multicolumn{2}{|c|}{#2}\\  \hline   \hline
           \index{!agent/#1}
             verb&parameters&description\\ \hline
          }%
          {
           \hline
           \end{tabular}
          }

\newcommand{\method}[3]{
          {\bf\small #1}\index{#1}&{\small #2}&{\small #3}\\}

\newenvironment{itemlist}[4]    % leftmargin,labelwidth,labelsep,rightmargin
         {\begin{list}{}{\leftmargin #1cm \rightmargin #4cm 
                         \labelwidth #2cm \labelsep #3cm}
         }%
         {
          \end{list}
         }

\newenvironment{alternative}
         {\smallarraystretch
          $ \left\{ \begin{array}{c}
         }%
         {\end{array} \right\} $
          \largearraystretch
         }

\newcommand{\agent}[1]{{\it #1}\ }
\newcommand{\verbe}[1]{{\it #1}\ }

\newcommand{\command}[3]        % agent,verb,parameters
           {{\fpp ``#1\quad #2\quad #3''}}

\newcommand{\keyword}[1]        % keyword writting
           {\underline{#1}\index{#1}}
\newcommand{\default}[1]        % default writting
           {{\bf\fvv #1}}
\newcommand{\optional}[1]       % optional parameter writting
           {{\tt [}#1{\tt ]}}

\newcommand{\formatinstr}[3]    % nom parametres, description, exemple
           {\vspace{.4cm}
            {\bf #1}
            \par
            #2
            \par
            {\em Example:}\\
            #3
           }

\newcommand{\filtercriteria}[4] % nom,parametres,description,exemple
           {\vspace*{.4cm}\index{#1}
            {\bf #1} #2
            \par
            #3
            \par
            {\em Example:}\\
            #4
           }

%
%       Definition of aligned lists
%
\def\begalist#1{\begin{list}{}{\settowidth{\leftmargin}{#1\quad}%
                \labelsep=0.75em\labelwidth=\leftmargin%
                \addtolength{\labelwidth}{-\labelsep}%
                \parsep=0pt\topsep=\parskip\itemsep=\parskip}
                }
\def\endalist{\end{list}}

\def\sup#1{$^{#1}$}
\def\sub#1{$_{#1}$}

\def\see{{\em see}\ }
\def\etal{{\em et al.}}
\def\ie{{\em i.e.}\ }
\def\eg{{\em e.g.}\ }
\def\etc{{\em etc.}}
\def\deg{$^\circ$}
\def\d{{^\circ}}			% degree, in Math mode
 
%------------------------------------------------------------------------
%--- style parameters for page. defined LaTeX book p 163
\oddsidemargin   0.5cm     % origine: 1in
\evensidemargin  0.0cm     % origine: 1in
\marginparwidth   2cm
\marginparsep     .5cm
\topmargin       -1.5cm
\headheight       1cm
\headsep          1.5cm
         \textheight      21cm            
          \textwidth       15cm
\topskip          1cm
\footheight       1cm
\footskip         1cm
%--- style parameters for paragraph. defined in LaTeX book p 155
\parindent 0pt
\parskip   1.3ex
%\largearraystretch

\pagestyle{headings}

