%-----------------------------------------------------------------------------
% Beginning of TMNA.sty

%-----------------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This file is designed to work with AMS-TeX version 2.1.
%
% The TeX code defined here will modify the AMS-TeX 2.1 preprint style to
% the TMNA style.  It sets up the correct page size, puts a logo and a
% copyrightline on the first page, and formats the top matter, headings and
% references appropriately.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%  First input the preprint style

\def\next{AMSPPT}\ifx\styname\next
  \else\input amsppt.sty\fi

\widowpenalty=10000
\clubpenalty=10000
\brokenpenalty=10000

\catcode`\@=11

%  Set the page size and first-page sink appropriately

\indenti=3pc
\rosteritemwd21pt % approximately the width of (iii) in 10 point text

\pageheight{47pc}
\pagewidth{29pc}
\parindent=16\p@
\def\pretitle{\vskip8.75pc}
\def\preauthor{\vskip30\p@}
\def\prededicatory{\vskip1.75pc}

\def\thededicatory@{}
% (mjsz)

\def\dedicatory #1\enddedicatory{%
        \gdef\thededicatory@{{\eightpoint\it\raggedcenter@#1\endgraf}}}

%\def\dedicatory #1\enddedicatory{\def\preabstract{{\medskip
%  \eightpoint\it \raggedcenter@#1\endgraf}}}
%%%% endmjsz

\def\thesubmittedby@{}
\def\submittedby #1\endsubmittedby{%
        \gdef\thesubmittedby@{{\eightpoint\sl
          \raggedcenter@{\rm (}Submitted by #1\/{\rm )}\endgraf}}}

%  Page numbers and running heads are provided by default, as defined
%  in AMSPPT.STY.  Headline text is centered, and page numbers are
%  positioned at the outside corners.  To suppress page numbers and/or
%  running heads, include \NoPageNumbers and/or \NoRunningHeads in the
%  input file, as appropriate.

%  In TMNA, we do want running heads.  We must provide suitable
%  fonts definitions.  TMNA specs call for 7-point headlines,
%  but \sevenpoint is not defined in AMSPPT.STY; substitute \eightpoint,
%  which is defined.

\def\foliofont@{\eightrm}
\def\headlinefont@{\eightpoint\smc}
\def\authorfont{\eightpoint\smc}

%       define  a logo for the upper left-hand corner

\def\jourlogo{\vbox to0pt{%
        \sixrm \baselineskip6pt
        \parindent0pt \frenchspacing
 {\sixbf T}opological {\sixbf M}ethods in {\sixbf N}onlinear
 {\sixbf A}nalysis \hfil\break
         Journal of the Juliusz Schauder Center \hfil\break
        {\sixrm   Volume \cvol@, \cvolyear@, \pagefrom@--\pageto@}
        \par\vss}}

%       macros to be put into the \topmatter for the logo
\def\nvol#1{\gdef\nvol@{\ignorespaces#1\unskip}}
\def\pagefrom#1{\gdef\pagefrom@{\ignorespaces#1\unskip}}
\def\pageto#1{\gdef\pageto@{\ignorespaces#1\unskip}}
\def\mrecvd#1{\gdef\mrecvd@{\ignorespaces#1\unskip}}
%\def\FinVolNo@{{\eightpoint\sl TMNA\/} {\eightpoint\smc:
%                Volume \cvol@ -- \cvolyear@ -- N$^{\text{o}}$\,\nvol@}}
\def\FinVolNo@{{\eightpoint\sl TMNA\/} {\eightpoint\smc:
                Volume \cvol@\ -- \cvolyear@\ -- N$^{\text{o}}$\,\nvol@}}
\def\cvol#1{\gdef\cvol@{\ignorespaces#1\unskip}}
\def\cvolyear#1{\gdef\cvolyear@{\ignorespaces#1\unskip}}
\def\cyear#1{\gdef\cyear@{\ignorespaces#1\unskip}\cyear@@#100000\end@}

\def\cyear@@#1#2#3#4#5\end@{\gdef\cyearmodc@{#3#4}%
        \gdef\cyearmodcHold@{#3#4}}

\nvol{00}
\pagefrom{1}
\pageto{1}
\mrecvd{MONTH 00, 0000}
\cvol{00}
\cyear{0000}
\cvolyear{0000}

\font\sixsy=cmsy6

\def\copyrightline@{\baselineskip1.75pc
    \rightline{%
        \vbox{\sixrm \textfont2=\sixsy \baselineskip 7pt
            \halign{\hfil##\cr
            \copyright\cyear@\ Juliusz Schauder Center for Nonlinear
Studies\cr
}}}}

\def\cyearmodc#1{\gdef\cyearmodc@{\ignorespaces#1\unskip}}

%  The copyright block takes the place of the AMS-TeX logo; otherwise the
%  AMSPPT.STY output routine does what we want.

\let\logo@=\copyrightline@

%  TMNA text font is 10-on-14; AMSPPT.STY is 10-on-12

   \addto\tenpoint{\normalbaselineskip14\p@
 \abovedisplayskip6\p@ plus6\p@ minus0\p@
 \belowdisplayskip6\p@ plus6\p@ minus0\p@
 \abovedisplayshortskip0\p@ plus3\p@ minus0\p@
 \belowdisplayshortskip2\p@ plus3\p@ minus0\p@
 \ifsyntax@
 \else
  \setbox\strutbox\hbox{\vrule height9\p@ depth4\p@ width\z@}%
  \setbox\strutbox@\hbox{\vrule height8\p@ depth3\p@ width\z@}%
 \fi
 \normalbaselines\rm}

\font@\titlebf=cmbx10
\font@\titlei=cmmi10
\font@\titlesy=cmsy10
\def\titlefont{\normalbaselineskip14\p@
 \textonlyfont@\bf\titlebf
 \ifsyntax@\else
  \textfont\z@\titlebf  \scriptfont\z@\tenrm  \scriptscriptfont\z@\sevenrm
  \textfont\@ne\titlei  \scriptfont\@ne\teni  \scriptscriptfont\@ne\seveni
  \textfont\tw@\titlesy \scriptfont\tw@\tensy \scriptscriptfont\tw@\sevensy
  \textfont\thr@@\tenex \scriptfont\thr@@\tenex
\scriptscriptfont\thr@@\tenex
 \fi
 \normalbaselines\titlebf}

\def\leftheadtext{\let\savedef@\leftheadtext
  \def\leftheadtext##1{\let\leftheadtext\savedef@
    \leftheadtoks\expandafter{\frills@{##1}}%
    \mark{\the\leftheadtoks\noexpand\else\the\rightheadtoks}
    \ifsyntax@\setboxz@h{\def\\{\unskip\space\ignorespaces}%
        \headlinefont@##1}\fi}%
  \nofrillscheck\leftheadtext}
\def\rightheadtext{\let\savedef@\rightheadtext
  \def\rightheadtext##1{\let\rightheadtext\savedef@
    \rightheadtoks\expandafter{\frills@{##1}}%
    \mark{\the\leftheadtoks\noexpand\else\the\rightheadtoks}%
    \ifsyntax@\setboxz@h{\def\\{\unskip\space\ignorespaces}%
        \headlinefont@##1}\fi}%
  \nofrillscheck\rightheadtext}

\def\title{\let\savedef@\title
 \def\title##1\endtitle{\let\title\savedef@\let\\=\cr
   \global\setbox\titlebox@\vtop{\titlefont\bf
   \raggedcenter@\frills@\expandafter\uppercase{##1}\endgraf}%
 \ifmonograph@ \edef\next{\the\leftheadtoks}\ifx\next\empty
    \leftheadtext{\eightpoint\smc ##1}\fi
 \fi
 \edef\next{\the\rightheadtoks}\ifx\next\empty
        \rightheadtext{\eightpoint\smc ##1}\fi
 }%
 \nofrillscheck\title}

%  authors are set in smc

\def\author#1\endauthor{\global\setbox\authorbox@
 \vbox{\tenpoint\raggedcenter@
  \expandafter
\smc
{\ignorespaces#1\endgraf}}\relaxnext@
 \edef\next{\the\leftheadtoks}%
 \ifx\next\empty\leftheadtext{\eightpoint\smc #1}\fi}

\def\address#1\endaddress{%
  \def\\{\newline}%
  \global\advance\addresscount@\@ne
  \expandafter\gdef\csname address\number\addresscount@\endcsname
  {\vskip12\p@ minus6\p@\noindent\eightpoint{\ignorespaces#1}\par}}

%  Current addresses as well as permanent ones must be accommodated.
%  Check on the skip before the address; it may be a fixed 6pt.
%  \smallskip has been assumed before the current address, as that
%  is what has been used for \email.

\def\email{\let\savedef@\email
  \def\email##1\endemail{\let\email\savedef@

\toks@{\def\usualspace{{\it\enspace}}\endgraf\smallskip\indent\eightpoint}%
  \toks@@{##1\par}%
  \expandafter\xdef\csname email\number\addresscount@\endcsname
  {\the\toks@\frills@{{\noexpand\it E-mail address\noexpand\/}:%
     \noexpand\enspace}\the\toks@@}}%
  \nofrillscheck\email}

\newbox\checkbox
\setbox\checkbox=\hbox{{\ignorespaces\eightpoint\it
                \indent Current address}:\space}

\def\curraddr{\let\savedef@\curraddr
  \def\\{\newline}%
  \def\curraddr##1\endcurraddr{\let\curraddr\savedef@
  \toks@\expandafter\expandafter\expandafter{%
       \csname address\number\addresscount@\endcsname}%
  \toks@@{\hangindent\wd\checkbox##1\par}%
  \expandafter\xdef\csname address\number\addresscount@\endcsname
  {\the\toks@\endgraf\noexpand\nobreak
    \smallskip\indent\noexpand\eightpoint{\noexpand\rm
    \frills@{{\noexpand\it Current address\noexpand\/}:\space}%
    \def\noexpand\usualspace{\space}\the\toks@@\unskip}}}%
  \nofrillscheck\curraddr}

%% abstract (mjsz)

 \newbox\abstractbox@
 \def\abstract{\let\savedef@\abstract
 \def\abstract{\let\abstract\savedef@
 \setbox\abstractbox@\vbox\bgroup\noindent$$\vbox\bgroup
 \def\envir@end{\endabstract}\advance\hsize-2\indenti
 \def\usualspace{\enspace}\eightpoint \noindent
 \frills@{{\smc Abstract.\enspace}}}%
 \nofrillscheck\abstract}
 \def\endabstract{\par\unskip\egroup$$\egroup}

%  \keywords, \subjclass and \thanks appear as first-page footnotes.
%  Reformat the top matter for TMNA style.

\outer\def\endtopmatter{
\add@missing\endabstract % as in amsppt.sty (mjsz)
\edef\next{\the\leftheadtoks}\ifx\next\empty
  \expandafter\leftheadtext\expandafter{\the\rightheadtoks}\fi
 \ifmonograph@\else
   \ifx\thesubjclass@\empty\else \makefootnote@{}{\thesubjclass@}\fi
   \ifx\thekeywords@\empty\else \makefootnote@{}{\thekeywords@}\fi
   \ifx\thethanks@\empty\else \makefootnote@{}{\thethanks@}\fi
 \fi
\hrule\vskip14pt
  \jourlogo
  \pretitle
  \unvbox\titlebox@
  \topskip10pt% reset to normal value
  \preauthor
  \ifvoid\authorbox@\else \unvbox\authorbox@\fi
  \prededicatory
   \ifx\thesubmittedby@\empty\else
        \thesubmittedby@\fi
   \centerline{\vbox{\hrule width 10pc}}%
   \ifx\thededicatory@\empty\vskip14\p@\else
        \vskip6\p@\thededicatory@\fi
%% add abstract (mjsz)
  \preabstract
  \ifvoid\abstractbox@\else
  \vskip1.5pcplus.5pc\unvbox\abstractbox@ \fi
%% endadd (mjsz
  \ifvoid\tocbox@\else\vskip1.5pc plus.5pc \unvbox\tocbox@\fi
  \prepaper
  \vskip24\p@ plus12\p@ minus0\p@}

%  Heading styles are different from AMSPPT.STY:
%  \heading is bold, otherwise the same.
%  \subheading and \subsubheading are indented, otherwise the same.

\def\headfont@{\bf}
\def\refheadfont@{\smc}
\let\varindent@\indent

\def\endroster{\relaxnext@
 \revert@envir\endroster % restore \envir@end
 \par\leftskip@% End the paragraph, and restore the \leftskip.
 \global\rosteritemwd21\p@ % restore default value
 \penalty-50 \vskip-\parskip\smallskip% Add a good break and
 \DN@{\ifx\next\Runinitem\let\next@\relax
  \else\nextRunin@false\let\item\plainitem@% Otherwise, set
   \ifx\next\par% moreover, if \endroster is followed by \par,
    \DN@\par{\everypar\expandafter{\the\everypartoks@}}%
   \else% but if the \endroster isn't followed by a new paragraph,
    \DN@{\noindent\everypar\expandafter{\the\everypartoks@}}%
  \fi\fi\next@}%
 \FN@\next@}

%  Indentation for \proclaim, \demo, etc., are the same as for \subhead,
%  and are taken care of by \varindent.
%  \proclaim head font is small caps, and the text font is italic.
%  \demo is preceded by a \smallskip and followed by none.

\def\qed{\ifhmode\unskip\nobreak\fi\hfill
  \ifmmode\square\else$\m@th\square$\fi}

\def\proclaimheadfont@{\smc}

\let\proclaim\relax
\outer\def\proclaim{%
  \let\savedef@\proclaim \let\proclaim\relax
  \add@missing\endroster \add@missing\enddefinition
  \add@missing\endproclaim \envir@stack\endproclaim
 \def\proclaim##1{\restoredef@\proclaim
   \penaltyandskip@{-100}\medskipamount\varindent@
   \def\usualspace{{\proclaimheadfont@\enspace}}\proclaimheadfont@
   \ignorespaces##1\unskip\frills@{.\enspace}%
  \it\ignorespaces}%
 \nofrillscheck\proclaim}
\def\endproclaim{\revert@envir\endproclaim \par\rm
  \penaltyandskip@{55}\medskipamount}

\def\demoheadfont@{\smc}
\def\remarkheadfont@{\smc}

\def\enddemo{\par\revert@envir\enddemo \endremark\vskip\z@ plus 1\p@\relax}

\def\remark{\let\savedef@\remark \let\remark\relax
  \add@missing\endroster \add@missing\endproclaim
  \envir@stack\endremark
  \def\remark##1{\restoredef@\remark
    \penaltyandskip@\z@\smallskipamount
  {\def\usualspace{{\remarkheadfont@\enspace}}%
  \varindent@\remarkheadfont@\ignorespaces##1\unskip%
  \frills@{.\enspace}}\rm
  \ignorespaces}\nofrillscheck\remark}
\def\demo{\DN@{\ifx\next\nofrills
    \DN@####1####2{\remark####1{####2}\envir@stack\enddemo
      \ignorespaces}%
  \else
    \DN@####1{\remark{####1}\envir@stack\enddemo\ignorespaces}%
  \fi
  \next@}%
\FN@\next@}

%  Roman type is needed within the statement of theorems for numerals,
%  fences, labels, etc. .

\def\rom#1{{\rm #1}}

%  \Refs differs only in the skip below, which is 8pt (default=6pt)
%  Before reiterating definition only for that, check to see if it matters.

\def\citefont@{\rm}

\let\Refs\relax
\outer\def\Refs{\add@missing\endroster \add@missing\endproclaim
 \let\savedef@\Refs \let\Refs\relax % because of \outer-ness
 \def\Refs##1{\restoredef@\Refs
   \aboveheadskip28\p@ plus 2\p@
   \if\notempty{##1}\penaltyandskip@{-200}\aboveheadskip
     \begingroup \raggedcenter@\refheadfont@
       \ignorespaces##1\endgraf\endgroup
     \penaltyandskip@\@M\belowheadskip
   \fi
   \begingroup\def\envir@end{\endRefs}\refsfont@\sfcode`\.\@m
   }%
 \nofrillscheck{\csname Refs\expandafter\endcsname
  \frills@{{References}}}}

\def\endref{%
  \setbox\tw@\box\thr@@
  \makerefbox?\thr@@{\endgraf\egroup}%
  \endref@
  \endgraf
  \smallskip
  \endgroup
  \keyhook@
  \global\let\keyhook@\empty@ % \global to conserve save stack
}

%  Some patches are needed, to make \yr appear in translation information,
%  and to avoid the spurious unboxing of some empty boxes.

%  Add current address to \enddocument

\outer\def\enddocument{\par% \par will do a runaway check for \endref
  \add@missing\endRefs
  \add@missing\endroster \add@missing\endproclaim
  \add@missing\enddefinition
  \add@missing\enddemo \add@missing\endremark \add@missing\endexample
 \ifmonograph@ % do nothing
 \else
\vskip14pt
\rightline{\sevenit Manuscript received \mrecvd@}
 \nobreak
 \thetranslator@
 \count@\z@ \loop\ifnum\count@<\addresscount@\advance\count@\@ne
 \csname address\number\count@\endcsname
 \csname email\number\count@\endcsname
 \repeat
\fi
 \vfill
\leftline{\FinVolNo@}
\supereject\end}

      %==========================================================%
      %  SET MAXIMUM WIDTH OF KEY {\widestnumber\key{[...]}}
      %  BEFORE \redefine \keyformat
      %==========================================================%

    \widestnumber\key{[99]}
    \redefine\keyformat#1{\hfil{[#1]\quad}}

\def\refstyle#1{\uppercase{%
  \if#1A\relax \def\keyformat##1{\hfil{[##1]\quad}}%
  \else\if#1B\relax
    \def\keyformat##1{\aftergroup\kern
              \aftergroup-\aftergroup\refindentwd}%
    \refindentwd\parindent
 \else\if#1C\relax
   \def\keyformat##1{\hfil{[##1]\quad}}%
 \fi\fi\fi}% end of \uppercase
}

\def\by{\makerefbox\by\bybox@\authorfont}
\let\manyby\by % for backward compatibility

\def\captionfont@{\eightpoint\smc}
\def\topcaption#1#2\endcaption{%
  {\dimen@\hsize \advance\dimen@-\captionwidth@
   \eightpoint\rm\raggedcenter@ \advance\leftskip.5\dimen@
\rightskip\leftskip
  {\captionfont@#1}%
  \if\notempty{#2}.\enspace\ignorespaces#2\fi
  \endgraf}\nobreak\bigskip}
\def\botcaption#1#2\endcaption{%
  \nobreak\bigskip
  \setboxz@h{\captionfont@#1\if\notempty{#2}.\enspace\eightpoint\rm#2\fi}%
  {\dimen@\hsize \advance\dimen@-\captionwidth@
   \leftskip.5\dimen@ \rightskip\leftskip
   \noindent \ifdim\wdz@>\captionwidth@
   \else\hfil\fi
  {\captionfont@#1}%
  \if\notempty{#2}.\enspace\eightpoint\rm#2\fi\endgraf}}

\TagsOnLeft

\catcode`\@=13

\def\amsversion{2.1}
\endinput

%-----------------------------------------------------------------------------
% End of TMNA.sty
%-----------------------------------------------------------------------------
