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

%%%
%%%  Самарский государственный технический университет
%%%                   
%%%   Стилевой файл для подготовки статьи,
%%%   набранной в пакете MikTeX, для подачи
%%%       на Третью Всероссийскую конференцию
%%%       "Математическое моделирование и краевые задачи" (ММ-2006)             
%%%
%%%   Автор: М. Н. Саушкин
%%%    (СамГТУ, каф. ПМиИ,
%%%     msaushkin@gmail.com)
%%%

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


\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mmikz}[2005/06/05 v1.0]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\message
 {^^J Matematicheskoe modelirovanie i kraevye zadachi (MM-2006)
  ^^J Departamet and Applied Mathematics and Informatics
  ^^J Samara State Technical University^^J^^J}

\def\package@warning#1{\message{^^JMMIKZ Package Warning: #1
 ^^JPress any key... }\read\m@ne to \@tempa}

\def\package@error#1{\begingroup \errorcontextlines=1
 \errmessage{MMIKZ Package error: #1}\endgroup}

\def\mm@forbid#1{\def#1{%
 \errhelp={Sorry, but this command has been forbidden intentionally.
  ^^JPlease refer to the sample file for details.}%
 \package@error{Command \string#1 is forbidden}}}

\message{Loading page layout, russifikation}

\newdimen\field@h
\newdimen\interline@h

\hoffset-1in
\voffset-1in

\field@h185mm
\topmargin17mm
\headheight0mm
\headsep0mm 
\textwidth115mm
%\textheight176mm
\footskip5mm
\oddsidemargin16.75mm
\evensidemargin\oddsidemargin
\special{papersize=148mm,210mm}

\newcommand{\longpagesize}[1]{\enlargethispage{#1}}
\newcommand{\shortpagesize}[1]{\enlargethispage{-#1}}
\newcommand{\longpage}{\enlargethispage{\baselineskip}}
\newcommand{\shortpage}{\enlargethispage{-\baselineskip}}
\renewcommand{\baselinestretch}{0.95} 

\frenchspacing
\lefthyphenmin=3
\righthyphenmin=2
\usepackage{ifthen}


\setlength{\textheight}{39\baselineskip}
\setlength{\textheight}{\baselinestretch\textheight}
\addtolength{\textheight}{\topskip}



\usepackage[russian]{babel}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\message{sectioning,}
\mm@forbid\section
\mm@forbid\subsection
\mm@forbid\subsubsection
\mm@forbid\paragraph
\mm@forbid\subparagraph
\newcommand{\clear}{%
\setcounter{sec}{1}%
\setcounter{apx}{0}%
\setcounter{equation}{0}%
\setcounter{figure}{0}%
\setcounter{table}{0}%
\setcounter{footnote}{1}
\renewcommand{\theequation}{\arabic{equation}}
\renewcommand{\thesec}{\arabic{sec}}}

%\renewcommand{\section}[1]{{\bf \arabic{sec}. #1. }\stepcounter{sec}}
\newcommand{\Section}[2][s]{%
\ifthenelse{\equal{#1}{s}}{{\bf \thesec. #2.}\stepcounter{sec}}{{\bf #2.}}}
\newcommand{\Appendix}[1]{%
\stepcounter{apx}%

\vskip5mm
\noindent {\bf Приложение \Alph{apx}. }%
\setcounter{sec}{1}%
\setcounter{equation}{0}
\renewcommand{\theequation}{\Alph{apx}.\arabic{equation}}%
\renewcommand{\thesec}{\Alph{apx}.\arabic{sec}}%

\noindent {\bf #1}%
\vskip3mm}
\renewcommand{\thepage}{{\normalsize \arabic{page}}}
\renewcommand{\footnote}[1]{%
$^{\thefootnote}$\footnotetext{$^{\thefootnote}$#1}%
\stepcounter{footnote}}

\newcommand{\bs}{\boldsymbol}
\newcounter{sec}
\newcounter{apx}
\newcounter{N}
\newboolean{languge}
\setboolean{languge}{false}
\newcommand{\eng}{\setboolean{languge}{true}}
\newcommand{\rus}{\setboolean{languge}{false}}
\newcommand{\engl}{\boolean{languge}}
\newcommand{\langu}[2]{\protect\ifthenelse{\engl}{#1}{#2}}
\newcommand{\ac}[2]{\addcontentsline{toc}{subsection}{{\it #1} #2}}
\newcommand{\seteq}[1]{\setcounter{equation}{#1}}

\newcommand{\theauthor}{}
\newcommand{\AutorInTitlepage}{}
\newcommand{\thetitle}{}
\newcommand{\TitleInTitlepage}{}
\newcommand{\TitleInTableOfContenst}{}
\newcommand{\udk}{}
\newcommand{\theudk}{}
%\newcommand{\thedate}{}
%\newcommand{\thanks}{}
\newcommand{\thethanks}{}
\newcommand{\theemail}{}
\newcommand{\theaddress}{}


\renewcommand{\author}[1]{%
\renewcommand{\theauthor}{#1}
\renewcommand{\AutorInTitlepage}{\small \textbf{\emph{#1}}}}

\renewcommand{\title}[1]{%
\renewcommand{\thetitle}{#1}
\renewcommand{\TitleInTitlepage}{\uppercase{\small \bf #1}}
%\renewcommand{\TitleInTitlepage}{\ttfamily \large #1}
\renewcommand{\TitleInTableOfContenst}{\noindent {#1}}
}

\renewcommand{\udk}[1]{%
\renewcommand{\theudk}{{\small УДК #1}}}

\newcommand{\email}[1]{%
\renewcommand{\theemail}{%
\newline \noindent {\ttfamily \footnotesize #1}}}

\newcommand{\address}[1]{%
\renewcommand{\theaddress}{\noindent {\footnotesize {\slshape #1}}}}

\renewcommand{\thanks}[1]{%
\renewcommand{\thethanks}{\footnotetext{#1}}}

\newcommand{\makecontents}{%
\newpage%
\thispagestyle{empty}
\small \tableofcontents 
\thispagestyle{empty}}

\usepackage{fancyheadings}
\makeatletter
\renewcommand{\@makefnmark}{}



\renewcommand{\maketitle}{%
\ac{\theauthor \nobreak}{\TitleInTableOfContenst} \normalsize \normalfont
\cfoot[]{} \lfoot[\thepage]{} \rfoot[]{\thepage}
\plainheadrulewidth=0pt
\headrulewidth=0pt
\pagestyle{fancyplain}
\clear
\thethanks 
\noindent 
\theudk
\begin{center}
\AutorInTitlepage 
\vskip1mm 
\TitleInTitlepage
\end{center} 
 \vskip1mm}

\newcommand{\makeendtitle}{%
\vskip2mm
\noindent
\begin{minipage}[t]{100mm}
\theaddress
\theemail
\end{minipage}
\rus}

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\message{lists,}

\def\@listI{\leftmargin\leftmargini
 \topsep\z@ \parsep\z@ \itemsep\z@}

\def\@listii{\leftmargin\leftmarginii
   \labelwidth\leftmarginii\advance\labelwidth-\labelsep
   \topsep\z@ \parsep\z@ \itemsep\z@}

\def\itemize{\ifnum\@itemdepth>\@ne \@toodeep \else \advance\@itemdepth\@ne
  \leftmarginii 30\p@
  \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
  \list{\csname\@itemitem\endcsname}{\def\makelabel##1{\hss\llap{##1}}}\fi}

\def\enumerate{\ifnum\@enumdepth>\@ne \@toodeep \else
  \advance\@enumdepth\@ne
  \settowidth\leftmargini {\indent 9)\enskip}%
  \leftmarginii 27\p@
  \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
  {\csname label\@enumctr\endcsname}{\usecounter
    {\@enumctr}\def\makelabel##1{\hss\llap{##1}}}\fi}

\def\labelitemi{$\bullet$}
\def\labelitemii{--}

\def\labelenumi{\theenumi)}
\def\labelenumii{\theenumii)}
\def\theenumi{\arabic{enumi}}
\def\theenumii{\alph{enumii}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\message{theorem environments,}

\newenvironment{newthm}[2][s]
{\vskip1mm \ifthenelse{\equal{#1}{s}}{{\small \sc #2.}}{{\small \sc #2 #1.}}}{}
\newenvironment{proof}[1][s]
{\vskip1mm \ifthenelse{\equal{#1}{s}}{{\it \langu{Proof. }{Доказательство. }}}{{\it #1. }}}{$\square$}
\newenvironment{theorem}[1][s]
{\vskip1mm \ifthenelse{\equal{#1}{s}}{{\small \sc \langu{Theorem. }{Теорема. }}}
{{\small \sc \langu{Theorem #1.}{Теорема #1.}}}}{}
\newenvironment{remark}[1][s]
{\vskip1mm \ifthenelse{\equal{#1}{s}}{{\small \sc \langu{Remark. }{Замечание. }}}
{{\small \sc \langu{Remark #1.}{Замечание #1.}}}}{}
\newenvironment{example}[1][s]
{\vskip1mm \ifthenelse{\equal{#1}{s}}{{\small \sc \langu{Example. }{Пример. }}}
{{\small \sc \langu{Example #1.}{Пример #1.}}}}{}
\newenvironment{lemma}[1][s]
{\vskip1mm \ifthenelse{\equal{#1}{s}}{{\small \sc \langu{Lemma. }{Лемма. }}}
{{\small \sc \langu{Lemma #1.}{Лемма #1.}}}}{}
\newenvironment{definition}[1][s]
{\vskip1mm \ifthenelse{\equal{#1}{s}}{{\small \sc \langu{Definition. }{Определение. }}}
{{\small \sc \langu{Definition #1.}{Определение #1.}}}}{}



\renewenvironment{thebibliography}[1]%
{\vskip5mm%
\normalfont \footnotesize%
\begin{list}{\arabic{N}.}{%
\itemsep=0mm  \parsep=0mm %
\ifthenelse{\equal{#1}{99}}{\leftmargin=19pt}{\leftmargin=15pt}%
\usecounter{N}}}%
{\end{list}%
}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\message{math packages:}
\usepackage{amsmath,amssymb,latexsym}
\mm@forbid\eqno
\mm@forbid\leqno

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\message{... finished.^^J^^J}

\endinput
