%% This file defines RRP page geometry. It is based on size11.clo from Standard LaTeX
%%
%% Copyright 2010-2011 Alexandru Tudor Grecu <agrecu@theory.nipne.ro>
%%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
\ProvidesFile{rrp_size11.clo}[2011/02/28 v1.0 RRP style LaTeX file (page layout)]
%Times for text and some math fonts substitutions
\input{rrp_fonts.def}
%Paper sheet size:
\setlength{\paperheight}{297mm}
\setlength{\paperwidth}{210mm}
%Font sizes and paragraphing:
% - same equation vertical spacing regardless the size
\abovedisplayskip 6\p@ \@plus1\p@ \@minus1\p@	%glue above equation display
\abovedisplayshortskip 1\p@ \@plus3\p@	%glue above equation diaplay when previous text line is short
\belowdisplayshortskip 1\p@ \@plus3\p@
\belowdisplayskip \abovedisplayskip
\renewcommand\normalsize{%
   \@setfontsize\normalsize\@xipt{13.6}%%
   \let\@listi\@listI}%
\normalsize
\newcommand\small{%
   \@setfontsize\small\@xpt\@xiipt
   \def\@listi{\leftmargin\leftmargini
               \topsep 6\p@ \@plus2\p@ \@minus2\p@
               \parsep 3\p@ \@plus2\p@ \@minus\p@
               \itemsep \parsep}%
}
\newcommand\footnotesize{%
   \@setfontsize\footnotesize\@ixpt{11}%
   \def\@listi{\leftmargin\leftmargini%
               \topsep 4\p@ \@plus2\p@ \@minus2\p@%
               \parsep 2\p@ \@plus\p@ \@minus\p@%
               \itemsep \parsep}%
}
\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
\newcommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
\newcommand\large{\@setfontsize\large\@xiipt{13}}
%\newcommand\large{\@setfontsize\large\@xiipt{14}}
\newcommand\Large{\@setfontsize\Large\@xivpt{18}}
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}

\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}
\setlength\parskip{0\p@ \@plus \p@}
\setlength{\parindent}{9mm}

%unchanged from classes.dtx
\setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@}
\setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@}
\setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@}
\@lowpenalty 51
\@medpenalty 151
\@highpenalty 301
% \clubpenalty 150
% \widowpenalty 150
% \displaywidowpenalty 5
% \predisplaypenalty 1
% \postdisplaypenalty 0
% \interlinepenalty 0
% \brokenpenalty 100

%Page layout:

%Horizontal layout:
% - center page with 4cm borders on each side
\setlength\marginparsep{5\p@}
\setlength\marginparpush{5\p@}
\setlength{\hoffset}{\z@}


\setlength{\textwidth}{130mm}
\@settopoint\textwidth

%\setlength\@tempdima{\paperwidth}
%\addtolength\@tempdima{-2in}
%\setlength\@tempdimb{360\p@}
%\ifdim\@tempdima>\@tempdimb\relax
%	\setlength\textwidth{\@tempdimb}
%\else
%	\setlength\textwidth{\@tempdima}
%\fi
%\@settopoint\textwidth

\setlength\@tempdima        {\paperwidth}
\addtolength\@tempdima      {-\textwidth}
\if@twoside
	\setlength\oddsidemargin    {.5\@tempdima}%0.62 for 13:8 golden ratio
	\addtolength\oddsidemargin  {-1in}
	\setlength\marginparwidth   {.5\@tempdima}
	\addtolength\marginparwidth {-\marginparsep}
	\addtolength\marginparwidth {-0.4in}
\else
	\setlength\oddsidemargin    {.5\@tempdima}
	\addtolength\oddsidemargin  {-1in}
	\setlength\marginparwidth   {.5\@tempdima}
	\addtolength\marginparwidth {-\marginparsep}
	\addtolength\marginparwidth {-0.6in}
	%\addtolength\marginparwidth {-.4in}
\fi
\ifdim \marginparwidth >2in
	\setlength\marginparwidth{2in}
\fi
\@settopoint\oddsidemargin
\@settopoint\marginparwidth
\setlength\evensidemargin  {\paperwidth}
\addtolength\evensidemargin{-2in}
\addtolength\evensidemargin{-\textwidth}
\addtolength\evensidemargin{-\oddsidemargin}
\@settopoint\evensidemargin

\dbg@ut{Horizontal layout: \protect\paperwidth=\the\paperwidth, \protect\textwidth=\the\textwidth,  \protect\oddsidemargin=\the\oddsidemargin, \protect\evensidemargin=\the\evensidemargin, \protect\hoffset=\the\hoffset, \protect\marginparsep=\the\marginparsep, \protect\marginparwidth=\the\marginparwidth, \protect\marginparpush=\the\marginparpush}

%Vertical layout:
% - text height must be 19 cm with 5cm at the top and 5.7cm at the bottom
% - page header must be at 4 cm from upper paper edge
% - have 6pt between last text line and footer

%ceiling(9pt + 1mm(2.845274pt))
\setlength{\headheight}{12\p@}
%\headheight + \headsep = 1cm
\setlength{\@tempdima}{1cm}%must have 5cm from sheet top to top of first line on page
\addtolength{\@tempdima}{-\headheight}
\setlength\headsep   {\@tempdima}%try to accomodate 39 lines per page
\@settopoint\headsep
\setlength\topskip   {11\p@}%height of first line (do not set to 0pt!!!)
\setlength\footskip  {17\p@}%bottom last line of text to footer bottom (2\footnotesep(6)+baselineskip for footnotesize(11))
\setlength\maxdepth{.5\topskip}
\setlength{\voffset}{\z@}

%\topmargin + 1in = 4cm
%distance between top of printable area (@ 1in from paper top) and top of header box
\setlength{\topmargin}{4cm}
\addtolength{\topmargin}{-1in}
\@settopoint\topmargin

\setlength\@tempdima{\paperheight}
\addtolength\@tempdima{-5.8cm}
\addtolength\@tempdima{-1in}
\addtolength\@tempdima{-\topmargin}
\addtolength\@tempdima{-\headheight}
\addtolength\@tempdima{-\headsep}
\divide\@tempdima\baselineskip
\@tempcnta=\@tempdima
\setlength\textheight{\@tempcnta\baselineskip}
\addtolength\textheight{\topskip}
\advance\@tempcnta\@ne
\dbg@ut{\number\@tempcnta\space normal size text lines on each page of height \the\textheight\space...}

\dbg@ut{Vertical layout: \protect\paperheight=\the\paperheight, \protect\voffset=\the\voffset, \protect\topmargin=\the\topmargin, \protect\headheight=\the\headheight, \protect\headsep=\the\headsep, \protect\topskip=\the\topskip, \protect\textheight=\the\textheight, \protect\footskip=\the\footskip, \protect\topfraction=\topfraction, \protect\textfraction=\textfraction, \protect\bottomfraction=\bottomfraction,
\protect\baselineskip=\the\baselineskip}

%Footnotes:
\setlength{\skip\footins}{10\p@ \@plus \z@ \@minus 2\p@}	%keep traditional 10pt not 12pt before first footnote
\setlength{\footnotesep}{3\p@}
\dbg@ut{Footnotes vertical spacing: \protect\footnotesep=\the\footnotesep, \protect\footins=\the\skip\footins}
%Float placement:
\setcounter{topnumber}{2}	%max number of float at top of text-page
\renewcommand{\topfraction}{0.7}	%max part of text-page occupied by float at top
\setcounter{bottomnumber}{1}
\renewcommand{\bottomfraction}{0.3}
\setcounter{totalnumber}{3}	%max number of float on any page
\renewcommand{\textfraction}{.2}	%min part occupied by text on text-page
\renewcommand{\floatpagefraction}{.5}	%min part of page to produce float-page
%\setcounter{dbltopnumber}{2}	%for two columns (not used!)
%\renewcommand{\dbltopfraction}{.7}	%for two columns
%\renewcommand{\dblfloatpagefraction}{.5}	%for two columns
%Floats seps on text-page:
\setlength\floatsep{12\p@ \@plus 2\p@ \@minus 2\p@}	%between floats at top of page
\setlength{\intextsep}{12\p@ \@plus 1\p@ \@minus 1\p@}	%between float and surrounding text
\setlength{\textfloatsep}{12\p@ \@plus 1\p@ \@minus 1\p@}	%between float at top and text below
%\setlength{\dbltextfloatsep}{\textfloatsep}
%\setlength\dblfloatsep{\floatsep}
%Floats on float-page or -column:
\setlength\@fptop{0\p@ \@plus 1fil}	%stretchable space at the top of float-page
\setlength\@fpsep{2\p@ \@plus 2fil}	%strechable space between floats on float-page
\setlength\@fpbot{0\p@ \@plus 1fil}	%strechable space at the bottom of float-page
%\setlength\@dblfptop{0\p@ \@plus 1fil}	%same for double columns
%\setlength\@dblfpsep{8\p@ \@plus 2fil}	%8pt!
%\setlength\@dblfpbot{0\p@ \@plus 1fil}
%Lists layout:
%left unchanged!
\setlength\partopsep{3\p@ \@plus 1\p@ \@minus 1\p@}
\def\@listi{\leftmargin\leftmargini
            \parsep 4.5\p@ \@plus2\p@ \@minus\p@
            \topsep 9\p@   \@plus3\p@ \@minus5\p@
            \itemsep4.5\p@ \@plus2\p@ \@minus\p@}
\let\@listI\@listi
\def\@listii {\leftmargin\leftmarginii
              \labelwidth\leftmarginii
              \advance\labelwidth-\labelsep
              \topsep    4.5\p@ \@plus2\p@ \@minus\p@
              \parsep    2\p@   \@plus\p@  \@minus\p@
              \itemsep   \parsep}
\def\@listiii{\leftmargin\leftmarginiii
              \labelwidth\leftmarginiii
              \advance\labelwidth-\labelsep
              \topsep    2\p@ \@plus\p@\@minus\p@
              \parsep    \z@
              \partopsep \p@ \@plus\z@ \@minus\p@
              \itemsep   \topsep}
\def\@listiv {\leftmargin\leftmarginiv
              \labelwidth\leftmarginiv
              \advance\labelwidth-\labelsep}
\def\@listv  {\leftmargin\leftmarginv
              \labelwidth\leftmarginv
              \advance\labelwidth-\labelsep}
\def\@listvi {\leftmargin\leftmarginvi
              \labelwidth\leftmarginvi
              \advance\labelwidth-\labelsep}
\normalsize
\endinput
%% End of file
