%
% (c) Horvath Zoltan 
%

%\tracingmacros=1

\def\elte{E\"otv\"os Lor\'and Tudom\'anyegyetem}
\def\ttk{Term\'eszettudom\'anyi Kar}
\def\aszt{\'Altal\'anos Sz\'am\'\i t\'astudom\'anyi Tansz\'ek}
\def\szerz{ELTE}
\def\cima{Az Ada95} 
\def\cimb{programozási nyelv}
\def\rovcim{\cima}
\def\ddolg{ }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Oldal alakja, tukormeret:  HELYETTE  a4.sty !!!
%  azaz: \documentstyle[12pt,zoli,a4]{book}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \textheight = 50\baselineskip
% \textwidth 50em \columnsep 10pt \columnseprule 0pt 
%\textheight=189 truemm  % ok %%
%\textwidth=126 truemm  % ok %%
%% !!!! szamcsi
%% kovetkezo ket sor johet az elozoek helyett...
\textheight=200 truemm
\textwidth=135 truemm

%% !!!! szamcsi
%% hz szerinte ez is kell
%\ds@twoside

% !!!! szamcsi
% jatszunk egy kicsit a margokkal...
% 33mm jateka van, ebbol 7mm kotest hagyunk, marad 13mm
\oddsidemargin 17mm \evensidemargin 17mm 
%\marginparwidth 1in \marginparsep 7pt
%\topmargin .73in \headheight 12pt \headsep .275in \footskip .38in

%\advance\textheight by {-1\headheight}
%\advance\textheight by {-1\footheight}
%\renewcommand{\baselinestretch}{1.2}
% \baselineskip = 11.1 pt        % sortavolsag ezt vettem ki APU miatt    ******
%\renewcommand{\baselinestretch}{0.85}
\renewcommand{\baselinestretch}{0.9} % ok
\baselineskip=14 pt plus 1 pt minus 1 pt %ok
\lineskiplimit= 0 pt %ok
\lineskip=0.001 pt %ok
%% fattyusorok
\global\widowpenalty=9000
\global\displaywidowpenalty=9000
\global\clubpenalty=8000
%
%

%...............%
% Ivszamozas:   %
%...............%
%
% ivkezdet
%
\global\newcount\ivhez
\global\ivhez=0
\newcounter{iv}  
\setcounter{iv}{1}  % bar az 1. oldaltol indulunk, de az empty ! 
%                   
\newcommand{\ivmod}
{ \global\ivhez=\value{page} 
 \global\divide\ivhez by 16 
 \global\multiply\ivhez by 16
 \global\advance\ivhez by 1
 \ifnum \value{page}=\ivhez 
    \refstepcounter{iv} 
       \typeout{UJ IV KEZDETE: \theiv. iv} 
    \fi}  
%
\newcommand{\ivfelirat}{
 \ivmod
 \ifnum \value{page}=\ivhez 
    \scriptsize
       %\theiv.\space \szerz :\ \rovcim \hfill 
       \theiv.\space \cima \  \cimb \hfill
%       \typeout{. iv} 
    \fi}  

%............................%
% Fejlecek, oldalszamozas ...%
%............................%                       
\renewcommand{\ps@headings}{\hbadness=10000
\let\@mkboth\markboth 
\def\@oddfoot{ \ivfelirat } %hz
\def\@evenfoot{ \ivfelirat }
\def\@evenhead{\rm \thepage\hfill \sl\leftmark}
\def\@oddhead{\sl \rightmark\hfill \rm\thepage}
\def\chaptermark##1{\markboth
{%\ifnum \c@secnumdepth >\m@ne
\thechapter.
%{} 
%\@chapapp : \ \fi 
##1}{}}
%{\ifnum \c@secnumdepth >\m@ne  \ \fi ##1}}
\def\sectionmark##1{\hbadness=10000
\markright{{\ifnum \c@secnumdepth >\z@ \thesection \ \fi ##1}}
}}
%
\renewcommand{\ps@myheadings}{
\let\@mkboth\@gobbletwo
\def\@oddhead{\hbox{}\sl\rightmark\hfil\rm\thepage}
\def\@oddfoot{ \ivfelirat } %hz
\def\@evenhead{\rm \thepage\hfil\sl\leftmark\hbox{}}
\def\@evenfoot{ \ivfelirat } %hz
\def\chaptermark##1{
\markboth{\thechapter. ##1}{}}
\def\sectionmark##1{
\markright{{\ifnum \c@secnumdepth >\z@ \thesection \ \fi ##1}}
}}
%%

%\def\sectionmark##1{}%
%\def\subsectionmark##1{}}
%
\renewcommand{\ps@plain}{\let\@mkboth\@gobbletwo
%     \def\@oddhead{}\def\@oddfoot{\ivmod \rm\hfil\thepage
%     \hfil}\def\@evenhead{}\let\@evenfoot\@oddfoot
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\renewcommand{\tabbingsep}{5 pt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%
% Betutipusok
%
% HELYETTE  a4.sty !!!
%  azaz: \documentstyle[12pt,zoli,a4]{book}
%%%%%%%%%%%%%%%%%%%%
\def\large{\@setsize\large{18pt}\xivpt\@xivpt}
\let\Large=\large
%\def\CLarge{\@setsize\Large{22pt}\xviipt\@xviipt}
\let\LARGE=\large % cimlap miatt
%\def\LARGE{\@setsize\LARGE{25pt}\xxpt\@xxpt}
\let\huge=\large %-- cimlap miatt kivettem
\let\footnotesize=\scriptsize
%\def\Chuge{\@setsize\huge{30pt}\xxvpt\@xxvpt}
\let\Huge=\large % -- cimlap miatt kivettem
\normalsize
% bk11 pt
%\def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
%\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
\def\Clarge{\@setsize\large{14pt}\xiipt\@xiipt}
\def\CLarge{\@setsize\Large{18pt}\xivpt\@xivpt}
\def\CLARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
\def\Chuge{\@setsize\huge{55pt}\xxpt\@xxpt}
%\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
%\def\Cfootnotesize{\@setsize\footnotesize{11pt}\ixpt\@ixpt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Pontok
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  7. Fejezet
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% fejezet . kirasa 
% nem az en muvem
\def\@makechapterhead#1{\par\noindent\vskip -6.2truemm%\vspace*{50pt}
{\parindent 0pt\raggedright
% \ifnum \c@secnumdepth >\m@ne \huge\bf \@chapapp{} \thechapter \par
\ifnum\c@secnumdepth >\m@ne\noindent\huge\bf
\thechapter{}. \@chapapp{} \par
 \vskip 20pt \fi \Huge \bf #1\par
 \nobreak \vskip 20pt }}
%%%
% 7. fejezetcim - a tartalomjegyzekben is jol
%%%
\renewcommand{\chapter}{
%\cleardoublepage 
\clearpage \thispagestyle{plain}
\global\@topnum\z@
\noindent
\@afterindentfalse
\secdef\@chapter\@schapter
}
\def\@chapter[#1]#2#3{\ifnum \c@secnumdepth >\m@ne
 \refstepcounter{chapter}
 \typeout{\thechapter.\space\@chapapp}  % -- @chapapp irja ki, hogy Fejezet !!
 \addcontentsline{toc}{chapter}{\protect
 \numberline{\thechapter.}  % hz . tolem
%#1
#3
}\else
 \addcontentsline{toc}{chapter}
%{#1}--hz
{#3}\fi
 \chaptermark{#1}
 \addtocontents{lof}{\protect\addvspace{10pt}}
\addtocontents{lot}{\protect\addvspace{10pt}} \if@twocolumn
\@topnewpage[\@makechapterhead{#2}]
 \else \@makechapterhead{#2}
 \@afterheading \fi}
\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]
 \else\@makeschapterhead{#1}
\@afterheading\fi}

%% !!!! szamcsi
%%%%%%%%%%%%%%%%%
%%%
%%% 1.1. Abra, tablazat, program, keplet stb. sorszamaban a .
%%%
%%%%%%%%%%%%%%%
\long\def\@caption#1[#2]#3{\par\addcontentsline{\csname
  ext@#1\endcsname}{#1}{\protect\numberline{\csname 
  the#1\endcsname.}{\ignorespaces #2}}\begingroup  % . miatt Latex-bol idemasolva
    \@parboxrestore
    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}
%
%\renewcommand\thefigure{\thechapter\@arabic\c@figure.}
\renewcommand{\fnum@figure}{\thefigure.~\figurename{}}
%\def\thetable{\thechapter\@arabic\c@table.}
\renewcommand{\fnum@table}{\thetable.~\tablename{}}
\renewcommand{\@eqnnum}{{\rm (\theequation.)}} 
%\renewcommand{\theequation}{\thechapter.\arabic{equation}}
%%%%%%%%%
% 1.1. tetel-re hivatkozaskor a  sorszam utan a .
%%%%%%%%%
\def\pref#1{\ref{#1}.}   

%%%%%%%%%%
%  1.1. bekezdesek sorszama utani .
%%%%%%%%
\renewcommand{\thesubsection}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}.}
%%%%%%%%%%%%
% Tetel megadasakor a sorszam utani .   opc. arg.: [telenev] Nem kerul bele a 
%                                                           teteljegyzekbe
%
\def\@begintheorem#1#2{ \trivlist \item[\hskip \labelsep{\bf #2.\ #1}]}
\def\@opargbegintheorem#1#2#3{ \trivlist
      \item[\hskip \labelsep{\bf #2.\ #1}]{\em(#3)}\u}

%%%%%%%
%
%  Resz
%  
%%%%%%%
\def\vpart{\cleardoublepage \thispagestyle{plain}
\if@twocolumn \onecolumn
\@tempswatrue \else \@tempswafalse \fi \hbox{}\vfil \secdef\@vpart\@spart}
%\def\partname{Part} % <----------
\def\@vpart[#1]#2{\ifnum \c@secnumdepth >-2\relax \refstepcounter{part}
\addcontentsline{toc}{part}{#1}\else
\addcontentsline{toc}{part}{#1}\fi \markboth{}{}
{\centering \ifnum \c@secnumdepth >-2\relax \par
\vskip 20pt \fi \Huge \bf #1\par}\@endpart}



%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Kornyezetek definicioja es sorszamok kepzese
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{tetel}{T\'etel.\ }[chapter]
\newtheorem{lemma}[tetel]{Lemma.\ }%[chapter]
\newtheorem{defi}{Defin\'\i ci\'o.\ }[chapter]
\newtheorem{kov}{K\"ovetkezm\'eny.\ }[chapter]
\newtheorem{megj}{Megjegyz\'es.\ }[chapter]
\newtheorem{pld}{P\'elda.\ }[chapter]
\newtheorem{fld}{Feladat.\ }[chapter]
%%%%%%%%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Fejezet eleji absztraktokhoz
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\abstractname{}
\def\abstract{\if@twocolumn
\section*{\abstractname}%
\else \small
%\begin{center}%
\hspace*{3 em}%{\bf \abstractname\vspace{-.5em}\vspace{\z@}}%
%\end{center}%
%\smallskip
\quotation \em
\fi}
%
\def\endabstract{\if@twocolumn\else\endquotation\fi}
%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Targymutato elkeszitesehez
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% makeidx.sty 20-Jan-87
\def\see#1#2{{\u $\rightarrow$ \/} #1}
\def\printindex{\@input{\jobname.ind}}
%
% sajat: \index{alma!emi} \index{alma|di{label}}
%
\newcommand{\emi}[1]{{\em #1}}
\newcommand{\di}[2]{{\em #2} {\bf (\pref{#1})}}
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Magyar szavak datumban, reszelnevezesekben
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\datehungarian{\def\today{\number\year.\space \ifcase\month\or
  Janu\'ar\or Febru\'ar\or M\'arcius\or \'Aprilis\or M\'ajus\or
  J\'unius\or J\'ulius\or Augusztus\or Szeptember\or Okt\'ober\or
  November\or December\fi\space \number\day.}}
\gdef\captionshungarian{%
\def\refname{Felhaszn\'alt irodalom}%
\def\abstractname{Kivonat}%
\def\bibname{Irodalomjegyzék}%
\def\chaptername{Fejezet}%
%\def\chaptername{ }%
\def\appendixname{F\"uggel\'ek}%
\def\contentsname{Tartalomjegyz\'ek}%
\def\listfigurename{\'Abr\'ak}%
%\def\listfaname{Csal\'adf\'ak}% -- hz
%\def\listprogramname{Absztrakt programok}
\def\listtablename{T\'abl\'azatok}%
\def\indexname{T\'argymutat\'o}%
\def\figurename{\'abra}%
\def\faname{csal\'adfa}% -- hz
\def\tablename{t\'abl\'azat}%
\def\partname{r\'esz}%
\def\enclname{mell\'eklet}%
\def\ccname{cc}%
\def\headtoname{ig}%
\def\pagename{oldal}}
%
%
\newcount\l@nguage
\expandafter\ifx\csname language\endcsname\relax
\global\let\language=\l@nguage
\fi
%
\newcount\USenglish  \global\USenglish=0
\newcount\hungarian  \global\hungarian=5
%
% -- hz hh
\gdef\selectlanguage#1{\language #1\relax
  \expandafter\ifcase #1\relax
%  \dateUSenglish  \captionsenglish   \or
  \datehungarian  \captionshungarian \fi}
%
%\gdef\mdqon{\catcode`\"\active}
\gdef\mdqoff{\catcode`\"12 }
\gdef\umlauthigh{\def\"##1{{\accent127 ##1}}}
%\gdef\umlautlow{\def\"{\protect\newumlaut}}
\gdef\originalTeX{\mdqoff \umlauthigh \let\3\original@three
                  \selectlanguage{\USenglish}}
\originalTeX
\selectlanguage{\hungarian}
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%% !!!! szamcsi

% our toc
\gdef\tableofcontents{\hbadness=10000
\chapter*{\contentsname}
 \markboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}
\addcontentsline{toc}{chapter}{\protect\numberline{}{\contentsname}}
 \vskip -3cm\@starttoc{toc}
}
\def\numberline#1{\ifnum \@tempdima > 1500000
\advance\@tempdima 3pt \fi
\ifnum \@tempdima > 2000000
\advance\@tempdima 1pt \fi
\hbox to \@tempdima{#1\hfill} } 

% our index

\def\theindex{
\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
  \columnseprule \z@
 \columnsep 30pt\twocolumn
[\@makeschapterhead{\indexname}] %*
%\chapter[\indexname]{\indexname}{\indexname} % hz
  \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
  \thispagestyle{plain}\parindent\z@
  \parskip\z@ plus .3pt\relax\let\item\@idxitem
}

% \def\@idxitem{\par\hangindent 40pt}
% \def\subitem{\par\hangindent 40pt \hspace*{20pt}}
% \def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
% \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
% \def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}


% our bibliography
 \def\thebibliography#1{\chapter[\bibname]{\bibname}{\bibname} % *-hz
 {\@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}\list
 {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax}
\let\endthebibliography=\endlist
