\NeedsTeXFormat{LaTeX2e}[2002/01/01]
\ProvidesClass{kkzm25}[2011/08/12 LaTeX class for proceedings of National Conference 
                      of Application Mathematics to Biology and Medicine]
\LoadClass[10pt,reqno,twoside]{amsart}
\def\placeanddate{Jadwisin, 16$^\textrm{th}$--20$^\textrm{th}$ September 2019}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{amsrefs}

\renewcommand{\sfdefault}{phv}
\renewcommand{\rmdefault}{ptm}
\renewcommand{\ttdefault}{pcr}

\RequirePackage{graphicx}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}

\makeatletter

\let\affiliation\dedicatory
\let\email\texttt
\def\@przepisz#1{{#1}}
\def\thesection{}

\renewenvironment{bibliography}{\smallsection*{References}\begin{biblist}}{\end{biblist}}
%%% odstep naokolo podpisu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\abovecaptionskip}{5pt}
\setlength{\belowcaptionskip}{5pt}
% Rozmiar papieru - b5 - marginesy, itp.
\geometry{b5paper,text={137mm,212mm},bindingoffset=5mm,marginpar=40pt,headheight=15pt}
%\marginparwidth=40pt
%\headheight=41pt
%\oddsidemargin=-19pt
%\evensidemargin=-14pt
%\topmargin=-58pt
%\textwidth=389pt %137mm
%\textheight=603pt %212mm
%\hoffset=0pt
%\voffset=0pt
%\paperheight=250mm
%\paperwidth=176mm
\textfloatsep=15pt plus 12pt
\listisep=0pt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% abstract jako sekcja %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewenvironment{abstract}{\smallsection*{Abstract}\small}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% sekcja acknowledgements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{acknowledgements}{\noindent\textbf{Acknowledgements:}}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% sekcje duzymi literami %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\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
  \@tempskipa #5\relax
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \edef\@secnumpunct{%
      \ifdim\@tempskipa>\z@ % not a run-in section heading
        \@ifnotempty{#8}{\@nx\enspace}%
      \else \@nx\enspace
      \fi
    }%
    \protected@edef\@svsec{%
      \ifnum#2<\@m
        \@ifundefined{#1name}{}{%
          \ignorespaces\csname #1name\endcsname\space
        }%
      \fi
      \@seccntformat{#1}%
    }%
  \fi
  \ifdim \@tempskipa>\z@ % then this is not a run-in section heading
    \begingroup #6\relax
    \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty\@M\MakeUppercase{#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}\noindent\\[-12pt]}
\renewcommand{\subsection}[1]{\begin{center}{\bfseries#1}\end{center}\par\noindent\ignorespaces}


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

%%% afiliacja nie pochyla i nie footnotesize, logo %%%%%%%%%%%%%%%%%%%%%
\def\@maketitle{%
  \begin{center}\phantom{.}\vskip-16pt\includegraphics[width=23mm,height=23mm]{q0}\\[0mm]%
  {\footnotesize\placeanddate}\\[27pt]\end{center}%
  \normalfont\normalsize
  \let\@makefnmark\relax  \let\@thefnmark\relax
  \ifx\@empty\@date\else \@footnotetext{\@setdate}\fi
  \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\topskip42\p@\relax % 5.5pc   "   "   "     "     "
  \@settitle\vskip4mm
  \ifx\@empty\authors \else \@setauthors\vskip4mm \fi
  \ifx\@empty\@dedicatory
  \else
    \baselineskip18\p@
    \vtop{\centering{\noindent\\[-9pt]\normalsize\@dedicatory\@@par}%
      \global\dimen@i\prevdepth}\prevdepth\dimen@i\vskip-9pt
  \fi
  \@setabstract
  \normalsize
  \if@titlepage
    \newpage
  \else
    \dimen@32\p@ \advance\dimen@-\baselineskip
    \vskip\dimen@\relax
  \fi
\thispagestyle{empty}
} % end \@maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% kreska przy naglowkach %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\ps@headings{\headheight41pt\let\@mkboth\markboth
  \let\@oddfoot\@empty\let\@evenfoot\@empty
  \def\@evenhead{\parbox{\textwidth}{
       \expandafter\expandafter\expandafter\normalsize
       \expandafter\expandafter\expandafter
       \thepage\hfill\\[-7pt] \rule[3pt]{\textwidth}{0.6pt}}}
  \def\@oddhead{\parbox{\textwidth}{
       \expandafter\expandafter\expandafter\normalsize
       \expandafter\expandafter\expandafter
       \hfill\thepage\\[-7pt] \rule[3pt]{\textwidth}{0.6pt}}}
  \def\chaptermark##1{\@mkboth{##1}{##1}}
  \let\sectionmark\markright}
\pagestyle{headings}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Definuijemy nag��wek
\pagestyle{fancy}
\fancyhead{}
%\chead{XVI KKZMBM}
\fancyhead[RO,LE]{\thepage}
\fancyfoot{}
\renewcommand{\headrulewidth}{0.4pt}

\newcommand{\skrocone}[2]{\fancyhead[RE]{#1}\fancyhead[LO]{\textit{#2}}}

%koniec definicji nag��wka

%%% tytul wieksza czcionka %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@settitle{\begin{center}%
  \baselineskip14\p@\relax
    \Large\bfseries
\uppercasenonmath\@title
  \@title
  \end{center}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% autorzy nie duzymi literami i do tego normalna czcionka %%%%%%%%%%%%
\def\@setauthors{%
  \begingroup
  \trivlist
  \centering\footnotesize \@topsep20\p@\relax
  \advance\@topsep by -\baselineskip
  \item\relax
  \andify\authors
  \def\\{\protect\linebreak}%
\normalsize\bf\authors%
  \endtrivlist
  \endgroup
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\@setabstracta{%
  \ifvoid\abstractbox
  \else
    \skip@-5\p@ \advance\skip@-\lastskip
    \advance\skip@-\baselineskip \vskip\skip@
    \box\abstractbox
    \prevdepth\z@ % because \abstractbox is a vtop
  \fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\def\origsection{\@startsection{section}{1}%
%  \z@{.2\linespacing}{.5\linespacing}%
%  {\normalfont\bf\centering}}
\def\section{\@startsection{section}{1}%
  \z@{.7\linespacing\@plus\linespacing}{0.25\linespacing}%
  {\normalfont\bf\centering}}
\def\smallsection{\@startsection{section}{1}%
  \z@{.7\linespacing\@plus\linespacing}{0.1\linespacing}%
  {\normalfont\small\bf\centering}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\headsep=2pt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\intextsep=6pt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@captionheadfont{\small\rm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\BibSpec{article}{%
  +{}{\PrintAuthors}       {author}
  +{:}{ \textit}      {title}
  +{.}{ \textit}      {subtitle}
  +{,}{ }             {journal}
  +{} { \textbf}      {volume}
  +{} { \PrintDatePV} {date}
  +{,}{ \PrintDOI}    {doi}
  +{,}{ \eprint}      {eprint}
  +{} { \parenthesize}{status}
  +{,}{ \eprintpages} {pages}
  +{,}{ }             {note}
  +{.}{}              {transition}
  +{} {\SentenceSpace \ReviewList}   {review}
  +{}{ \parenthesize}{language}
  +{}{}{part}
}

\BibSpec{book}{%
  +{}{\PrintAuthors}{author}
  +{}{\PrintEditorsA}{editor}
  +{:}{ \textit}{title}
  +{:}{ \textit}{subtitle}
  +{,}{ }{type}
  +{,}{ }{booktitle}
  +{,}{ \PrintEdition}{edition}
  +{,}{ }{series}
  +{,}{ vol.~}{volume}
  +{,}{ part~}{part}
  +{,}{ }{publisher}
  +{,}{ }{organization}
  +{,}{ }{place}
  +{,}{ \PrintDateB}{date}
  +{,}{ \ISBNList}{isbn}
  +{}{ \parenthesize}{status}
  +{,}{ }{note}
  +{.}{}{transition}
  +{}{\SentenceSpace \ReviewList}{review}
  +{}{ \parenthesize}{language}
}

\BibSpec{collection.article}{%
  +{}{\PrintAuthors}{author}
  +{:}{ \textit}{title}
  +{,}{ }{type}
  +{,}{ }{booktitle}
  +{,}{ \PrintEdition}{edition}
  +{}{ \PrintEditorsB}{editor}
  +{,}{ Proc.\ }{conference}
  +{,}{ }{series}
  +{,}{ vol.~}{volume}
  +{,}{ part~}{part}
  +{,}{ }{publisher}
  +{,}{ }{organization}
  +{,}{ }{place}
  +{,}{ \PrintDateB}{date}
  +{,}{ \DashPages}{pages}
  +{,}{ \ISBNList}{isbn}
  +{}{ \parenthesize}{status}
  +{,}{ }{note}
  +{.}{}{transition}
  +{}{\SentenceSpace \ReviewList}{review}
  +{}{ \parenthesize}{language}
}

\makeatother
