%%%%%%%%%% Packages

\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{array}
\RequirePackage{latexsym}
\RequirePackage{calc}
\RequirePackage{cite}
\RequirePackage{fancyhdr}
\RequirePackage{ifthen}
\RequirePackage{alltt}
%\RequirePackage{indentfirst}
\RequirePackage[dvips]{graphicx}
%\RequirePackage[cp1251]{inputenc}
%\RequirePackage[russian,english]{babel}

%%%%%%%%%% Corrections to packages

%%%%% Correction for standard caption

\def\CaptionSeparator{.\ }
%
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{#1\CaptionSeparator\ #2}%
  \ifdim \wd\@tempboxa >\hsize
    #1\CaptionSeparator #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip%
}

%%%%% Correction for package 'cite' (no spaces before a citation)

\def\@cite#1#2{\leavevmode
  \@tempskipa\lastskip \edef\@tempa{\the\@tempskipa}\unskip
  \ifnum\lastpenalty=\z@ \penalty\@highpenalty \fi
  \ifx\@tempa\@zero@skip \spacefactor1001 \fi % if no space before, set flag
%  \ifnum\spacefactor>\@m \ \else \hskip\@tempskipa \fi
  \ifnum\spacefactor>\@m \else \hskip\@tempskipa \fi
  \citeleft{#1\if@tempswa \citemid #2\fi}\citeright
  \spacefactor\@m % punctuation in note doesn't affect outside
}

%%%%%%%%%% Definitions

%\newtheorem{exm}{Example\\}
\def\casys#1{\textsc{#1}}
%\def\bm{\casys{berg\-man}}
\def\setQ{\mathbb{Q}}
\def\setZ{\mathbb{Z}}
%\def\Gbas{Gr\"{o}bner basis}

%%%%%%%%%% Floats
\setcounter{topnumber}{99}
\setcounter{bottomnumber}{99}
\setcounter{totalnumber}{99}
\renewcommand{\topfraction}{1.0}
\renewcommand{\bottomfraction}{1.0}
\renewcommand{\textfraction}{0.0}
%\renewcommand{\floatpagefraction}{0.5}

\endinput
