\setlength\textwidth{125mm}
\setlength\textheight{175mm}
\setlength\evensidemargin{18mm}
\setlength\oddsidemargin{18mm}
\setlength\mathindent{0mm}
\newcommand{\ki}[1]{\textbf{\textsl{#1}}}
\newcommand{\key}[1]{\textbf{#1}}
%%
%% RESZ, FEJEZET, ALFEJEZET
%%
\setcounter{part}{0}
\setcounter{chapter}{0}
\setcounter{secnumdepth}{2}
%%
\def\partname{R\'esz}
\def\chaptername{Fejezet}
\def\contentsname{Tartalom}
%%
%%\pagestyle{myheadings}
%%
\renewcommand\part{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \thispagestyle{plain}%
  \if@twocolumn
    \onecolumn
    \@tempswatrue
  \else
    \@tempswafalse
  \fi
  \null
  \secdef\@part\@spart}

%%
\def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
     \markboth{\thepart.\ \ \MakeUppercase{#2}}%
              {\thepart.\ \ \MakeUppercase{#2}}%
    {\centering
     \interlinepenalty \@M
     \normalfont
     \huge \bfseries \thepart.\ \ \MakeUppercase{#2}\par}%
    \@endpart}
%%
\def\@endpart{\vskip 36 pt
              \if@tempswa
                \twocolumn
              \fi}
%%

\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{empty}%
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}

\def\@makechapterhead#1{%
  \vspace*{56\p@}%
  {\parindent \z@ \raggedright \normalfont
    \vskip 18 pt
    \interlinepenalty\@M
    \huge \bfseries \thechapter.\ #1\par\nobreak
    \vskip 12\p@%  egy ures sor
  }}
%%
%% FEJLEC
%%
\def\@oddhead{\vbox{\hbox to \textwidth{\hbox {}{\sl \rightmark}\hfil%
      \rm\thepage\hbox {}}%
        \vss\vskip 2pt \hbox to\textwidth{\hrulefill}}}
\def\@evenhead{\vbox{\hbox to \textwidth{\rm\thepage\hfil{\sl \leftmark}%
    \hbox {}}\vss \vskip 2pt \hbox to \textwidth{\hrulefill}}}

\renewcommand\chaptermark[1]{%
      \markboth {%
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
              \thechapter.\ \ %
          \fi
        \fi
      #1}{}}%
\renewcommand\sectionmark[1]{%
      \markright {%
        \ifnum \c@secnumdepth >\z@
           \thesection \ \ %
       \fi
        #1}}
%%
\renewcommand{\thesection}{\thechapter.\@arabic\c@section.}
\renewcommand{\thesubsection}{\thesection\@arabic\c@subsection.}
%%
\newcommand\hardsection{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large%
                                   \bfseries{\hspace{-5truemm}$*$}}}
%                                  \bfseries$\hfill\break\hspace*{-20
%truemm} *$}}
%%
%% TETEL, DEF, ...
%%
\def\@begintheorem#1#2{ \trivlist
   \item[\hskip \labelsep{\bfseries #2.~#1:\ }]}
\def\@opargbegintheorem#1#2#3{\trivlist
      \item[\hskip \labelsep{\bfseries #2.~#1:\ (#3)\ }]}
%%
\def\pref#1{\ref{#1}.}
%%
\newtheorem{tetel}{T\'etel\ }[chapter]%
\newtheorem{lemma}[tetel]{Lemma\ }%
\newtheorem{defi}[tetel]{Defin\'\i ci\'o\ }
\newtheorem{kov}[tetel]{K\"ovetkezm\'eny\ }
\newtheorem{megj}[tetel]{Megjegyz\'es\ }
\newtheorem{all}[tetel]{\'All\'\i t\'as\ }
%%
%% BIZONYITAS
%%
\newenvironment{biz}{\bizo}{\kocka}
\def\bizo{\par\noindent{\textbf{Bizony\'\i t\'as.\ }}}
\def\kocka{\nobreak\hspace*{\fill}\nobreak$\Box$\par\smallskip}
%%
%% ALGORITMUS
%%
\newcommand{\algn}[1]{\textsc{#1}}
\newcommand{\alge}{%
\begin{tabbing}%
99 \= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \+ \kill
}
\newcommand{\algv}{%
\end{tabbing}
}
\newenvironment{alg}[1]{%
\vspace{5 mm}\vbox\bgroup\noindent\algn{#1}\alge}{\algv\egroup}
%%
%% GYAKORLATOK
%%
\newcounter{cszx}
\newenvironment{gyak}{\section*{Gyakorlatok}%
\setcounter{cszx}{0}}{}
\def\ujgyak{\refstepcounter{cszx}\medbreak\noindent%
\textbf{\thechapter.\@arabic\c@section-\thecszx.}\ }%
\def\hardgyak{\refstepcounter{cszx}\medbreak\noindent%
\textbf{\thechapter.\@arabic\c@section-\thecszx.$*$}\ }%
%%
%% FELADATOK
%%
\newcounter{cszy}
\newenvironment{fld}{\section*{Feladatok}%
\setcounter{cszy}{0}}{}
\def\ujfld{\refstepcounter{cszy}\medbreak\noindent%
\textbf{\thechapter-\thecszy.\ feladat:\ }\par\nopagebreak\noindent\ignorespaces}
\def\ujpld#1{\refstepcounter{cszy}\medbreak\noindent%
\textbf{\thechapter-\thecszy. p\'elda:\ {#1}}\par\nopagebreak[4]\noindent\ignorespaces}
\def\megold{\medbreak\noindent\textbf{Megold�s:}\ }
%% %% FEJEZET MEGJEGYZES
%%
\newenvironment{fejmegj}{\section*{Megjegyz\'esek a fejezethez}}{}
%%
%% TABLAZAT
%%
\def\tablename{t\'abl\'azat}
\renewcommand \thetable
     {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table.}
\def\fnum@table{\thetable~\tablename}
%%
%% ABRA
%%
\renewcommand\figurename{\'abra}
\renewcommand\thefigure
     {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure.}
\def\fnum@figure{\thefigure~\figurename}
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\textbf{#1.} {\small{#2}}}%
  \ifdim \wd\@tempboxa >\hsize
    {\textbf{#1.}} {\small{#2}}\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}

\renewenvironment{description}
               {\list{}{\setlength\leftmargin{15pt}
                        \labelwidth\z@ \itemindent-\leftmargin
                        \let\makelabel\descriptionlabel}}
               {\endlist}