%% (c) 1993-2002 by Polish TeX Users Group (GUST), <http://www.gust.org.pl>
%%
%% This work may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX
%% distribution.  Either version 1.0 or, at your option, any later
%% version.
%%
%% Supplementary file to LaTeX2e class file `gust.cls' for formating documents 
%% for publishing in GUST bulletin, the official newsletter of the Polish TeX
%% Users Group.  See `gust.cls' for more information. 
%%
%% For newest version see: http://www.gust.org.pl/BIUL
%%
%% The original version of this file was produced from the .web sources:
%%
%  FTANGLE v1.40, created with UNIX on "Thursday, November 4, 1993 at 12:10." 
%  COMMAND LINE: "ftangle -v -# cmn cmn"
%  RUN TIME: "Monday, November 22, 1993 at 14:38."
%  WEB FILE:    "cmn.web"
%  CHANGE FILE: "cmn.ch"

%  (Continued via @O to cmn.sty.)

% Change history:
% 15/1/2002 (v. 1.1): first public release
%

\def\fileversion{v1.1}
\def\filedate{15 January 2002}

\message{File `GUSTCMN.DEF' \fileversion \space\space <\filedate>^^J}

\def\makeescape#1{\catcode`#1=0 }
\def\makebgroup#1{\catcode`#1=1 }
\def\makeegroup#1{\catcode`#1=2 }
\def\makemath#1{\catcode`#1=3 }
\def\makealign#1{\catcode`#1=4 }
\def\makeeol#1{\catcode`#1=5 }
\def\makeparm#1{\catcode`#1=6 }
\def\makesup#1{\catcode`#1=7 }
\def\makesub#1{\catcode`#1=8 }
\def\makeignore#1{\catcode`#1=9 }
\def\makespace#1{\catcode`#1=10 }
\def\makeletter#1{\catcode`#1=11 }
\def\makeother#1{\catcode`#1=12 }
\def\makeactive#1{\catcode`#1=13 }
\def\makecomment#1{\catcode`#1=14 }

\def\makeatletter{\catcode`\@=11 }
\chardef\other=12
\def\makeatother{\catcode`\@=\other}

\def\savecat#1{%
  \expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}}
\def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname}

\savecat\@
\makeletter\@

\def\SaveCS#1{%
  \def\scratch{\expandafter\let\csname saved@@#1\endcsname}%
  \expandafter\scratch\csname#1\endcsname}
\def\RestoreCS#1{%
  \def\scratch{\expandafter\let\csname#1\endcsname}%
  \expandafter\scratch\csname saved@@#1\endcsname}

\def\plainstyle{plain}
\def\latexstyle{latex}
\ifx\styloaded@\undefined\let\styloaded@\plainstyle\fi

\def\AllTeX{(\La)\TeX}
\def\AMS{American Mathematical Society}
\def\AmS{{\the\textfont2 A}\kern-.1667em\lower.5ex\hbox
        {\the\textfont2 M}\kern-.125em{\the\textfont2 S}}
\def\AmSTeX{\AmS-\TeX}
\def\aw{A\kern.1em-W}
\def\AW{Addison\kern.1em-\penalty\z@\hskip\z@skip Wesley}
\def\BibTeX{{\rm B\kern-.05em{\smc i\kern-.025emb}\kern-.08em\TeX}}
\def\CandT{{\sl Computers \& Typesetting}}
\def\DVItoVDU{DVIto\kern-.12em VDU}
\def\eplain{{\tt eplain}}
\def\GUSTB{{\rm GUST\/}}
\def\FTANGLE{{\tt FTANGLE}}
\def\FWEAVE{{\tt FWEAVE}}
\def\JTeX{\leavevmode\hbox{\lower.5ex\hbox{J}\kern-.18em\TeX}} % Japanese TeX
\def\JoT{{\sl The Joy of \TeX}}
\def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em\the\scriptfont2 A}%
    \kern-.2em\lower.376ex\hbox{\the\textfont2 M}\kern-.125em
    {\the\textfont2 S}-\TeX}
%MW 
\def\La{L%\kern-.36em%
        {\sbox\z@ L%
         \kern-.57\wd\z@
         \vbox to\ht\z@{\hbox{$\m@th$%
                            \csname S@\f@size\endcsname
                            \fontsize\sf@size\z@
                            \math@fontsfalse\selectfont
                            A}%
                      \vss}%
        }}
\DeclareRobustCommand\LaTeX{\La\kern-.15em\TeX}
%% for Robert McGaffey
\def\LaMeX{{\rm L\kern-.345em\raise.3ex\hbox{\sc a}\kern-.16em
     M\kern-.111em\lower.6ex\hbox{E}\kern-.075emX}}
%% the  \LaMeX logo
\def\f@sl{\fontdimen1\the\font}
\def\nM@X{M\kern-.111em\lower.6ex\hbox{E}\kern-.075emX}
\def\sM@X{M\kern-.25em\lower.6ex\hbox{E}\kern-.075emX}
\def\MeX{\ifnum\f@sl=0 \nM@X \else \sM@X \fi}
\def\Mc{\setbox\TestBox=\hbox{M}M\vbox to\ht\TestBox{\hbox{c}\vfil}}
\font\manual=logo10 % font used for the METAFONT logo, etc.
\def\MF{{\manual META}\-{\manual FONT}}
\def\mf{{\smc Metafont}}
\def\MFB{{\sl The \slMF book}}
\def\mtex{T\kern-.1667em\lower.5ex\hbox{\^E}\kern-.125emX}
%%       multilingual (INRS) \TeX
\def\pcMF{\leavevmode\raise.5ex\hbox{p\kern-.3ptc}MF}
\def\PCTeX{PC\thinspace\TeX}
\def\pcTeX{\leavevmode\raise.5ex\hbox{p\kern-.3ptc}\TeX}
\def\Pas{Pascal}
\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC}
\def\PiCTeX{\PiC\kern-.11em\TeX}
\def\plain{{\tt plain}}
\def\POBox{P.\thinspace O.~Box }
\def\POBoxTUG{\POBox\unskip~9506, Providence, RI~02940}
\def\PS{{Post\-Script}}
\def\SC{Steering Committee}
\def\SliTeX{{\rm S\kern-.06em{\smc l\kern-.035emi}\kern-.06em\TeX}}
\def\slMF{\MF}
\def\stTeX{{\smc st\rm\kern-0.13em\TeX}}
\def\TANGLE{{\tt TANGLE}}
\def\TB{{\sl The \TeX book}}
\def\TP{{\sl \TeX\/}: {\sl The Program\/}}
\def\TeX{T\hbox{\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX}}
\def\TeXhax{\TeX hax}
%%       Don Hosek
\def\TeXMaG{\TeX M\kern-.1667em\lower.5ex\hbox{A}\kern-.2267emG}
\def\TeXtures{{\it Textures}}
\def\TeXXeT{\TeX--X\kern-.125em\lower.5ex\hbox{E}\kern-.1667emT}
\def\tubfont{\sl}               % redefined in other situations
\def\gustfont{\sl}
\def\TUB{{\tubfont TUGboat\/}}
\def\TUG{\TeX\ \UG}
\def\UG{Users Group}
\def\UNIX{{\smc unix}}
\def\VAX{\leavevmode\hbox{V\kern-.12em A\kern-.1em X}}
\def\VorTeX{V\kern-2.7pt\lower.5ex\hbox{O\kern-1.4pt R}\kern-2.6pt\TeX}
\def\XeT{\leavevmode\hbox{X\kern-.125em\lower.424ex\hbox{E}\kern-.1667emT}}
\def\WEB{{\tt WEB}}
\def\WEAVE{{\tt WEAVE}}

\newlinechar=`\^^J
\normallineskiplimit=1pt

\clubpenalty=10000
\widowpenalty=10000
\pretolerance=3000
\tolerance=4000
\hbadness=4000
\vbadness=1000
\brokenpenalty=5000
\adjdemerits=1000000
\doublehyphendemerits=1000000
\finalhyphendemerits=4000000

\def\NoParIndent{\parindent=\z@}
\newdimen\normalparindent        \normalparindent=20pt
\def\NormalParIndent{\global\parindent=\normalparindent}
\NormalParIndent

\def\BlackBoxes{\overfullrule=5pt }
\def\NoBlackBoxes{\overfullrule=\z@ }
\def\newline{\hskip\z@ plus \pagewd \break}
\def\nohyphens{\hyphenpenalty\@M\exhyphenpenalty\@M}

\newbox\T@stBox                 \newbox\TestBox
\newcount\T@stCount             \newcount\TestCount
\newdimen\T@stDimen             \newdimen\TestDimen
\newif\ifT@stIf                 \newif\ifTestIf

\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }

\ifx\styloaded@\plainstyle
  \let\@@input\input
  \def\iinput#1{\@@input#1 }
  \def\@inputcheck{\if\@nextchar\bgroup
    \expandafter\iinput\else\expandafter\@@input\fi}
  \def\input{\futurelet\@nextchar\@inputcheck}
\fi

\newif\iftop@           \newif\ifbot@
\def\topsmash{\top@true\bot@false\smash@}
\def\botsmash{\top@false\bot@true\smash@}
\def\smash{\top@true\bot@true\smash@}
\def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}%
        \else\let\next\makesm@sh\fi \next }
\def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@}

\long\def\ulap#1{\vbox to \z@{\vss#1}}
\long\def\dlap#1{\vbox to \z@{#1\vss}}

\def\xlap#1{\hbox to \z@{\hss#1\hss}}
\long\def\ylap#1{\vbox to \z@{\vss#1\vss}}
\long\def\zlap#1{\ylap{\xlap{#1}}}

\def\basezero{\baselineskip\z@skip \lineskip\z@skip}

\def\nullhrule{\hrule height\z@ depth\z@ width\z@ }
\def\nullvrule{\vrule height\z@ depth\z@ width\z@ }

\def\makestrut[#1;#2]{\vrule height#1 depth#2 width\z@ }

\newcount\dow
\def\dowcomp{{\count3 \month  \advance\count3 -14  \divide\count3 12
  \advance\count3 \year  \count4 \month  \advance\count4 10
  \divide\count4 -13  \multiply\count4 12  \advance\count4 10
  \advance\count4 \month  \multiply\count4 13  \advance\count4 -1
  \divide\count4 5  \advance\count4 \day  \advance\count4 77
  \count2 \count3  \divide\count2 100  \multiply\count2 -100
  \advance\count2 \count3  \multiply\count2 5  \divide\count2 4
  \advance\count4 \count2  \count2 \count3  \divide\count2 -2000
  \advance\count4 \count2  \count2 \count3 \divide\count2 400
  \advance\count4 \count2  \count2 \count3 \divide\count2 -100
  \multiply\count2 2  \advance\count4 \count2  \count2 \count4
  \divide\count2 7  \multiply\count2 -7  \advance\count4 \count2
  \global\dow \count4}}


\def\dayname{\dowcomp  \ifcase\dow niedziela\or  poniedzia\l ek\or wtorek\or
  \'sroda\or czwartek\or pi\k atek\else sobota\fi}

\def\today{\dayname, \number\day.\number\month.\number\year}


\newcount\hours
\newcount\minutes
\def\SetTime{\hours=\time
        \global\divide\hours by 60
        \minutes=\hours
        \multiply\minutes by 60
        \advance\minutes by-\time
        \global\multiply\minutes by-1 }
\SetTime
\def\now{\number\hours:\ifnum\minutes<10 0\fi\number\minutes}

\def\Now{\today\ \now}

\newif\ifPrelimDraft            \PrelimDraftfalse

\def\midrtitle{\ifPrelimDraft {{\tensl brudnopis, \Now}}\fi}

\newdimen\PreTitleDrop   \PreTitleDrop=\z@

\newskip\AboveTitleSkip  \AboveTitleSkip=12pt
\newskip\BelowTitleSkip  \BelowTitleSkip=8pt

\newdimen\strulethickness       \strulethickness=.6pt
\def\sthrule{\hrule height\strulethickness depth \z@ }
\def\stvrule{\vrule width\strulethickness }

\newdimen\stbaselineskip        \stbaselineskip=18pt

\newif\ifPutMarginBox % TP
\PutMarginBoxtrue % TP

%% |#1| --- title,
%% |#2| --- box on the margin
\def\SectionTitle#1#2{%
  \par \SecTitletrue
  \penalty-1000
  \secsep
  \setbox0=
  \vbox{%
    \sthrule
    \hbox{%
      \stvrule
      \vbox{\hsize=2\stfontwidth%
        \advance\stfontwidth by -2\strulethickness
        \raggedcenter
        \def\\{\unskip\break}%
        \bdingbatfont
        \makestrut[2\stfontheight;\z@]
        #2%
        \makestrut[\z@;\stfontheight]\endgraf
        }%
      \stvrule }
    \sthrule }
  \setbox1=
  \vbox{%
    \sthrule
    \hbox{%
      \stvrule
      \vbox{%
        \advance\hsize by -2\strulethickness
        \raggedcenter
        \def\\{\unskip\break}%
        \sectitlefont
        \makestrut[2\stfontheight;\z@]
        #1%
        \makestrut[\z@;\stfontheight]\endgraf
        }%
      \stvrule }
    \sthrule }
%%
  \ifodd\ifx\thisstyle\latexstyle\c@page\else\pageno\fi
     \hbox to 0pt{\box1\quad\ifnum\xcol=1%
     \kern\pagewd\kern-\colwd\fi
     \ifPutMarginBox\box0\fi\hss}
  \else
    \hbox to 0pt{\box1\hss%
     \ifPutMarginBox\box0\fi\quad\ifnum\xcol=2
     \kern\pagewd\kern-\colwd\fi}
  \fi
%%
  \nobreak
  \vskip\baselineskip }

\def\secsep{\vskip \baselineskip}

\newif\ifSecTitle
\SecTitlefalse

\newdimen\raggedskip    \raggedskip=\z@
\newdimen\raggedstretch \raggedstretch=5em
\newskip\raggedparfill  \raggedparfill=\z@ plus 1fil

\def\raggedspaces{\spaceskip=.3333em \relax \xspaceskip=.5em \relax }

%% Some applications may have to add stretch, in order to avoid all overfull 
%boxes.

\def\raggedright{%
  \nohyphens
  \rightskip=\raggedskip plus\raggedstretch \raggedspaces
  \parfillskip=\raggedparfill }
\def\raggedleft{%
  \nohyphens
  \leftskip=\raggedskip plus\raggedstretch \raggedspaces
  \parfillskip=\z@skip }
\def\raggedcenter{%
  \nohyphens
  \leftskip=\raggedskip plus\raggedstretch
  \rightskip=\leftskip \raggedspaces
  \parindent=\z@ \parfillskip=\z@skip }

\def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip }

\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi}

\def~{\unskip\nobreak\ \ignorespaces} % \AmSTeX\ value

\def\newbox{\alloc@4\box\chardef\insc@unt}   % remove |\outer|
\def\boxcs#1{\box\csname#1\endcsname}
\def\setboxcs#1{\setbox\csname#1\endcsname}
\def\newboxcs#1{\expandafter\newbox\csname#1\endcsname}

\def\gobble#1{}

\def\vellipsis{%
  \leavevmode\kern0.5em
  \raise1pt\vbox{\baselineskip6pt\vskip7pt\hbox{.}\hbox{.}\hbox{.}}
  }

\def\bull{\vrule height 1ex width .8ex depth -.2ex } % square bullet
\def\cents{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}}
\def\Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}}

\def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em
                /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces}
\def\sfrac#1/#2{\leavevmode\kern.1em
        \raise.5ex\hbox{\the\scriptfont\z@ #1}\kern-.1em
        /\kern-.15em\lower.25ex\hbox{\the\scriptfont\z@ #2}}

\def\thinskip{\hskip 0.16667em\relax}
\def\endash{--}
\def\emdash{\endash-}
\def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
\def\dash{\d@sh\nobreak\endash}
\def\Dash{\d@sh\nobreak\emdash}
\def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}}
\def\rdash{\d@sh\nobreak\endash}
\def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}}
\def\Rdash{\d@sh\nobreak\emdash}

\def\hyph{-\penalty\z@\hskip\z@skip }

\def\slash{/\penalty\z@\hskip\z@skip }        % "breakable" slash

\newcount\issueseqno            \issueseqno=-1

%%%\def\v@lx{\gdef\volx{Zeszyt~\volno~(\issno)}}
%%%\def\volyr{}
%%%\def\volno{}
%%%\def\vol#1,#2.{\gdef\volno{#1\unskip}%
%%%        \gdef\issno{\ignorespaces#2\unskip}%
%%%        \setbox\TestBox=\hbox{\volyr}%
%%%        \ifdim \wd\TestBox > .2em \v@lx \fi }

\def\v@lx{\gdef\volx{Zeszyt~\zeszytno}}
\def\volyr{}
\def\zeszytno{}
\def\zeszyt#1.{\gdef\zeszytno{#1\unskip}%
        \setbox\TestBox=\hbox{\volyr}%
        \ifdim \wd\TestBox > .2em \v@lx \fi }

\def\issdate #1,#2.{\gdef\issdt{#1 #2}\gdef\volyr{#2}%
        \gdef\bigissdt{{\smc\uppercase{#1}} #2}%
        \setbox\TestBox=\hbox{\zeszytno}%
        \ifdim \wd\TestBox > .2em \v@lx \fi }

%%%\vol 0, 0.              % volume, issue.
\zeszyt 0.              % number
\issdate Lipiec, 1410.  % month, year of publication (necessary empty line 
%below!)

\ifx\styloaded@\plainstyle
  \def\tubissue#1(#2){\TUB~#1, no.~#2}
  \def\gbissue#1(#2){\GUSTB~#1, Zeszyt~#2}
\else
  \def\tubissue#1#2{\TUB~#1, no.~#2}
  \def\gbissue#1#2{\GUSTB~#1, Zeszyt~#2}
\fi

\def\xEdNote{{\tenuit \ifnum\language=\polish%
Od redakcji:\else Editorial note:\enspace\fi}}

\def\theauthor#1{\csname theauthor#1\endcsname}
\def\theaddress#1{\csname theaddress#1\endcsname}
\def\thenetaddress#1{\csname thenetaddress#1\endcsname}

\newcount\count@@
\def\@defaultauthorlist{%
   \count@=\authornumber
   \advance\count@ by -2
   \count@@=0
   \loop
   \ifnum\count@>0
      \advance\count@@ by 1
      \ignorespaces\csname theauthor\number\count@@\endcsname\unskip,
      \advance\count@ by -1
   \repeat
   \count@=\authornumber
   \advance\count@ by -\count@@
   \ifnum\authornumber>0
     \ifnum\count@>1
       \count@=\authornumber
       \advance\count@ by -1
       \ignorespaces\csname theauthor\number
           \count@\endcsname\unskip\ \AndNextAuthor
       \fi
     \ignorespaces\csname theauthor\number\authornumber\endcsname\unskip
   \fi
  }

\def\AndNextAuthor{\ifnum\language=0\& \else i \fi} % tp
\def\signature#1{\def\@signature{#1}}
%%\def\@signature{\@defaultsignature}
%%
%%\def\@defaultsignature{%
%%  \count@=0
%%  \loop
%%  \ifnum\count@<\authornumber
%%    \medskip
%%    \advance\count@ by \@ne
%%    \signaturemark
%%    \theauthor{\number\count@}\\
%%    \leavevmode\theaddress{\number\count@}\\
%%  \repeat
%%  }

\def\@signature{\@defaultsignature}

\def\@defaultsignature{%
  \count@=0
  \loop
  \ifnum\count@<\authornumber
    \medskip
    \advance\count@ by \@ne
    \signaturemark
    \theauthor{\number\count@}\\
    \thenetaddress{\number\count@}\\
    \leavevmode\theaddress{\number\count@}\\
  \repeat
  }


\newdimen\signaturewidth   \signaturewidth=12pc
\def\makesignature{%
  \par
  \penalty9000
  \vskip\medskipamount
  \rightline{%
    \vbox{\hsize\signaturewidth \ninepoint \raggedright
      \parindent \z@ \everypar={\hangindent 1pc }
      \parskip \z@skip
      \def\|{\unskip\hfil\break}%
      \def\\{\endgraf}%
      \rm
      \@signature}}
  }

\def\signaturemark{\leavevmode\llap{$\diamond$\enspace}}

\hyphenation{man-u-script man-u-scripts}

\restorecat\@

\endinput

