%%% Cut everything above here, and the following blank line.

% nzjm.cls Class for Latex2e
% For New Zealand Journal of Mathematics
% Developed by Paul Bonnington
% p.bonnington@auckland.ac.nz
% Phone +64+9+3737599 ext 6623
%
% Revision 1.12 2016/04/21  hart
% Changed References alignment in toc from centered to left. 
% Used a tocdepth hack to achieve this, probably improvable but it works.
% 
% Revision 1.11 2010/11/22  hart
% \subjclass updated to 2010
%
% Revision 1.10 2008/04/23  hafner
% Changed \cropwidth from 0.2 pt to 0pt
% to make the cropmarks disappear
%
% $Log: nzjm.cls,v $
% Revision 1.9  1999/09/22  hafner
% Made sure that abstract is centered: amsart had drastic
% changes between version 1.2b and 1.2q
%
% Revision 1.8  1997/03/06 01:10:38  bonning
% Adjusted bottom crop marks
%
% Revision 1.7  1996/11/14 20:18:01  bonning
% Change Cite to bold font
%
% Revision 1.6  1996/11/14 20:08:51  bonning
% Penultimate version for first journal run in this style
%
% Revision 1.5  1996/10/30 22:41:15  bonning
% Finalised cropmark revisions
%


\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{nzjm}[1996/11/14 v1.9 NZJM Class]



%\DeclareOption*{\PassOptionsToClass{\CurrentOption}{amsart}}


%\ProcessOptions

\LoadClass[reqno]{amsart}

%%%%%%%%%%%%%%%%%%%
%Sizes (default will be a4paper)

\paperheight 297mm\paperwidth 210mm

\addtolength{\topmargin}{14mm}
\addtolength{\topmargin}{-26pt}
\addtolength{\oddsidemargin}{-5mm}
\addtolength{\evensidemargin}{-5mm}

\textheight 200mm
\textwidth=30pc

\headheight=36pt \headsep=7mm
\footskip=12pt
\topskip=10pt
\columnsep=10pt \columnseprule=0pt
\marginparwidth=90pt
\marginparsep=11pt
\marginparpush=5pt


%%%%%%%%%%%%%%%%%%%%%%
% Cropmarks

\let\xshipout\shipout

\def\shipout{\futurelet\SomeBox\yshipout}

\def\yshipout
    {\ifx\SomeBox\box        \let\next\shipAfterRegister
    \else \ifx\SomeBox\copy \let\next\shipAfterRegister
    \else                  \let\next\shipAfterBox \fi\fi
    \afterassignment\next\setbox0=
    }
\def\shipAfterBox{\aftergroup\shipAfterRegister}

\newdimen\croplength \croplength=5mm
\newdimen\cropsep \cropsep=1mm
\newdimen\cropwidth \cropwidth=0pt

\def\crophrule{\vrule height\cropwidth depth0pt width\croplength}
\def\cropvrule{\vrule width\cropwidth depth0pt height\croplength}

\def\shipAfterRegister
    {\setbox0\vbox
        {\offinterlineskip
        \dimen0\cropsep\advance\dimen0\croplength
        \setbox2\hbox to \wd0
                {
%Amount extra to move left vertical rule to the right
\kern-10mm
\kern-.5\cropwidth
                \cropvrule
%Distance between left  and right vertical rules
                \hskip17.5cm
                \cropvrule
                \kern-.5\cropwidth
%Not used?
\kern0mm
}
        \setbox4\hbox to \wd0{\llap{\crophrule\kern\cropsep
%Amount extra to move left horizontal rule to the left
\kern10mm
}
%Distance between left  and right horizontal rule
\hskip17.45cm

                              \rlap{
%Amount extra to move rigft horizontal rule to the right
\kern-10mm
\kern\cropsep\crophrule}}
%Move whole page down by this amount
\kern5mm
        \kern-\dimen0
        \copy2
        \kern\cropsep\kern-.5\cropwidth
        \copy4
        \kern-.5\cropwidth
        % padding
        \kern0mm
        % the box to be shipped
%first Move whole page back by this amount
\kern-5mm
        \box0
% padding from bottom of text to lower marks
\kern10mm
        % and now the top in reverse
        \kern-.5\cropwidth
        \box4
        \kern-.5\cropwidth\kern\cropsep
        \box2
    }
  \xshipout\box0
\relax}



%%%%%%%%%%%%%
%Top of the page stuff

\def\serieslogo@{\vtop to -8pt{%
  \parindent\z@
{
\fontsize{7.5}{8\p@}\selectfont
\parbox[b]{0.6\textwidth}{{%\footnotesize
        NEW ZEALAND JOURNAL OF MATHEMATICS}\newline
%    \scriptsize
Volume \currentvolume\ (\currentyear), \pagerange\newline
https://doi.org/10.53733/\doinumber\endgraf\vss}}}
}
\def\ISSN{1171-6096}
\def\currentvolume{00}
\def\currentyear{19xx}
\def\pagerange{xx--yy}
\def\doinumber{1234}

%%%%%%%%%%%%%%%


%%%%%%%%%%%%%
%Footnote Stuff
\def\footnoterule{\kern-.4\p@
        \hrule\@width 12pc\kern11\p@\kern-\footnotesep}


\long\def\@footnotetext#1{\insert\footins{%
  \normalfont\footnotesize
  \interlinepenalty\interfootnotelinepenalty
  \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
  \floatingpenalty\@MM \hsize\columnwidth
  \@parboxrestore \parindent\z@ \sloppy
  \edef\@currentlabel{\p@footnote\@thefnmark}%
  \@makefntext{\rule\z@\footnotesep\ignorespaces#1\unskip\strut\par}}}

\renewcommand{\subjclassname}{\textup{2010} \textit{AMS Mathematics
Subject
      Classification:}}

\def\@setsubjclass{%
  {\itshape\subjclassname}\enspace\@subjclass\@addpunct.}


\def\@setkeywords{%
  {\itshape \keywordsname:}\enspace \@keywords\@addpunct.}



%%%%%%%%%%%%%%%%%%%%%%%%
% First Page style

\def\ps@firstpage{\ps@plain
  \def\@oddfoot{\normalfont\scriptsize \hfil    \hfil
      \global\topskip\normaltopskip}%
  \let\@evenfoot\@oddfoot
  \def\@oddhead{\serieslogo@\hss}%
  \let\@evenhead\@oddhead}%


%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%
%Title stuff

\def\@setdate{\centering\footnotesize(Received \@date)}


\def\@setauthors{%
  \begingroup
  \trivlist
  \centering\normalsize \@topsep30\p@\relax
  \advance\@topsep by -\baselineskip
  \item\relax
  \andify\authors
%\uppercasenonmath\authors
\textsc  \authors
  \endtrivlist
  \endgroup
}

\def\maketitle{\par
  \@topnum\z@ % this prevents figures from falling at the top of page 1
%  \@setcopyright
  \uppercasenonmath\shorttitle
  \ifx\@empty\shortauthors \let\shortauthors\shorttitle
  \else \andify\shortauthors \uppercasenonmath\shortauthors \fi
  \begingroup
  \@maketitle
  \toks@\@xp{\shortauthors}\@temptokena\@xp{\shorttitle}%
  \edef\@tempa{\@nx\markboth{\the\toks@}{\the\@temptokena}}\@tempa
  \endgroup
\thispagestyle{firstpage}% this sets first page specifications
  \c@footnote\z@
  \def\do##1{\let##1\relax}%
  \do\maketitle \do\@maketitle \do\title \do\@xtitle \do\@title
  \do\author \do\@xauthor \do\address \do\@xaddress
  \do\email \do\@xemail \do\curraddr \do\@xcurraddr
\do\commby \do\@commby
  \do\dedicatory \do\@dedicatory \do\thanks \do\thankses
  \do\keywords \do\@keywords \do\subjclass \do\@subjclass
}
\def\@maketitle{%
  \normalfont\normalsize
  \let\@makefnmark\relax  \let\@thefnmark\relax
  \ifx\@empty\@subjclass\else \@footnotetext{\@setsubjclass}\fi
  \ifx\@empty\@keywords\else \@footnotetext{\@setkeywords}\fi
  \ifx\@empty\thankses\else \@footnotetext{%
    \def\par{\let\par\@par}\@setthanks}\fi
  \@mkboth{\@nx\shortauthors}{\@nx\shorttitle}%
  \global\topskip30\p@\relax % 5.5pc  "  "  "    "    "
  \@settitle
  \ifx\@empty\authors \else \@setauthors \fi
  \ifx\@empty\@date\else \@setdate \fi
\ifx\@empty\@dedicatory
  \else
    \baselineskip18\p@
    \vtop{\centering{\footnotesize\itshape\@dedicatory\@@par}%
      \global\dimen@i\prevdepth}\prevdepth\dimen@i
  \fi
  \@setabstract
  \normalsize
  \if@titlepage
    \newpage
  \else
    \dimen@34\p@ \advance\dimen@-\baselineskip
    \vskip\dimen@\relax
  \fi
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Other Page Styles



  \def\@evenhead{
      \rlap{\normalsize \thepage}\hfil
\normalfont\scriptsize\leftmark{}{}\hfil}%
  \def\@oddhead{\normalfont\scriptsize \hfil
      \rightmark{}{}\hfil \llap{\normalsize\thepage}}%
  \let\@mkboth\markboth


%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Address Stuff

\def\@setaddresses{\par
  \nobreak \begingroup
\footnotesize
  \def\author##1{\nobreak\addvspace\bigskipamount}%
  \def\\{\newline \ignorespaces}%
  \interlinepenalty\@M
  \def\address##1##2{\begingroup
    \par\addvspace\bigskipamount\noindent
    \@ifnotempty{##1}{\ignorespaces##1\unskip}%
    {\rmfamily\newline\ignorespaces##2}\par\endgroup}%
  \def\curraddr##1##2{\begingroup
    \@ifnotempty{##2}{\nobreak\noindent{\itshape Current address}%
      \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      ##2\par\endgroup}}%
  \def\email##1##2{\begingroup
    \@ifnotempty{##2}{\nobreak  \noindent %{\itshape E-mail address}%
      %  \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
      \rmfamily##2\par\endgroup}}%
  \addresses
  \endgroup
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Section headings and stuff


\def\@sect#1#2#3#4#5#6[#7]#8{%
  \edef\@toclevel{\ifnum#2=\@m 0\else\number#2\fi}%
  \ifnum #2>\c@secnumdepth \let\@secnumber\@empty
  \else \@xp\let\@xp\@secnumber\csname the#1\endcsname\fi
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \edef\@svsec{\ifnum#2<\@m
        \@ifundefined{#1name}{}{%
          \ignorespaces\csname #1name\endcsname\space}\fi
        \@nx\textup{%
      \@nx\bfseries
          \csname the#1\endcsname.}\enspace
    }%
  \fi
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@ % then this is not a run-in section heading
    \begingroup #6\relax
    \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty\@M #8\par}%
    \endgroup
    \ifnum#2>\@m \else \@tocwrite{#1}{#8}\fi
  \else
  \def\@svsechd{#6\hskip #3\@svsec
    \@ifnotempty{#8}{\ignorespaces#8\unskip
        \@addpunct.}%
    \ifnum#2>\@m \else \@tocwrite{#1}{#8}\fi
  }%
  \fi
  \global\@nobreaktrue
  \@xsect{#5}}










\def\section{\@startsection{section}{1}%
  \z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
  {\bfseries\raggedright}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Abstract

\renewenvironment{abstract}{%
  \ifx\maketitle\relax
    \ClassWarning{\@classname}{Abstract should precede
      \protect\maketitle\space in AMS documentclasses; reported}%
  \fi
  \global\setbox\abstractbox=\vtop \bgroup
  \normalfont\footnotesize
  \list{}{\labelwidth\z@\leftmargin3pc
\rightmargin\leftmargin\labelsep.5em}\item[\hskip\labelsep
    {\abstractname}.]\ignorespaces
}{%
  \endtrivlist
  \egroup
  \ifx\@setabstract\relax \@setabstracta \fi
}



\renewenvironment{proof}[1][\proofname]{\par
  \normalfont
  \topsep6\p@\@plus6\p@ \trivlist
  \item[\hskip\labelsep\itshape
    #1\@addpunct{\bf .}]\ignorespaces
}{%
  \qed\endtrivlist
}

\renewcommand{\proofname}{{\normalfont\bfseries Proof}}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Bibliography

\renewenvironment{thebibliography}[1]{%
  \addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
  \@xp\section*{\centerline{\refname}}%
  \addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
  \addcontentsline{toc}{section}{\refname}
  \normalfont
%\footnotesize
\normalsize
\labelsep .5em\relax
  \renewcommand\theenumiv{\arabic{enumiv}}\let\p@enumiv\@empty
  \list{\@biblabel{\theenumiv}}{\settowidth\labelwidth{\@biblabel{#1}}%
    \leftmargin\labelwidth \advance\leftmargin\labelsep
    \usecounter{enumiv}}%
  \sloppy \clubpenalty\@M \widowpenalty\clubpenalty
  \sfcode`\.=\@m
}{%
  \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%

  \endlist
}

%%%%%%%%%%%%%%%%%%%%%%%
%Citation font

\def\@cite#1#2{{%
  \m@th\upshape\mdseries[{{\bfseries #1}\if@tempswa, #2\fi}]}}
\@ifundefined{cite }{%
  \expandafter\let\csname cite \endcsname\cite
  \edef\cite{\@nx\protect\@xp\@nx\csname cite \endcsname}%
}{}



\endinput
