File r38/doc/help/redindex.sty artifact 5dadc88210 part of check-in 5f584e9b52


\ifx\ps@REDUCEreference\undefined
  \else\endinput\fi

\typeout{Document style option `redindex' version 1.3 -- RmS 1999/04/15}

%
% Change: 1999/04/15: make it work with both very old and new array.sty
  
\ifx\COMPATNOTE\undefined
  \@@input reduce.sty\relax
\fi

\ifx\extrarowheight\undefined
  \@@input array.sty\relax
\fi

%\newcommand{\REDUCE}{REDUCE}

\if@twoside\else\ds@twoside\fi

\def\ps@REDUCEreference{\let\@evenhead\@empty\let\@oddhead\@empty
  \def\@oddfoot{\rm \hfil REDUCE Reference\ \ \thepage}%
  \def\@evenfoot{\rm \thepage\ \ REDUCE Reference\hfil}}

\newcommand{\indexentry}[1]{\newpage
 \markboth{#1}{#1}\section*{#1}}

\def\in@#1#2{%
 \def\in@@##1#1##2##3\in@@{%
  \ifx\in@##2\in@false\else\in@true\fi}%
 \in@@#2#1\in@\in@@}
\newif\ifin@

\newtoks\double@list
\double@list={}
\def\add@to@double@list#1{\double@list=\expandafter{\the\double@list#1\relax}}
\def\check@double@list#1{%
  \def\@tempa{\in@{#1}}%
  \expandafter\@tempa\expandafter{\the\double@list}}

\catcode`\_=12
\def\other@underscore{_}
\catcode`\_=\active
\def_{\ifmmode\expandafter\sb\else\_\fi}
\def\redindex@sanitize{\@sanitize\catcode`\ =10\relax
                                 \catcode`\\=0\relax
                                 \catcode`\{=1\relax
                                 \catcode`\}=2\relax
                                 \catcode`\_=\active}

\def\check@multiple@label#1,#2,#3{% #1 is name, #2 is type, #3 is value
  \@ifundefined{r@#1}{\newlabel@{#1}{#3}}{%
     \typeout{Double found: #1, list: \the\double@list}%
     \check@double@list{#1}\ifin@\else\global\add@to@double@list{#1}\fi}}


\let\newlabel@=\newlabel
\def\newlabel{\begingroup
  \redindex@sanitize
  \newlabel@@
}

\def\newlabel@@#1#2{%\tracingall
%  \begingroup
    \let_=\other@underscore
    \newlabel@{#1}{#2}%
    \in@,{#1}\ifin@\check@multiple@label#1,{#2}\fi
  \endgroup}

\let\enddocument@=\enddocument
\def\enddocument{\let_=\other@underscore
    \immediate\write\@mainaux{\string\add@to@double@list{\the\double@list}}%
    \enddocument@}

\def\enddocument{\@checkend{document}\clearpage\begingroup
\if@filesw
  \let_=\other@underscore
  \immediate\write\@mainaux{\string\add@to@double@list{\the\double@list}}%
  \immediate\closeout\@mainaux
\def\global\@namedef##1##2{}\def\newlabel{\@testdef r}%
\def\bibcite{\@testdef b}\@tempswafalse \makeatletter
\redindex@sanitize\input \jobname.aux
\if@tempswa \@@warning{Label(s) may have changed.  Rerun to get
cross-references right}\fi\fi\endgroup\deadcycles\z@\@@end}
 
\def\@testdef #1#2#3{\def\@tempa{#3}\expandafter \ifx \csname #1@#2\endcsname
 \@tempa  \else
 \typeout{Testing #2 failed: old: \csname #1@#2\endcsname <-> new: #3}
 \@tempswatrue \fi}

\newcount\newitem@penalty
\newskip\newitem@preskip
\newskip\newitem@postskip
\newskip\newitem@headsep

%\def\newitem#1#2{% #1 is type, #2 is name
\def\newitem#1[#2]#3{% #1 is type, #2 is ref key, #3 is name
  \endgroup
  \ifvmode\else\par\fi
  \addpenalty\newitem@penalty
  \addvspace\newitem@postskip
  \hrule
  \nobreak
  \vskip \newitem@preskip
  \hbox to\hsize{\LARGE\bf\sf \uppercase{#3}\hfil #1}%
  \nobreak
  \vskip \newitem@headsep
  \begingroup
    \let_=\other@underscore
    \index{#3}\index{#1!#3}%
    \def\_{_}\label{#2,#1}\nobreak
  \endgroup}

\newitem@penalty=\@beginparpenalty
\newitem@postskip = 20pt plus 5pt minus 5pt 
\newitem@preskip = 10pt
\newitem@headsep = 5pt

\parskip = 5pt plus 2pt
\parindent = 0pt


\def\newitemEnv#1{%
  \expandafter\edef\csname#1\endcsname{%
    \begingroup\noexpand\redindex@sanitize\csname#1@\endcsname}%
  \@namedef{#1@}{\@dblarg{\newitem{#1}}}%
  \@namedef{end#1}{}}

\newitemEnv{Command}
\newitemEnv{Operator}
\newitemEnv{Function}
\newitemEnv{Switch}
\newitemEnv{Variable}
\newitemEnv{Declaration}
\newitemEnv{Package}
\newitemEnv{Concept}
\newitemEnv{Constant}
\newitemEnv{Type}
\newitemEnv{info}
\newitemEnv{Introduction}

\newskip\itemsec@sep
\newcount\itemsec@penalty

\itemsec@penalty=\@beginparpenalty
\itemsec@sep=5pt

\def\begin@itemsection#1{\par\everypar={}%
  \addvspace\itemsec@sep
  \addpenalty\itemsec@penalty
  \hbox{\large\bf\sf #1}\nobreak}

\def\end@itemsection{\par}

\def\Comments{\begin@itemsection{Comments}}
\let\endComments\end@itemsection

\begingroup
  \catcode`\^=\active \catcode`\&=\active \catcode`\_=\active
  \def\x{\def\setup@special@chars{\catcode`\^=\active \let^=\special@uparrow
                                  \catcode`\&=\active \let&=\special@ampersand}%
         \def\protectspecialchars{\def^{\char`\^}\def_{\char`\_}}%
         \def\normalspecialchars{\let^=\sp\let_=\sb}%
         \def\activespecialchars{\let^=\special@uparrow}}
\expandafter\endgroup\x

\let\begin@=\begin
\let\end@=\end

\def\@ifstar#1#2{\def\@tempa{#1}\def\@tempb{#2}\futurelet
    \@tempc\@if@star@}

\def\@if@star@{\ifx \@tempc*\def\@tempd*{\@tempa}\else\let\@tempd\@tempb\fi\@tempd}

\def\Examples{\begin@itemsection{Examples}%
     \setup@special@chars\protectspecialchars%\tracingall
     \def\{{{\tt\char`\{}}%
     \def\}{{\tt\char`\}}}%
     \def\arraystretch{1.5}%
     \extrarowheight=1mm
     \def\end{%
       \ifnum\catcode`\{=12\relax \expandafter \special@ampersand\fi\end@}%
     \let \protect \relax
     \lineskip \z@
     \baselineskip \z@
     \frenchspacing
     \m@th
     \def\\{\relax\iffalse{\fi\ifnum 0=`}\fi
	     \@ifstar {\@xarraycr\noalign{\penalty\@M}}\@xarraycr}
     \def\@xarraycr{\@ifnextchar [%
       \@argarraycr {\ifnum 0=`{}\fi\cr}}
     \def\@argarraycr[##1]{\ifnum0=`{}\fi\ifdim ##1>\z@
       \expandafter\@xargarraycr\else
       \expandafter\@yargarraycr\fi{##1}}
     \def\@xargarraycr##1{\unskip
       \@tempdima ##1\advance\@tempdima \dp\@arstrutbox
       \vrule \@depth\@tempdima \@width\z@ \cr}
     \def\@yargarraycr##1{\cr\noalign{\vskip ##1}}
     \let\par=\@empty
     \setbox \@arstrutbox \hbox{\vrule
             \@height \arraystretch \ht \strutbox
             \@depth \arraystretch \dp \strutbox
             \@width \z@}%
      \ialign\bgroup\@arstrut
        \global\@startnewrowfalse
        \catcode`\{=12\relax
        \catcode`\}=12\relax
        \catcode`\%=12\relax
        \catcode`\$=12\relax
        \catcode`\~=12\relax
        \setbox0=\hbox\bgroup\protect\tt##\unskip\hfil\egroup\checkcolwidth
        &$\quad\protect\Rightarrow\quad$%
        \global\setbox0=\hbox\bgroup\activespecialchars##\egroup\checkcolwidtho\cr
}

\def\endExamples{\crcr\egroup\end@itemsection}

%\def\Examples{\begin@itemsection{Examples}%
%     \setup@special@chars\protectspecialchars%\tracingall
%     \def\{{{\tt\char`\{}}%
%     \def\}{{\tt\char`\}}}%
%     \def\arraystretch{1.5}%
%     \extrarowheight=1mm
%     \def\end{%
%       \ifnum\catcode`\{=12\relax \expandafter \special@ampersand\fi\end@}%
%     \begin{tabular}[b]{>{%\protectspecialchars
%                       \global\@startnewrowfalse
%                       \catcode`\{=12\relax
%                       \catcode`\}=12\relax
%                       \catcode`\%=12\relax
%                       \catcode`\$=12\relax
%                       \setbox0=\hbox\bgroup\protect\tt}l<{\egroup\checkcolwidth}%
%                     >{$\quad\protect\Rightarrow\quad$%
%                       \global\setbox0=\hbox\bgroup\activespecialchars}l%
%                     <{\egroup\checkcolwidtho}}}
%\def\endExamples{\end{tabular}\end@itemsection}

\def\explanationi#1{\multicolumn{2}{p{0.95\textwidth}}{%
  \normalspecialchars \em#1}}
\let\explanation=\explanationi
\def\explanationo#1{\parbox[t]{0.95\MaxOutputWidth}{\em#1}}

\def\start@new@row@for@output{%
  \multicolumn{2}{@{\protect\DoOutputIndent}l}{\box0}}

\def\DoOutputIndent{
  \dimen@=\textwidth
  \advance\dimen@ -\wd\z@
  \ifdim\dimen@>\OutputIndent \dimen@=\OutputIndent
    \else\ifdim\dimen@<\z@ \dimen@=\OutputIndent\fi\fi
  \hspace{\dimen@}}

\newdimen\OutputIndent \OutputIndent=10mm

\begingroup \catcode `|=0 \catcode `[= 1
\catcode`]=2 \catcode `\{=12 \catcode `\}=12
\catcode`\\=12 |gdef|@bixample#1\end{Bigexample}[#1|end[Bigexample]]
|endgroup

\def\Bigexample{\begin@itemsection{Example}%
  \@verbatim \frenchspacing\@vobeyspaces \@bixample}
\def\endBigexample{\endtrivlist\end@itemsection}

\def\Related{\begin@itemsection{Related information}\begin{description}}
\def\endRelated{\end{description}}

\newif\if@startnewrow \@startnewrowfalse
\newif\if@startneworow \@startneworowfalse
\def\special@uparrow#1{\vbox{\vskip2\p@
                             \hbox{\raise.8\normalbaselineskip\hbox{#1}}}}
\def\special@ampersand{&\if@startnewrow\expandafter\startnewrow\fi\tt}

\def\startnewrow{\omit\\&\global\@startnewrowfalse}

\newdimen\maxexamplecolwidth
\maxexamplecolwidth = 5cm

\def\checkcolwidth{%
  \ifdim\wd0>\maxexamplecolwidth
    \hbox to\maxexamplecolwidth{\unhbox0\hss}%
    \hskip-25pt\null
    \global\@startnewrowtrue
  \else \unhbox0 \fi
}

\def\checkcolwidtho{%
  \ifdim\wd0>\MaxOutputWidth
    \global\everycr={\start@new@row@for@output
      \global\everycr={}\cr}%
%    \global\@startneworowtrue
  \else \unhbox0 \fi
}


\def\multilineinput{\catcode`\{=1 \catcode`\}=2
  \begin{minipage}[b]{\maxexamplecolwidth}\@vobeyspaces\obeylines}
\def\endmultilineinput{\end{minipage}}

\def\multilineoutput#1{\begin{minipage}[t]{#1}\@vobeyspaces\obeylines
                       \baselineskip =1.5\baselineskip}
\def\endmultilineoutput{\end{minipage}}

\newdimen\MaxOutputWidth \MaxOutputWidth=7cm
\def\multilineoutput#1{%
  \vtop\bgroup\@parboxrestore
  \lineskip \baselineskip
  \@tempswafalse
  \def\par{\if@tempswa\egroup
              \ifdim\wd0>\z@\box0\fi
              \setbox0=\hbox\bgroup\fi
           \@tempswatrue}
  \@vobeyspaces\obeylines
  \setbox0=\hbox\bgroup}

\def\endmultilineoutput{\egroup\ifdim\wd0>\z@\box0\fi \egroup}

\def\multilineinput{%
  \vbox\bgroup\@parboxrestore
  \def\end{\catcode`\{=1 \catcode`\}=2 \end@}%
  \@tempswafalse
  \def\par{\if@tempswa\egroup
              \ifdim\wd0>\z@\box0\fi
              \setbox0=\hbox\bgroup\fi
           \@tempswatrue}
  \@vobeyspaces\obeylines
  \addvspace{.8\baselineskip}%
  \setbox0=\hbox\bgroup}

\let\endmultilineinput=\endmultilineoutput

\def\privateshowbox{\showboxbreadth\maxdimen\showboxdepth\maxdimen\showbox}

\def\rfrac#1#2{\begingroup
  \lineskip2pt \baselineskip \z@
  \setbox0=\hbox{\tt#1}%
  \setbox1=\hbox{\tt#2}%
  \setbox2=\hbox{\tt-}%
  \ifdim \wd0>\wd1 \dimen@=\wd0 \else \dimen@=\wd1 \fi
  \advance \dimen@ by2\wd2\relax
  \setbox3=\vtop{\hbox to\dimen@{\hss\unhcopy0\hss}%
                 \hbox to\dimen@{\leaders\copy2\hfill}%
                 \hbox to\dimen@{\hss\unhcopy1\hss}}%
  \dimen@=\dp0 \advance\dimen@ by\ht2 \advance\dimen@ by\lineskip
  \@tempdima=\ht3 \advance \@tempdima by\dimen@ \ht3=\@tempdima
  \@tempdima=\dp3 \advance \@tempdima by-\dimen@ \dp3=\@tempdima
%  \privateshowbox3
  \box3
 \endgroup}

\def\def@protected#1#2{%
  \expandafter\edef\csname#1\endcsname{\begingroup\noexpand\redindex@sanitize
                                       \catcode32=10
                                       \csname#1@\endcsname}%
  \@namedef{#1@}##1{\endgroup#2}}

\def@protected{name}{\mbox{\tt#1}}
%\let\keyw=\name
%\let\operator=\name
\def@protected{nameindex}{\name{#1}\index{#1}\label{#1}}
\def@protected{hyperref}{#1}
%\def@protected{nameref}{\name{#1}, p.~\pageref{#1}}
\def@protected{nameref}{\name{#1}}
\def@protected{see}{(see \hyperref@{#1})}
\def@protected{key}{\fbox{\sf #1}}
\def@protected{arg}{\mbox{\it #1}}

\newdimen \Syntaxindent \Syntaxindent=2mm
\def\Syntax{\large
   \list{}{\leftmargin\Syntaxindent\def\({$(}\def\){)$}%
           \mathcode`\ =32768}\item[]}
\def\endSyntax{\endlist}
\def\repeated{$+$}
\def\optional{\relax\ifmmode\ast\else$\ast$\fi}
%\def\meta#1{\mbox{\it#1}}
\def\meta{\begingroup\catcode`\_=\active\meta@}
\def\meta@#1{\ifmmode\mbox\fi{\it#1\/}\endgroup}

\def\alternative{$\displaystyle
  \left\{\begin{tabular}{l}}
\def\endalternative{\end{tabular}\right\}$}

\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus
    -.2ex}{2.3ex plus.2ex}{\reset@font\LARGE\bf}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus-1ex
     minus-.2ex}{1.5ex plus.2ex}{\reset@font\Large\bf}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus
     -1ex minus-.2ex}{1.5ex plus.2ex}{\reset@font\large\bf}}

%%%%
%%%% error message file
%%%%

\def\tableoferrormessages{\@restonecolfalse
  \if@twocolumn\@restonecoltrue\onecolumn\fi
  \chapter*{\contentsname
        \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
  \@starttoc{emg}\if@restonecol\twocolumn\fi}

\def\ErrorMessage#1{%
  \addcontentsline{emg}{#1}}

%%%% conditionals

\def\IFTEX#1#2{#1}

\long\def\INFO#1\end#2{\def\@tempa{#2}\def\@tempb{INFO}%
  \ifx\@tempa\@tempb\else\errmessage{\string\end{#2} not allowed
                                     inside INFO environment.}\@eha\fi
  \end{INFO}}
\def\endINFO{\global\@ignoretrue}

\def\TEX{}
\def\endTEX{\global\@ignoretrue}


\@ifundefined{reset@font}{\let\reset@font\@empty}{}

\pagestyle{REDUCEreference}

\endinput




REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]