%%% Hlavn� soubor pro zpracov�n� knihy Typografick� syst�m TeX %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Nutno zpracovat form�tem csplain                      Petr Ol��k

\font\twbf=csbx12                 % Pro nadpisy v sekc�ch !font.
\font\twtt=cstt12                 % \tt pro nadpisy v sekc�ch
\font\bbf=csbx10 scaled \magstep4 % Nadpisy kapitol
\font\bignum=csb10 scaled 10000   % Velk� ��slice v z�hlav� kapitol
\font\mflogo=logo10               % METAFONT logo
\font\bigmflogo=logobf10 scaled \magstep4 % METAFONT logo v nadpisu kapitoly
\font\twmflogo=logobf10 scaled \magstep1  % METAFONT logo v nadpisu sekce
\font\sllogo=logosl10             % METAFONT logo v \it
\font\smmflogo=logosl10 scaled 800 % METAFONT logo v cit�tech
\font\eightmflogo=logo8           % METAFONT logo v pozn�mce pod �arou
\font\eightt=cstt8                % Verbatim strojopis a \tt v pozn�mk�ch
\font\eightrm=csr8                % Text v pozn�mk�ch pod �arou
\font\eightit=csti8               % \it v pozn�mce pod �arou
\font\eightsl=cssl8               % Text v cit�tech
\font\mfobr=mfobr                 % METAFONTov� obr�zky
\font\sans=csss10                 % Sans serif
\font\ttit=csitt10                % Strojopis kurz�vou
\font\itbf=csbxti10               % Kurz�va tu�n�

%% Fonty r�zn� velik� %%
\def\chapfonts{\bbf \let\mflogo=\bigmflogo}
\def\secfonts{\twbf \let\tt=\twtt \let\mflogo=\twmflogo}
\def\quotefonts{\eightsl \let\rm=\eightrm \let\mflogo=\smmflogo}
\def\footnotefonts{\eightrm \let\it=\eightit \let\tt=\eightt 
  \let\mflogo=\eightmflogo}
\let\plainit=\it \def\it{\plainit \let\mflogo=\sllogo \let\LaTeX=\itLaTeX}

%% Loga %%
\def\,{\thinspace}
\def\CS{$\cal C\kern-.1667em\lower.5ex\hbox{$\cal S$}\kern-.075em $}
\def\CSTUG{\CS TUG}
\let\cs=\CS
\def\CSfont{\CS\hbox{-}font}
\def\mf{{\mflogo META}\-{\mflogo FONT}}
\def\mpost{{\mflogo META}\-{\mflogo POST}}
\def\LaTeX{L\kern-.36em\raise.5ex\hbox{\sevenrm A}\kern-.12em\TeX}
\def\twoe{$2_{\textstyle\varepsilon}$}
\def\LaTeXe{\LaTeX\thinspace\twoe}
\def\itLaTeX{{\it L\kern-.24em\raise.5ex\hbox{\seveni A}\kern-.24em\TeX}}
\def\AMS{$\cal A\kern-.166em\lower.5ex\hbox{$\cal M$}\kern-.075em S$}
\def\AMSTeX{\AMS-\TeX}
\def\ps{Post\-Script}
\def\web{{\tt WEB}}

%% Zrcadlo str�nky %%  !zrcadlo.
\hsize=30pc                       % 30 pica
\vsize=46pc                       % 46 ��dk� po 12pt (zhruba)
\raggedbottom                     % Vynechat dole na str�nce p��p. m�sto

%% Parametry sazby %%
\emergencystretch=2em                   % Dodate�n� rozta�itelnost
\parindent=14pt                         % Odstavcov� zar�ka
\widowpenalty=10000 \clubpenalty=10000  % Absolutn� z�kaz vdov a sirotk�
\lineskip=0pt                           % Velk� boxy se budou dot�kat
\bigskipamount=12pt \medskipamount=6pt  % Nevkl�dat deformovateln� v�pl�ky
\smallskipamount=3pt

%% Str�nkov� ��slice %%
\def\pagenumbers{\footline={\ifodd\pageno\hfill\fi\bf\folio\hfil}}

%% �esk� d�len� slov %%                 !hyphen.
\chyph
% pou�it csplain <Sep. 1996>. D�len� slov podle P. �eve�ka. \righthyphenmin=3

%% Deklarace registr� %%
\newcount\kapnum \newcount\secnum % ��slo kapitoly a sekce
\newcount\notenum                 % ��slo pozn�mky pod �arou
\newcount\numcite                 % ��slo reference (literatura)
\newcount\itemnum                 % ��slovan� polo�ky
\newwrite\toc                     % Pracovn� soubor pro obsah
\newwrite\cit                     % Pracovn� soubor pro reference
\newread\test                     % Testov�n� existence souboru
\newbox\quotebox                  % Box obsahuj�c� cit�t do z�hlav� kapitoly
\newdimen\unit                    % Jednotka pro rozm�ry v obr�zc�ch

%% \input jen kdy� soubor existuje %%
\def\softinput#1{\immediate\openin\test=#1
  \ifeof\test\message{Warning: the file #1 does not exist; run me twice.}%
  \else\immediate\closein\test\input #1\fi}

%% Tvorba obsahu %%               !toc.
\def\writetoc#1#2{}
\def\maketoc{\immediate\openout\toc=\jobname.toc
  \def\writetoc##1##2{\write\toc{\string\tocline{\string##1}%
   {##2}{\the\pageno}}}}
\def\settorelax#1{\ifx#1\relax \let\next=\relax
  \else \let\next=\settorelax \let #1=\relax \fi \next}
\output={\settorelax \TeX \mf \web \tt \LaTeX \AMSTeX \ps \uv \CS \relax
  \def~{ }% Tyto kontroln� sekvence nechci, aby se expandovaly do .toc
  \lineskiplimit=0pt \plainoutput}
\def\heretoc{\vfil\break % V obsahu dodr��me ��dkov� rejst��k pro 16pt ��dky.
  {\baselineskip=16pt \lineskiplimit=-\maxdimen
  \leftline{\bbf \vrule height18pt width0pt Obsah}\nobreak\vskip8pt
  \softinput{\jobname.toc}\par} \kapnum=0}
\def\tocline#1{#1}
\def\tkap#1#2{\advance\kapnum by1 \secnum=0
  \line{\hbox to2em{\hfil\bf\the\kapnum. }#1\unskip\rdotfill\ #2}}
\def\tsec#1#2{\advance\secnum by1
  \line{\hbox to65pt{\hfil\bf\the\kapnum.\the\secnum\ } #1\unskip
    \rdotfill\ #2}}
\def\tapp#1#2{\scanapp#1:
  \line{\hbox to65pt{\bf\ Dodatek \appletter.\hss} \apptitle\unskip
    \rdotfill\ #2}}
\def\scanapp#1:#2:{\def\appletter{#1}\def\apptitle{#2}}
\def\rdotfill{\leaders\hbox to5pt{\hss.\hss}\hfill}

%% Cit�t v z�hlav� kapitoly %%
\def\quotation #1\\ #2:#3\par{%
  \setbox\quotebox=\vtop{\hbox{}\hsize=3.5in \reducebaseline \noindent
  \quotefonts#1\par\noindent\eightrm#2: \eightsl#3\par\medskip\hrule\bigskip}}

%% Titul kapitoly %%
\def\title #1\par{\advance\kapnum by 1 \secnum=0 \notenum=0
  \vfill\break \ifodd\pageno\else\message{[vakat]}\global\advance\pageno by1\fi
  \hbox{} % Str�nkov� zar�ka ve vel. 2 ��dk�. Jeden zde a jeden uvnit� \vtop�
          % Za titulem kap. dodr��me ��dkov� rejst��k jen p�i mal�ch cit�tech.
  \line{\vrule depth7\baselineskip width0pt\box\quotebox\hss
     \vtop{\hbox{}\hbox{\bignum \expandafter\negkern\the\kapnum
        \ifnum\kapnum<10 \corrkern\fi}}}
  \leftline{\vrule height1.5\baselineskip width0pt\chapfonts #1}
  \lb{kap\the\kapnum}\writetoc\tkap{#1}\nobreak\vskip1.5\baselineskip}
\def\negkern#1{#1\kern-10pt}  % Z�porn� kern mezi dv�ma ��slicemi v \bignum
\def\corrkern{\kern10pt}

%% Titul sekce %%
\def\sec #1\par{\advance\secnum by 1
  \bigskip                       % Pro titulky dodr��me ��dkov� rejst��k:
  \hbox{}\lineskiplimit=-\maxdimen \nobreak\vskip-\medskipamount
  \noindent{\secfonts \the\kapnum.\the\secnum. #1}
  \writetoc\tsec{#1}\par\lineskiplimit=0pt\nobreak\medskip}

%% Odstavec "N�m�ty ke �ten�" %%
\def\citeinfo{%
  \bigskip \penalty-500
  \hbox{}\lineskiplimit=-\maxdimen \nobreak\vskip-\medskipamount
  \noindent{\secfonts N�m�ty k dal��mu �ten�}\par
  \lineskiplimit=0pt\nobreak\medskip
}

%% Vyzna�en� odstavec %%
\def\subpar #1. {\medskip\indent\llap{$\bullet$ }{\bf #1. }}

%% Titul dodatku %%
\def\appendix #1. #2\par{%
  \vfill\break \ifodd\pageno\else\message{[vakat]}\global\advance\pageno by1\fi
  \hbox{} \line{\vrule depth7\baselineskip width0pt
     \vtop{\hbox{}\hbox{DODATEK}}\hss \vtop{\hbox{}\hbox{\bignum #1}}}
  \leftline{\vrule height1.5\baselineskip width0pt\chapfonts #2}
  \writetoc\tapp{#1:#2}\nobreak\vskip1.5\baselineskip}

%% Makro na zaveden� eps obr�zk� %%     !eps.
\input epsf

%% PostScriptov� transformace %%         !pstransform.
\def\pstransform#1#2{\hbox to0pt{\special{ps:gsave
   currentpoint currentpoint translate #1 neg exch neg exch translate}%
   #2\hss\special{ps:grestore}}}

%% Um�st�n� textu do obr�zku %%
\def\s#1 #2 #3\\ {\rlap{\kern#1\unit\lower#2\unit
  \vbox to0pt{\vss\hbox to0pt{\hss#3\unskip\hss}\vss}}}

%% Prost�ed� pro za�azen� METAFONTov�ch obr�zk� %%
\def\obr#1 {\hbox{\mfobr\char#1}}
\def\begpic#1 #2 #3 {\medskip
  \hbox to\hsize\bgroup\mathsurround=0pt
  \vrule height#1\unit depth#2\unit width0pt
  \def\\##1: ##2 ##3 {\rlap{\kern##2\unit\raise##3\unit
    \hbox{$##1$}}\ignorespaces}
  \hfil\hbox to 0pt\bgroup\kern#3\unit\hbox\bgroup\\}
\def\endpic{\egroup\hss\egroup\hfil\egroup\medskip}

%% Pozn�mka pod �arou %%                     !footnote.
\def\footnote #1{\global\advance\notenum by1
  $^\the\notenum$)%
  \insert\footins{\footnotefonts \baselineskip=.8\baselineskip
    \interlinepenalty=\interfootnotelinepenalty
    \splittopskip=7.5pt
    \splitmaxdepth=3pt \floatingpenalty=20000
    \leftskip=0pt \rightskip=0pt
    \textindent{$^\the\notenum$)}\vrule height7.5pt width0pt\relax
    #1\vrule depth2.5pt width0pt\par}}

%% Bibliografick� reference a odkazy na str�nky %%     !bibmac.
\def\makecit{%             % v .cit jsou ulo�eny sekvence \bibcite a \pageref:
  \def\bibcite##1##2{\expandafter\def\csname bib:##1\endcsname{##2}}
  \def\pageref##1##2{\expandafter\ifx\csname pgl:##1\endcsname\relax
    \expandafter\def\csname pgl:##1\endcsname{##2} % definujeme poprv�
    \else % Chceme ke st�vaj�c�mu obsahu \pgl:##1 za ��rku p�idat dal�� ��slo:
    \expandafter\edef\csname pgl:##1\endcsname{\csname pgl:##1\endcsname, ##2}
    \fi}
  \softinput{\jobname.cit} % na�ten� souboru .cit z minul�ho b�hu
  \def\ncite##1{\expandafter\ifx\csname bib:##1\endcsname\relax
    \message{Warning: The bib reference ##1 undefined}??%
    \else\csname bib:##1\endcsname\fi} % odkaz na literaturu
  \def\pg##1{\expandafter\ifx\csname pgl:##1\endcsname\relax
    \message{Warning: The page label ##1 undefined}??%
    \else\pgprefix\csname pgl:##1\endcsname\fi} % odkaz na str�nku
  \immediate\openout\cit=\jobname.cit  % vytvo�en� nov�ho souboru .cit
  \def\lb##1{\write\cit{\string\pageref{##1}{\the\pageno}}} % label
  % \def\bibitem, kter� ukl�d� do .cit sekvenci \bibcite, viz soubor ap-d.tex
}
\let\pgprefix=\relax      % V souboru ap-b.tex je \def\pgprefix{:~}
\def\ncite#1{??}          % Implicitn� hodnota \ncite, kdy� nena��t�me .cit
\def\cite#1{[\ncite{#1}]} % \cite pro jedinou publikaci i se z�vorkami.
\def\pg#1{\pgprefix??}    % Implicitn� hodnota \pg, kdy� nena��t�me .cit
\def\lb#1{}               % Implicitn� hodnota \lb, kdy� nena��t�me .cit

%% �esk� uvozovky %%                       !uv.
\def\clqq{\char254 }
\def\crqq{{\edef\iSF{\spacefactor\the\spacefactor}\char255 \iSF\relax}}
\def\uv{\bgroup\aftergroup\closequotes\leavevmode\clqq\let\next=}
\def\closequotes{\unskip\crqq\relax}

%% Definice verbatim prost�ed� %%          !verb.
\catcode`\"=13
\def"{\hbox\bgroup\let"=\egroup\setverb\tt}
\def\setverb{\def\do##1{\catcode`##1=12}\dospecials\obeyspaces}
\def\begtt{\medskip\bgroup\offinterlineskip \topskip=4pt
   \hrule\vrules\nobreak\setverb \parskip=0pt
   \everypar{\vadjust{\penalty100}\hbox to0pt{\kern-\parindent
      \hbox to\hsize{\vrule\strut\hfil\vrule}\hss}}
   \catcode`\"=12\catcode`\~=13 \obeylines\reducebaseline
   \startverb}
{\catcode`\|=0 \catcode`\\=12
  |gdef|startverb#1\endtt{%
        |eightt#1|nobreak|vrules|hrule|egroup|medskip}}
{\obeyspaces\gdef {\ }}
\def\reducebaseline{\baselineskip=.8\baselineskip
   \setbox\strutbox=\hbox{\vrule height6.8pt depth2.8pt width0pt}}
\def\normalttsize{\let\eightt=\tt \let\reducebaseline=\relax}
\def\vrules{\hbox to\hsize{\vrule height3pt\hss\vrule}}

%% Prost�ed� s punt�kat�mi nebo ��slovan�mi polo�kami %%
\def\begitems{\medskip\bgroup\catcode`\*=13 \narrower}
\def\enditems{\par\egroup\medskip}
{\catcode`\*=13 \gdef*{\par\noindent\llap{$\bullet$\ }\ignorespaces}
\gdef\numerate{%                         \numerate napsat t�sn� za \begitems
  \def*{\par\advance\itemnum by1\noindent
    \llap{\bf\the\itemnum. }\ignorespaces}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Zde je mo�n� odkomentovat n�kter� ��dky, pokud nechceme zpracovat v�e  %%

%\makecit      % Na�ten� souboru s odkazy na literaturu a rejst��kov� hesla
%\nopagenumbers
%\input title  % Patitul, titul, copyright, ISBN
\pagenumbers
\input t0     % �vod
%\heretoc      % Sazba obsahu
%\maketoc      % Tvorba referenc� pro obsah
%\input ukazka % Uk�zka obrazovky p�i pr�ci na knize 

\input  t1    % Za��n�me
%\input  t2    % Stru�n� p�ehled vlastnost� TeXu
%\input  t3    % R�zn� TeXy
%\input  t4    % Prohl���me distribuce TeXu
%\input  t5    % �e�tina v TeXu
%\input  t6    % Jak TeX pracuje s fonty
%\input  t7    % Programovaci jazyk TeXu
%\input  t8    % Program METAFONT
%\input  t9    % TeX a PostScript
%\input  t10   % Obr�zky v TeXu
%\input  t11   % Sestavov�n� rejst��k� a citac�
%\input  t12   % Dob�e dokumentovan� programy

%\input ap-a   % Slovn��ek TeX-primitiv�
%\input ap-b   % Slovn��ek k METAFONTu
%\input ap-c   % Ve�ejn� arch�v TeXu
%\input ap-d   % Literatura
\input ap-e   % Uk�zky z form�tov�n� t�to kn��ky
%\input ap-f   % Fontov� tabulky
%\input ap-g   % Rejst��k
\input tiraz  % Tiraz

\bye \endall

