% SETPAGEDIMS DOCUMENT STYLE
% Last edited on 2002-04-06 16:45:50 by stolfi
% Based on largepages.sty for LaTeX 2.09
% By Pedro J. de Rezende.
%
% \usepackage{setpagedims} defines the macros
% \setpapersize and \settextsize that reset the 
% paper and text dimensions.
%
\typeout{Document Style Option `setpagedims' -- Version of 2001-10-12}

% Usage: \setpapersize{WIDTH}{HEIGHT}
%
\newcommand{\setpapersize}[2]{
  \paperwidth=#1\relax
  \paperheight=#2\relax
  % Inform dvips about the paper dimensions:
  \special{papersize=#1,#2}
}

% Usage: \settextsize{WIDTH}{HEIGHT}
%
\newcommand{\settextsize}[2]{
  \oddsidemargin=\paperwidth\relax
  \advance\oddsidemargin by-#1\relax
  \divide\oddsidemargin by 2\relax
  \advance\oddsidemargin by-1in\relax
  \evensidemargin=\oddsidemargin\relax
  \marginparwidth=\oddsidemargin\relax
  % \if@twoside
  %   \advance\oddsidemargin by -34pt
  %   \advance\evensidemargin by 26pt
  %   \advance\marginparwidth by 48pt
  % \else
  %    \advance\oddsidemargin by -4pt
  %    \advance\evensidemargin by -4pt
  %    \advance\marginparwidth by 36pt
  % \fi

  % VERTICAL SPACING:

  \topmargin=\paperheight\relax
  \advance\topmargin by-#2\relax
  \divide\topmargin by 2\relax
  \advance\topmargin by -1in\relax
  \advance\topmargin by -32pt\relax

  % DIMENSIONS OF TEXT:

  \textwidth=#1\relax
  \textheight=#2\relax
}



