% Translation: busaj
% Check: 2006-11-09 zyka
\startcomponent ma-cb-cz-document
\project ma-cb
\product ma-cb-cz
\environment ma-cb-env-cz

%\chapter{How to create a document}
\chapter{Jak vytvo�it dokument}

%\index{input file}
\index{vstupn� soubor}

%Let's assume you want to create a simple document. It has
%some structure and contains a title page, a few chapters,
%sections and sub sections. Of course there is a table of
%contents and an index.
�ekn�me, �e chceme vytvo�it jednoduch� dokument.
M� n�jakou strukturu a obsahuje tituln� stranu, n�kolik kapitol,
sekc� a podsekc�. P�irozen� m� tak� obsah a~rejst��k.


%\CONTEXT\ can create such a document automatically if you
%offer the right input by means of a file. So first you have
%to create an input file. An input file consists of a name
%and an extension. You can choose any name you want but the
%extension has to be \type{tex}. If you create a file with
%the name \type{myfile.tex} you will find no difficulties in
%running \CONTEXT.
\CONTEXT\ dok�e takov� dokument vytvo�it automaticky, kdy� mu poskytneme
spr�vn� vstup ve form� souboru. Nejprve tedy mus�me vytvo�it 
vstupn� soubor. �pln� n�zev vstupn�ho souboru se skl�d� ze jm�na a~p��pony. 
Jm�no m��eme zvolit libovoln�, ale p��pona mus� b�t \type{tex}. 
Kdy� vytvo��me soubor s~n�zvem \type{mujsoubor.tex}, nebudeme m�t
s~b�hem \CONTEXT{}u ��dn� pot��e.

%An \pagereference[inputfile] input file could look like
%this:
Vstupn� soubor \pagereference[inputfile] m��e vypadat n�sledovn�:

%\startbuffer
%\starttext
%
%\startstandardmakeup
%  \midaligned{How to make a document.}
%  \midaligned{by}
%  \midaligned{The Author}
%\stopstandardmakeup
%
%\completecontent
%
%\chapter{Introduction}
%
%... your text\index{indexentry} ...
%
%\chapter{One Chapter}
%
%\section[firstsection]{The first section}
%
%... your text ...
%
%\section{The second section}
%
%\subsection{the first sub section}
%
%... your text\index{another indexentry} ...
%
%\subsection{the second sub section}
%
%... your text ...
%
%\section{The third section}
%
%... your text ...
%
%\chapter{Another Chapter}
%
%... your text ...
%
%\chapter[lastchapter]{The Last Chapter}
%
%... your text ...
%
%\completeindex
%
%\stoptext
%\stopbuffer
\startbuffer
\starttext

\startstandardmakeup
  \midaligned{Jak vytvo�it dokument}
  \midaligned{Autor}
\stopstandardmakeup

\completecontent

\chapter{P�edmluva}

... vlastn� text\index{prvek rejst��ku} ...

\chapter{Prvn� kapitola}

\section[prvnisekce]{Prvn� sekce}

... vlastn� text ...

\section{Druh� sekce}

\subsection{Prvn� podsekce}

... vlastn� text\index{dal�� prvek rejst��ku} ...

\subsection{Druh� podsekce}

... vlastn� text ...

\section{T�et� podsekce}

... vlastn� text ...

\chapter{Dal�� kapitola}

... vlastn� text ...

\chapter[poslednikapitola]{Posledn� kapitola}

... vlastn� text ...

\completeindex

\stoptext
\stopbuffer

{\switchtobodyfont[9pt]\typebuffer}

%\CONTEXT\ expects a plain \ASCII\ input file. Of course you
%can use any texteditor or wordprocessor you want, but you
%should not forget that \CONTEXT\ can only read \ASCII\
%input. Most texteditors or wordprocessors can export your
%file as plain \ASCII.
\CONTEXT\ o�ek�v� na vstupu prost� soubor v~k�dov�n� \ASCII. 
M��eme samoz�ejm� pou��vat libovoln� textov� editor nebo procesor, 
ale nesm�me zapomenout, �e \CONTEXT\ dok�e na��st jenom \ASCII\ vstup. 
V�t�ina editor� nebo textov�ch procesor� um� exportovat
soubory do prost�ho \ASCII.

%The input file should contain the text you want to be
%processed by \CONTEXT\ and the \CONTEXT\ commands. A
%\CONTEXT\ command begins with a backslash~\tex{}. With
%the command \type{\starttext} you indicate the beginning of
%your text. The area before \type{\starttext} is called the
%set up area and is used for defining new commands and setting up
%the layout of your document.
Vstupn� soubor by m�l obsahovat text, kter� chceme zpracovat 
programem \CONTEXT, a p��kazy \CONTEXT{}u. P��kazy
\CONTEXT{}u za��naj� znakem~\tex{}. P��kazem \type{\starttext} 
ozna�ujeme za��tek textu. Oblast p�ed p��kazem \type{\starttext} se naz�v�
deklara�n� oblast a pou��v� se k~definov�n� nov�ch p��kaz� a nastaven� vzhledu
dokumentu.

%A command is usually followed by a left and right bracket
%pair \type{[]} and/or a left and right brace \type{{}}. In
%\type{\chapter[lastchapter]{The Last Chapter}} the command
%\type{\chapter} for example tells \CONTEXT\ to perform a
%few actions concerning design, typography and structure.
%These actions may be:
Za p��kazem obvykle n�sleduje dvojice hranat�ch z�vorek
 \type{[]} a/nebo lev� a~prav� slo�en� z�vorka \type{{}}. V~sekvenci
 \type{\chapter[poslednikapitola]{Posledn� kapitola}} nap��klad povel 
\type{\chapter} po \CONTEXT{}u po�aduje, aby vykonal
n�kolik �innost� t�kaj�c�ch se �pravy, typografie a~struktury.
T�mito �innostmi m��e b�t:

%\startitemize[n,packed]
%\item start a new page
%\item increase chapter number by one
%\item place chapter number in front of chapter title
%\item reserve some vertical space
%\item use a big font
%\item put chapter title (and page number) in table of contents
%\stopitemize
\startitemize[n,packed]
\item za��tek nov� strany,
\item zv�t�en� po��tadla kapitol o jednotku,
\item um�st�n� ��sla kapitoly p�ed jej� n�zev,
\item vynech�n� ur�it�ho vertik�ln�ho prostoru,
\item pou�it� v�t��ho p�sma nebo
\item ulo�en� n�zvu kapitoly (a ��sla str�nky) do obsahu.
\stopitemize

%These actions will be performed on the argument that is
%given between the left and right braces: {\em The Last
%Chapter}.
Tyto �innosti budou vykon�ny s~argumentem zadan�m mezi 
levou a~pravou svorkou: {\em Posledn� kapitola}.

%The \type{[lastchapter]} between brackets has not been
%mentioned yet. This is a label with a logical name that can
%be used for refering to that specific chapter. This can be
%done with yet some other \CONTEXT\ commands:
%\type{\in{chapter}[lastchapter]} that typesets the chapter
%number, while \type{\about[lastchapter]} returns the title.
Dosud jsme se nezm�nili o~parametru \type{[poslednikapitola]} 
mezi hranat�mi z�vorkami. Je to n�v�t� s~referen�n�m jm�nem, 
kter� je mo�n� pou��t pro odkaz na odpov�daj�c� kapitolu. 
Toho se doc�l� dal��mi p��kazy \CONTEXT{}u:
\type{\in{kapitole}[poslednikapitola]} vys�z� ��slo kapitoly, zat�mco 
\type{\about[poslednikapitola]} vr�t� jej� n�zev.

%So now the list of actions can be extended with:
Seznam �innost� tedy m��e b�t roz���en~o:

%\startitemize[continue]
%\item let label \type{lastchapter} be chapter number
%      and title (and store these for later use)
%\stopitemize
\startitemize[continue]
\item zaveden� referen�n�ho jm�na \type{poslednikapitola}, kter�
reprezentuje ��slo a n�zev kapitoly (a~ulo�� se pro pozd�j�� pou�it�).
\stopitemize

%Other actions concerning running heads, number resetting and
%interactivity are disregarded at this moment.
Dal��m �innostem t�kaj�c�m se pr�b�n�ch nadpis�, nastaven� 
��ta�� nebo interaktivn�ch vlastnost� se nyn� nebudeme v�novat.

%If you have \CONTEXT\ process this example file, you would
%obtain a very simple document with a few numbered chapters
%and section headers.
Kdy� nech�me \CONTEXT\ zpracovat uveden� vzorov� soubor, z�sk�me 
velmi jednoduch� dokument s~n�kolika o��slovan�mi kapitolami a 
s~hlavi�kami odd�l�.

%While processing the file \CONTEXT\ takes care of many
%things. One of these things is for example page numbering.
%But in order to make a table of contents \CONTEXT\ needs
%page numbers that are not yet known to \CONTEXT\ at the
%first run. So you have to process this file twice (a two
%pass job). \CONTEXT\ will produce a few auxilliary files to
%store this kind of information. These are to be processed by
%\TEXUTIL. In some instances you have to proces an input file
%thrice (a three pass job). One can use \TEXEXEC\ to run
%\CONTEXT\ from the command line. This \PERL\ script also
%takes care of the multiple passes.  \TEXEXEC\ is part of the
%standard \CONTEXT\ distribution.
B�hem zpracov�n� souboru se \CONTEXT\ star� o~spoustu v�c�. 
Jednou z~nich je nap��klad ��slov�n� str�nek.
Ov�em k~vytvo�en� obsahu \CONTEXT\ pot�ebuje zn�t ��sla str�nek, kter�
mu p�i~prvn�m pr�b�hu zat�m nejsou zn�m�. 
Proto mus�me tento soubor zpracovat dvakr�t (dvojpr�chodov� �loha). 
K~ulo�en� t�chto a podobn�ch informac� \CONTEXT\ vytvo�� n�kolik pomocn�ch
soubor�, kter� se pak zpracov�vaj� programem
\TEXUTIL. V~n�kter�ch p��padech mus�me vstup\-n� soubor
zpracovat t�ikr�t (trojpr�chodov� �loha). Je tak� mo�n� spou�t�t
\CONTEXT\ z~p��kazov� ��dky p��kazem \TEXEXEC. Tento skript,
% VZ new
d��ve napsan� v~\PERL{}u dnes v~\RUBY{},
se postar� i o~v�cen�sobn� pr�chody. \TEXEXEC\ je sou��st�
standardn� distribuce \CONTEXT{}u.

\stopcomponent
