%
% Style file to redefine the commands of the cernman style so that
% they can be reformated for ``screen'' versions''
%
% 17 Oct 1992 AS
%
% Last Mod. 14 June 1993 Mg
%
\def\screen@FF{}
\input{screen.sty}
\hyphenchar\the\font=-1
%%%%\def\underline#1{#1}
\renewcommand{\arraystretch}{1.0}
\def\NODOC#1{}
%%
%\renewenvironment{XMP}%  All characters verbatim but { } \
%{\topsep=0pt\partopsep=0pt\itemsep=0pt
%\trivlist \item[]\if@minipage\else\vskip\parskip\fi
%\leftskip\@totalleftmargin\rightskip\z@
%\parindent\z@\parfillskip\@flushglue\parskip\z@
%\@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}%
%\obeylines \tt \catcode``=13 \@noligs
%\@makeother\ \@makeother\$\@makeother\&\@makeother\#\@makeother\^%
%\@makeother\^^K\@makeother\_\@makeother\^^A\@makeother\%\@makeother\~%
%\frenchspacing\@vobeyspaces}{\endtrivlist}
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ????????\parskip=0pt
% Save file as: WEEKDAY.STY            Source: FILESERV@SHSU.BITNET
%% WEEKDAY.STY -- original source: Dimitri Vulis <DLV@CUNYVMS1.BITNET> with
%%  modifications by George D. Greenwade <BED_GDG@SHSU.BITNET>, and gracious
%%  assistance from Bernhard Schroeder <UPK002@DBNRHRZ1.BITNET>, Hunter
%%  Goatley <GOATHUNTER@WKUVX1.BITNET>, and others via INFO-TeX/comp.text.tex.
%%  21-FEB-1991 17:42:37
%%
%% Usage: \weekday{yyyy}{mm}{dd} (where "yyyy" is a year, "mm" is the numeric
%%        equilavent of the month, and "dd" is the specific calendar date
%%        which may be one or two numbers) yields the weekday associated with
%%        the date provided (i.e., Sunday, Monday, ...).  May pass \year,
%%        \month, and \day to generate today's weekday.
%%
%%    --  \weekdaydate{yyyy}{mm}{dd} yields result of \weekday, as well as the
%%        calendar date (i.e., \weekdaydate{1991}{02}{21} yields Thursday,
%%        February 21, 1991).  (NOTE: syntax is changed from \weekdaydisplay
%%        to \weekdaydate to make it a little more rememberable)
%%
%% May be used as a TeX macro or as a LaTeX style, from what I can tell.
%% Please report any enhancements or bugs you come across so they can be
%%    posted in FILESERV's STYle archives.  George <BED_GDG@SHSU.BITNET>
%%
\newcount\wwwy
\newcount\wwwm
\newcount\wwwd
\newcount\wwwc
\newcount\wwwt
\newcount\wwws
 
\def\weekday@{%
\wwwc=\wwwy
\divide\wwwc100\relax
\wwwt=-\wwwc
\multiply\wwwt100\relax
\advance\wwwy\wwwt
\wwws=\wwwy
\multiply\wwws1461\relax
\divide\wwws4\relax
\wwwt=\wwwm
\multiply\wwwt764\relax
\divide\wwwt25\relax
\advance\wwws\wwwt
\advance\wwws\wwwd
\ifnum\wwwm>\tw@\advance\wwws\thr@@\else\weekday@@\fi
\wwwt=-\wwws
\divide\wwwt7\relax
\multiply\wwwt7\relax
\advance\wwws\wwwt
}
 
% By the year 2000 we ought to examine \wwwc as well
 
\def\weekday@@{%
\wwwt=\wwwy
\divide\wwwt4\relax
\multiply\wwwt4\relax
\advance\wwwt-\wwwy
\ifnum\wwwt=\z@\advance\wwws4\else\advance\wwws5\fi
}

 
\def\weekday#1#2#3{% year, month 1--12, day 1--31
\wwwy=#1\relax\wwwm=#2\relax\wwwd=#3\relax \weekday@
\ifcase\wwws Sun\or Mon\or Tue\or Wed\or Thu\or Fri\or Sat\fi}
 
\def\weekdaydate#1#2#3{% year, month 1--12, day 1--31
\wwwy=#1\relax\wwwm=#2\relax\wwwd=#3\relax\weekday@
\ifcase\wwws Sun\or Mon\or Tue\or Wed\or Thu\or Fri\or Sat\fi,\space
\number#3\space
\ifcase #2\or Jan\or Feb\or Mar\or Apr\or May\or Jun\or Jul\or Aug\or Sep\or Oct\or Nov\or Dec\fi\space\number#1} 

\def\MONTH{\ifcase\wwwm \or JANUARY\or FEBRUARY\or MARCH\or ARPIL\or MAY\or 
JUNE\or JULY\or AUGUST\or SEPTEMBER\or OCTOBER\or NOVEMBER\or DECEMBER\fi}

\def\MONTHes#1{\wwwm=#1\relax\MONTH\space%
\advance\wwwm by -1\relax\MONTH\space\advance\wwwm by -1\relax\MONTH\space}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{empty}
\setlength{\footheight}{0mm}
\setlength{\footskip}{0mm}
\let\footnote=\@gobble
\setlength{\headheight}{0mm}
\setlength{\headsep}{0mm}
\let\ttsc=\@gobble
\let\tensy=\empty
\let\Stt=\@gobbletwo
\let\ttbf=\@gobble
\let\conbreak=\@gobble
\def\psboxit#1#2{\fbox{#2}}
\def\spbox#1{\fbox{#1}}
\def\PScommands{}
%%%%\def\epsfig#1{}% disable EPSFIG
\@ifundefined{psdraft}{}{\psdraft\psnodraftbox} % Call is, if any
\input version.sty
\let\sideways=\empty
\let\endsideways=\relax
\excludeversion{example}
\let\endexample=\relax
\let\graypara=\empty
\let\endgraypara=\par

\let\save@XMP=\XMP
\let\save@endXMP=\endXMP

\def\XMP{\par\bigskip\save@XMP}
%
\def\XMPt#1{\par\bigskip\par\begin{center}#1\end{center}\par\bigskip\par\save@XMP}
\def\endXMPt{\par\bigskip\par\save@endXMP}
\def\XMPfont#1{\XMP}\let\endXMPfont=\endXMP
\def\XMPfrac#1{\XMP}\let\endXMPfrac=\endXMP

\let\save@fbox=\fbox
\def\fbox#1{\save@fbox{\rule[-\vquant]{0mm}{2\vquant}~#1~}}

\def\Shubr{\@ifnextchar [{\@Shubr}{\@Shubr[ ]}}
\def\@Shubr[#1]#2#3{\begin{center}\fbox{CALL #2 \parbox[t]{.8\linewidth}{#3}}\end{center}%
\label{#2}\index{#2}}
  
\def\Shubrii{\@ifnextchar [{\@Shubrii}{\@Shubrii[ ]}}
\def\@Shubrii[#1]#2#3#4#5{\par%#1 tag #2 abb. 1 #3 contents 1 #4 abb. 2 #5 contents 2
\par\centerline{\fbox{CALL #2 #3}\qquad and \qquad \fbox{CALL #4 #5}}%
\label{#2}\index{#2}\label{#4}\index{#4}}

\let\Shubrz=\Shubr

\def\Sfunc{\@ifnextchar [{\@Sfunc}{\@Sfunc[ ]}}
\def\@Sfunc[#1]#2#3{%
 \def\@@Sfunc##1=##2(##3){% Function to parse last argument
  \setbox\@tempboxa\hbox{\quad{\tt##1 = }\small\bf##2}\def\@@Farg{(##3)}}%
 \par\medskip\@@Sfunc#3
 \Length\linewidth
 \advance\Length by -\wd\@tempboxa
 \advance\Length by -4\tabcolsep
\begin{tabular}{lp{\the\Length}}\box\@tempboxa &\tt\@@Farg\end{tabular}
 \label{#2}\index{#2}\medskip\par}% ***** end of \newcommand{\Sfunc}

\def\Sfuncii{\@ifnextchar [{\@Sfuncii}{\@Sfuncii[ ]}}
\def\@Sfuncii[#1]#2#3#4#5{\par%#1 tag #2 abb. 1 #3 contents 1 #4 abb. 2 #5 contents 2
 \def\@@Sfunc##1=##2(##3){% Function to parse last argument
  \setbox0\hbox{\quad{\tt##1 = }{\small\bf##2}{\tt (##3)}\hfill}}%
 \par\@@Sfunc#3\setbox1\hbox{\box0}\@@Sfunc#5
 \hbox to \hsize{\rule[-.9ex]{0ex}{3.1ex}\box1{\rm\quad and\quad}\box0}%
 \label{#2}\index{#2}\label{#4}\index{#4@}\medskip\par}% ***** end of \newcommand{\Sfuncii}


\endinput

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%   for short wrups
%\overfullrule=5pt
%\def\ps@check{%\let\@evefoot=\mymy\let\@oddfoot=\mymy
%\let\@evehead=\mymy\let\@oddhead=\mymy}
%\def\mymy{\message{wd=\the\wd\@outputbox\space %
% dp=\the\dp\@outputbox\space% 
% ht=\the\ht\@outputbox}}
\everymath={%
}
\everydisplay={%
\thinmuskip=0mu\thickmuskip=0mu\spaceskip=0pt\let\qquad=\relax\let\quad=\relax
}

\newwrite\my@write

\def\@include#1 {\clearpage\@@Totalpage\c@Totalpage\advance\@@Totalpage by 1\relax
\begingroup\makeatletter\catcode`\$=12\catcode`\_=12\parskip=0pt\@input{#1.hdr}\endgroup
\par\parindent0pt%
\pagestyle{check}
\setcounter{page}{1}%
\setcounter{section}{1}%
\setcounter{equation}{0}%
\setcounter{footnote}{0}%
\@input{#1.tex}\clearpage
\immediate\openout\my@write #1.hdr
\immediate\write\my@write{\relax}
\immediate\write\my@write{\noexpand\KK{Xfindindex:}{PUB}}
\immediate\write\my@write{\noexpand\KK{Category:}{PROGLIB}}
\immediate\write\my@write{\noexpand\KK{Topic:}{\Vers}}
\immediate\write\my@write{\noexpand\KK{Subject:}{\Subject}}
\immediate\write\my@write{\noexpand\KK{Author:}{\Auth}}
\immediate\write\my@write{\noexpand\KK{Language:}{\Lang}}
\immediate\write\my@write{\noexpand\KK{Library:}{\Libr}}
\immediate\write\my@write{\noexpand\KK{Revision:}{\Revi}}
\immediate\write\my@write{\noexpand\KK{Routid:}{\Rtnr}}
\immediate\write\my@write{\noexpand\KK{Date:}{\Subm}}
\immediate\write\my@write{\noexpand\KK{Submitter:}{\Orig}}
\immediate\write\my@write{\noexpand\KKK{Callable:}{\save@rdef}}
\immediate\write\my@write{\noexpand\KKK{Keywords:}{\save@key}}
%
\immediate\closeout\my@write
\def\Auth{}
\def\Lang{}
\def\Libr{}
\def\Revi{~~~~~~~~~~~}
\def\Rtnr{}
\def\Subm{}
\def\Orig{}
\def\Vers{}
\def\Subject{}
\def\save@key{}
\def\save@rdef{}
}
\newcount\cc@tmp

\def\KK#1#2{\leavevmode\hbox to 11\hquant {#1\hfil} \hbox to 0pt{#2\hss}\par} 
%
\def\KKK#1#2{%
\@tempdima=\textwidth \advance \@tempdima by -12\hquant
\setbox\@tempboxa=\vtop{\hsize=\@tempdima\relax\raggedright#2\par}
\cc@tmp=\ht\@tempboxa 
\advance \cc@tmp by \dp\@tempboxa
%\message{\cc@tmp=\the\cc@tmp ------ \along@v=\the\along@v }
\divide\cc@tmp by \along@v \advance\cc@tmp by 1
%\message{\cc@tmp=\the\cc@tmp}
\parbox[t]{12\hquant}{%
  \loop
#1 
  \ifnum \cc@tmp >1
      ~\\\advance\cc@tmp by -1
  \repeat
}\hfil\box\@tempboxa%\parbox[t]{\@tempdima}{\raggedright#2}
\par
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\Auth{}
\def\Author#1{{\def\protect{\noexpand\noexpand\noexpand}\xdef\Auth{#1}}}\let\Authors=\Author
\def\Lang{}
\def\Language#1{{\def\protect{\noexpand\noexpand\noexpand}\xdef\Lang{#1}}}
\def\Libr{}
\def\library#1{{\def\protect{\noexpand\noexpand\noexpand}\xdef\Libr{#1}}}
\def\Revi{~~~~~~~~~~~}
\def\Revised#1{{\def\protect{\noexpand\noexpand\noexpand}\xdef\Revi{#1}}}
\def\Rtnr{}
\def\Routid#1{{\def\protect{\noexpand\noexpand\noexpand}\xdef\Rtnr{#1}}}    % Routid:
\def\Subm{}
\def\Submitted#1{{\def\protect{\noexpand\noexpand\noexpand}\xdef\Subm{#1}}} % date
\def\Orig{}
\def\Submitter#1{{\def\protect{\noexpand\noexpand\noexpand}\xdef\Orig{#1}}} % Submitter:
\def\Vers{}
\def\Version#1{{\def\protect{\noexpand\noexpand\noexpand}\xdef\Vers{#1}}}   % Itemname:
%
\def\save@key{}
\def\Keywords{\bgroup\@minisanitize\@Keywords}
\def\@Keywords#1{\xdef\save@key{\ifx\save@key\empty\else\save@key\space\fi
#1}\egroup}
%
\def\save@rdef{}
\def\Rdef{\bgroup\@minisanitize\@Rdef}
\def\@Rdef#1{#1\xdef\save@rdef{\ifx\save@rdef\empty\else\save@rdef\space\fi
#1}\egroup}
%\def\Rdef#1{#1\xdef\save@rdef{\ifx\save@rdef\emdpty\else\save@rdef\space\fi#1}}


%%%%%%%%%%%%   Cernhead Command %%%%%%%%%%%%%%%%%%%%%
\renewcommand{\Sectitle}[1]{%
%\immediate\write\@mainaux{Title: \string\end{DLtt}}%
%\immediate\write\@mainaux{Title: \string\section*{#1}}%
%\immediate\write\@mainaux{Title: \string\begin{DLtt}{12345678901}}
}% End of Sectitle

\@ifundefined{Cernhead}{\let\Cernhead=\empty}{}
\def\Subject{}
\renewcommand{\Cernhead}[1]{\xdef\Subject{#1} %  Subject: #1
%  Construct the prologue
\begin{center}
% \begin{tabular*}{\textwidth}{@{}l@{\tabskip\fill}cr@{}}%
%\fbox{\rule[-\vquant]{0mm}{2\vquant}~~\Vers~}&\Title&
%\fbox{\rule[-\vquant]{0mm}{2\vquant}~~\Rtnr}~
% \end{tabular*}\\
% \begin{tabular*}{\textwidth}{@{}ll@{\tabskip\fill}r@{}}
%  \underline{Author(s):}&\Auth&\underline{Library:}   \Libr\\
%  \underline{Submitter:}&\Orig&\underline{Submitted:} \Subm\\
%  \underline{Language:}&\Lang &\underline{Revised:}   \Revi\\
% \end{tabular*}\\[\vquant]%         End of table
% \mbox{\superunder{#1}}\\[\vquant]
\mbox{}\hbox to 4\hquant {\fbox{\rule[-\vquant]{0mm}{2\vquant}~~\Vers~}\hss}%
\hfill \Title \hfill \hspace*{-1sp}%
\hbox to 4\hquant {\hss\fbox{\rule[-\vquant]{0mm}{2\vquant}~~\Rtnr}}\\
  {Author(s):}~\Auth \hfill {Library:} \Libr\\
  {Submitter:}~\Orig \hfill {Submitted:} \Subm\\
  {Language:}~~\Lang \hfill {Revised:} \Revi\\[\vquant]
 \superunder{#1} 
 \end{center}%
}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%        End of Cernhead
\def\Accuracy{\par\bigskip\underline{Accuracy:}\par}%
\def\Errorh{\par\bigskip\underline{Error handling:}\par}%
\def\Examples{\par\bigskip\underline{Examples:}\par}%
\def\Longwr{\par\bigskip\underline{Long Write-up:}\par}%
\def\Method{\par\bigskip\underline{Method:}\par}%
\def\Notes{\par\bigskip\underline{Notes:}\par}%
\def\Refer{\par\bigskip\underline{References:}\par}%
\def\Restrict{\par\bigskip\underline{Restrictions:}\par}%
\def\Source{\par\bigskip\underline{Source:}\par}%
\def\Structure{\par\bigskip\underline{Structure:}\par}%
\def\Timing{\par\bigskip\underline{Timing:}\par}%
\def\Usage{\par\bigskip\underline{Usage:}\par}%
\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    For CNL terminal-readable 
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\chapter{\secdef\s@chapter\@chapter}
\def\s@chapter[#1]#2{\edef\CNL@chapter{#1}\refstepcounter{chapter}}
\def\@chapter#1{\edef\CNL@chapter{#1}}

\def\CNL@chapter{}
\def\CNL@art{}
\def\CNL@aut{}
\def\CNL@key{}
\def\CNL@abs{~}
\def\CNLart#1{\edef\CNL@art{#1}\refstepcounter{section}}
\def\CNLaut#1{\edef\CNL@aut{#1}}
\def\CNLkey#1{\edef\CNL@key{\CNL@key{}\noexpand\par.cm KEY: #1}}
\def\CNLabs{\edef\CNL@abs\bgroup}
\def\endCNLabs{\egroup}
%
\def\CNLmtit{\newpage\vspace*{2\baselineskip}\begingroup\parskip=0pt
.cm CAT: CNL\par
.cm NAM: CNL\CNLnum\space\space\space \thesection\space\CNL@chapter\par
.cm EXP: \CNL@art\par
.cm DAT: \weekdaydate{\year}{\month}{\day}\par
.cm A/R: \CNL@aut\par
\CNL@key\par
.cm KEY: CNL\CNLnum\space \CNLnum\space \MONTHes{\month} \number\year\space
\wwwy=\year \advance \wwwy by -1900\relax \number\wwwy\par
%\@tempdima=\textwidth \advance \@tempdima by -11\hquant
%\setbox\@tempboxa=\hbox to \@tempdima {\CNL@abs}
%\cc@tmp=\ht\@tempboxa \divide\cc@tmp  by \along@v %\advance\cc@tmp by 1
%\message{\cc@tmp=\the\cc@tmp}
%
%\parbox[t]{10\hquant}{%
%  \loop
%.cm ABS: 
%  \ifnum \cc@tmp >1
%      ~\\\advance\cc@tmp by -1
%  \repeat
%}\hfil\parbox[t]{\@tempdima}{\CNL@abs}\par
.cm END:
\bigskip
\bigskip
\begin{center}
~\underline{\CNL@art}~\\[\baselineskip]
~\underline{\CNL@aut}~
\end{center}
\gdef\CNL@art{}
\gdef\CNL@aut{}
\gdef\CNL@key{}
\gdef\CNL@abs{}
\endgroup
}

\def\Artsep{\par\centerline{\rule{.25\textwidth}{1sp}}\medskip}

%\def\Ucom#1{#1}


\endinput
 



