% Translation: busaj
% Checking:    2006-11-15 zyka
\startcomponent ma-cb-cz-layout
\project ma-cb
\environment ma-cb-env-cz
\product ma-cb-cz

%\chapter{Page layout}
\chapter{Form�tov�n� str�nky}

%\index{layout}
%\index{page design}
\index{form�tov�n�}
\index{�prava str�nky}
\index{str�nkov� zrcadlo}
\index{z�hlav�}
\index{�pat�}
\index{margin�lie}
\index{hrana textu}
\index{vr�ek textu}
\index{spodek textu}
\seeindex{hlavi�ka}{z�hlav�}
\seeindex{pati�ka}{�pat�}

\Command{\tex{setuplayout}}
\Command{\tex{adaptlayout}}
\Command{\tex{showlayout}}
\Command{\tex{showframe}}
\Command{\tex{showsetups}}
\Command{\tex{showmakeup}}
\Command{\tex{startlocal}}

%The page layout is defined by:
Form�t str�nky je definov�n p��kazem:

\shortsetup{setuplayout}

%This command is typed in the set up area of your input file.
Tento povel se p��e do deklara�n� oblasti vstupn�ho souboru.

%You have to familiarize yourself with the parameters that
%describe your page layout. A page is divided in a number of
%areas such as the text, margin, head, foot etc. The size of
%these areas can be set with \type{\setuplayout}.
M�li bychom se obezn�mit s~parametry, kter� popisuj� form�t str�nek
(str�nkov� zrcadlo). 
Str�nka je rozd�lena na n�kolik oblast� jako nap��klad
text, z�hlav�, �pat� atd. 
Velikosti t�chto ��st� se daj� nastavit p��kazem \type{\setuplayout}.

%The different areas in the page layout are shown in
%\in{figure}[fig:pagelayout].
R�zn� oblasti ve form�tu str�nky jsou pops�ny na
\in{obr�zku}[fig:pagelayout]. Okraj je tak� naz�v�n margin�li�.

%\placefigure
%  [here]
%  [fig:pagelayout]
%  {The page layout.}
%  {\hbox{\framed[width=1.5cm,frame=off]{}
%   \framed[width=2cm,frame=off]{\tt left}
%   \framed[width=2.5cm,frame=off]{\tt left}
%   \framed[width=3cm,frame=off]{\tt text}
%   \framed[width=2.5cm,frame=off]{\tt right}
%   \framed[width=2cm,frame=off]{\tt right}}
%   \hbox{\framed[width=1.5cm,frame=off]{}
%   \framed[width=2cm,frame=off]{\tt edge}
%   \framed[width=2.5cm,frame=off]{\tt margin}
%   \framed[width=3cm,frame=off]{\tt text}
%   \framed[width=2.5cm,frame=off]{\tt margin}
%   \framed[width=2cm,frame=off]{\tt edge}}
%   \hbox{\framed[width=1.5cm,frame=off]{\tt top}
%   \framed[width=2cm]{}
%   \framed[width=2.5cm]{}
%   \framed[width=3cm]{}
%   \framed[width=2.5cm]{}
%   \framed[width=2cm]{}}
%   \hbox{\framed[width=1.5cm,frame=off]{\tt header}
%   \framed[width=2cm]{}
%   \framed[width=2.5cm]{}
%   \framed[width=3cm]{}
%   \framed[width=2.5cm]{}
%   \framed[width=2cm]{}}
%   \hbox{\framed[width=1.5cm,frame=off,height=3cm]{\tt text}
%   \framed[width=2cm,height=3cm]{}
%   \framed[width=2.5cm,height=3cm]{}
%   \framed[width=3cm,height=3cm]{}
%   \framed[width=2.5cm,height=3cm]{}
%   \framed[width=2cm,height=3cm]{}}
%   \hbox{\framed[width=1.5cm,frame=off]{\tt footer}
%   \framed[width=2cm]{}
%   \framed[width=2.5cm]{}
%   \framed[width=3cm]{}
%   \framed[width=2.5cm]{}
%   \framed[width=2cm]{}}
%   \hbox{\framed[width=1.5cm,frame=off]{\tt bottom}
%   \framed[width=2cm]{}
%   \framed[width=2.5cm]{}
%   \framed[width=3cm]{}
%   \framed[width=2.5cm]{}
%   \framed[width=2cm]{}}}

\doifmodeelse{bulletin}
  {
    \def\WColI  {1.0}
    \def\WColII {1.5}
    \def\WColIII{2.0}
    \def\WColIV {2.5}
    \def\WColV  {2.0}
    \def\WColVI {1.5}
  }
  {
    \def\WColI  {1.5}
    \def\WColII {2.0}
    \def\WColIII{2.5}
    \def\WColIV {3.0}
    \def\WColV  {2.5}
    \def\WColVI {2.0}
  }

\placefigure
  [here]
  [fig:pagelayout]
  {Form�t str�nky.}
  {\hbox{\framed[width=\WColI cm,frame=off]{}
   \framed[width=\WColII cm,frame=off]{\tt left}
   \framed[width=\WColIII cm,frame=off]{\tt left}
   \framed[width=\WColIV cm,frame=off]{}
   \framed[width=\WColV cm,frame=off]{\tt right}
   \framed[width=\WColVI cm,frame=off]{\tt right}}
   \hbox{\framed[width=\WColI cm,frame=off]{}
   \framed[width=\WColII cm,frame=off]{\tt edge}
   \framed[width=\WColIII cm,frame=off]{\tt margin}
   \framed[width=\WColIV cm,frame=off]{\tt text}
   \framed[width=\WColV cm,frame=off]{\tt margin}
   \framed[width=\WColVI cm,frame=off]{\tt edge}}
   \hbox{\framed[width=\WColI cm,frame=off]{\tt top}
   \framed[width=\WColII cm]{}
   \framed[width=\WColIII cm]{}
   \framed[width=\WColIV cm]{}
   \framed[width=\WColV cm]{}
   \framed[width=\WColVI cm]{}}
   \hbox{\framed[width=\WColI cm,frame=off]{\tt header}
   \framed[width=\WColII cm]{}
   \framed[width=\WColIII cm]{}
   \framed[width=\WColIV cm]{}
   \framed[width=\WColV cm]{}
   \framed[width=\WColVI cm]{}}
   \hbox{\framed[width=\WColI cm,frame=off,height=3cm]{\tt text}
   \framed[width=\WColII cm,height=3cm]{}
   \framed[width=\WColIII cm,height=3cm]{}
   \framed[width=\WColIV cm,height=3cm]{}
   \framed[width=\WColV cm,height=3cm]{}
   \framed[width=\WColVI cm,height=3cm]{}}
   \hbox{\framed[width=\WColI cm,frame=off]{\tt footer}
   \framed[width=\WColII cm]{}
   \framed[width=\WColIII cm]{}
   \framed[width=\WColIV cm]{}
   \framed[width=\WColV cm]{}
   \framed[width=\WColVI cm]{}}
   \hbox{\framed[width=\WColI cm,frame=off]{\tt bottom}
   \framed[width=\WColII cm]{}
   \framed[width=\WColIII cm]{}
   \framed[width=\WColIV cm]{}
   \framed[width=\WColV cm]{}
   \framed[width=\WColVI cm]{}}}

%If you want to look at your page layout you can type the
%command \type{\showframe} and process one page or the whole
%file. The areas are shown in a number of frames.
Pokud chceme vid�t form�t str�nkov�ho zrcadla, m��eme napsat p��kaz
\type{\showframe} a~zpracovat jednu stranu nebo cel� soubor. Oblasti
jsou pak na str�nce vyzna�eny n�kolika barevn�mi r�me�ky.

%The command \type{\showsetups} shows the values of the
%parameters. A combination of both commands is
%\type{\showlayout}.
P��kaz \type{\showsetups} uk�e hodnoty parametr�. Kombinac� obou p��kaz� je povel
\type{\showlayout}.

%The values of the layout parameters are available
%as commands (see \in{table}[tab:parameters]).
%This enables you to work more accurately when defining
%measures of columns, figures and tables. A few of these
%parameters are explained in \in{table}[tab:fewparameters].
Hodnoty form�tovac�ch parametr� jsou dostupn� jako p��kazy 
(viz \in{tabulku}[tab:parameters]).
To n�m umo��uje p�esn�ji definovat rozm�ry sloupc�, obr�zk� 
a~tabulek. N�kter� z~t�chto parametr� 
jsou vysv�tleny v~\in{tabulce}[tab:fewparameters].

%\placetable
%  [here,force]
%  [tab:fewparameters]
%  {A few parameters as commands.}
%\starttable[|l|l|]
%\HL
%\NC \bf Commands         \NC \bf Meaning               \NC\SR
%\HL
%\NC \type{\makeupwidth}  \NC width of the typing area  \NC\FR
%\NC \type{\makeupheight} \NC height of the typing area \NC\MR
%\NC \type{\textwidth}    \NC width of the text area    \NC\MR
%\NC \type{\textheight}   \NC height of the text area   \NC\LR
%\HL
%\stoptable
\placetable
  [here,force]
  [tab:fewparameters]
  {N�kolik parametr� ve form� p��kaz�.}
\starttable[|l|l|]
\HL
\NC \bf P��kazy         \NC \bf V�znam             \NC\SR
\HL
\NC \type{\makeupwidth}  \NC ���ka zrcadla sazby   \NC\FR
\NC \type{\makeupheight} \NC v��ka zrcadla sazby   \NC\MR
\NC \type{\textwidth}    \NC ���ka textov� oblasti \NC\MR
\NC \type{\textheight}   \NC v��ka textov� oblasti \NC\LR
\HL
\stoptable

%If you want to define the width of a column or the height of
%a figure you can do it relative to the \type{\makeupwidth}
%or \type{\makeupheight}. Changes in page width or page height
%will alter columns and figures proportionally.
Jestli�e chceme definovat ���ku sloupce nebo v��ku obr�zku,
m��eme to ud�lat relativn� k~hodnot�m \type{\makeupwidth}
nebo \type{\makeupheight}. Zm�ny nastaven� ���ky nebo v��ky str�nky
pak proporcion�ln� zm�n� rozm�ry sloupce nebo obr�zku.

%\startbuffer
%\placefigure
%  [here]
%  [fig:stepgable]
%  {A stepgable.}
%  {\externalfigure[ma-cb-19][width=.6\textwidth]}
%\stopbuffer
\startbuffer
\placefigure
  [here]
  [fig:stepgable]
  {Stup�ovit� �t�tov� ze�.}
  {\externalfigure[ma-cb-19][width=.6\textwidth]}
\stopbuffer

\typebuffer

%After processing this would become:
Po zpracov�n� dostaneme:

\getbuffer

%The other distances and measures are shown in
%\in{table}[tab:parameters].
Ostatn� vzd�lenosti a~rozm�ry jsou uvedeny 
v~\in{tabulce}[tab:parameters].

%The command \type{\setuplayout} is defined in the set up
%area of your input file, before the
%\type{\starttext} command. This means that the values of
%the parameters have a global effect and are default
%throughout the document. Nevertheless you might want to make
%slight changes in the page design for a number of pages.
P��kaz \type{\setuplayout} je definov�n v~deklara�n� oblasti 
vstupn�ho souboru, p�ed povelem \type{\starttext}. 
To znamen�, �e hodnoty parametr� jsou glob�ln� a~platn�
pro cel� dokument. 
Nicm�n� pokud pro n�kter� str�nky chceme vykonat  
drobn� zm�ny rozvr�en� str�nky, pou�ijeme

\startbuffer
\adaptlayout[21,38][height=+.5cm]
\stopbuffer

\typebuffer

%In this case page 21 and 38 have a height of .5~cm + default
%height.
V~tomto p��pad� budou m�t strany 21 a 38 v��ku rovnou 0,5~cm +
v��ka str�nky.

%For local changes in the page layout you can use:
Na lok�ln� zm�ny form�tu str�nky m��ete pou��t p��kaz:

\shortsetup{startlocal}

%For example:
Nap��klad:

%\startbuffer
%
%\start
%
%\startlocal
%  \setuplayout[height=+.5cm]
%\stoplocal
%
%Hasselt has a completely different layout than most other cities
%because of its fortifications and moats.
%
%\stop
%
%\stopbuffer

\startbuffer
\start
\startlocal
  \setuplayout[height=+.5cm]
\stoplocal

Hasselt m� �pln� jin� uspo��d�n� ne� v�t�ina m�st kv�li 
sv�m opevn�n�m a~hradn�m p��kop�m.

\stop
\stopbuffer

\typebuffer

%It is advisable not to use these local changes to often.
%It is always better to alter the text than to change the
%page layout.
Nerad�me pou��vat tyto lok�ln� zm�ny p��li� �asto.
V�dycky je lep�� pozm�nit text ne�li m�nit form�t str�nky.

%\startbuffer
%
%\starttablehead
%\HL
%\NC \bf Parameter       \NC \bf Available command       \NC\SR
%\HL
%\stoptablehead
%
%\starttabletail
%\HL
%\stoptabletail
%
%\starttables[|l|l|]
%\NC topdistance         \NC \type{\topdistance}         \NC\FR
%\NC topheight           \NC \type{\topheight}           \NC\MR
%\NC headerdistance      \NC \type{\headerdistance}      \NC\MR
%\NC headerheight        \NC \type{\headerheight}        \NC\MR
%\NC topspace            \NC \type{\topspace}            \NC\MR
%\NC headlevel           \NC \type{\headerlevel}         \NC\MR
%\NC backspace           \NC \type{\backspace}           \NC\MR
%\NC margindistance      \NC \type{\margindistance}      \NC\MR
%\NC marginwidth         \NC \type{\marginwidth}         \NC\MR
%\NC leftmarginwidth     \NC \type{\leftmarginwidth}     \NC\MR
%\NC rightmarginwidth    \NC \type{\rightmarginwidth}    \NC\MR
%\NC edgedistance        \NC \type{\edgedistance}        \NC\MR
%\NC edgewidth           \NC \type{\edgewidth}           \NC\MR
%\NC leftedgewidth       \NC \type{\leftedgewidth}       \NC\MR
%\NC rightedgewidth      \NC \type{\rightedgewidth}      \NC\MR
%\NC paperheight         \NC \type{\paperheight}         \NC\MR
%\NC paperwidth          \NC \type{\paperwidth}          \NC\MR
%\NC makeupheight        \NC \type{\makeupheight}        \NC\MR
%\NC makeupwidth         \NC \type{\makeupwidth}         \NC\MR
%\NC textheight          \NC \type{\textheight}          \NC\MR
%\NC textwidth           \NC \type{\textwidth}           \NC\MR
%\NC footerdistance      \NC \type{\footerdistance}      \NC\MR
%\NC footerheight        \NC \type{\footerheight}        \NC\MR
%\NC bottomdistance      \NC \type{\bottomdistance}      \NC\MR
%\NC bottomheight        \NC \type{\bottomheight}        \NC\LR
%\stoptables
%
%\stopbuffer
%
%\splitfloat[lines=1]
%  {\placetable
%     [here][tab:parameters]
%     {Parameters for page design.}}
%  {\getbuffer}

\startbuffer

\starttablehead
\HL
\NC \bf Parametr         \NC \bf P��kaz                  \NC\SR
\HL
\stoptablehead

\starttabletail
\HL
\stoptabletail

\starttables[|l|l|]
\NC vzd�lenost vr�ku         \NC \type{\topdistance}         \NC\FR
\NC v��ka vr�ku              \NC \type{\topheight}           \NC\MR
\NC vzd�lenost z�hlav�       \NC \type{\headerdistance}      \NC\MR
\NC v��ka z�hlav�            \NC \type{\headerheight}        \NC\MR
\NC horn� mezera             \NC \type{\topspace}            \NC\MR
\NC �rove� hlavi�ky          \NC \type{\headlevel}           \NC\MR
\NC vnit�n� okraj            \NC \type{\backspace}           \NC\MR
\NC vzd�lenost margin�li�    \NC \type{\margindistance}      \NC\MR
\NC ���ka ka�d� z~margin�li� \NC \type{\marginwidth}         \NC\MR
\NC ���ka lev� margin�lie    \NC \type{\leftmarginwidth}     \NC\MR
\NC ���ka prav� margin�lie   \NC \type{\rightmarginwidth}    \NC\MR
\NC vzd�lenost hran          \NC \type{\edgedistance}        \NC\MR
\NC ���ka ka�d� z~hran       \NC \type{\edgewidth}           \NC\MR
\NC ���ka lev� hrany         \NC \type{\leftedgewidth}       \NC\MR
\NC ���ka prav� hrany        \NC \type{\rightedgewidth}      \NC\MR
\NC v��ka pap�ru             \NC \type{\paperheight}         \NC\MR
\NC ���ka pap�ru             \NC \type{\paperwidth}          \NC\MR
\NC v��ka zrcadla            \NC \type{\makeupheight}        \NC\MR
\NC ���ka zrcadla            \NC \type{\makeupwidth}         \NC\MR
\NC v��ka textu              \NC \type{\textheight}          \NC\MR
\NC ���ka textu              \NC \type{\textwidth}           \NC\MR
\NC vzd�lenost �pat�         \NC \type{\footerdistance}      \NC\MR
\NC v��ka �pat�              \NC \type{\footerheight}        \NC\MR
\NC vzd�lenost spodku        \NC \type{\bottomdistance}      \NC\MR
\NC v��ka spodku             \NC \type{\bottomheight}        \NC\LR
\stoptables

\stopbuffer

\splitfloat[lines=1]
  {\placetable
     [here][tab:parameters]
     {Parametry pro �pravu str�nky.}}
  {\getbuffer}

\stopcomponent
