\ProvidesPackage{autopagewidth}
%This is a package which attempts to set the text width according to the
%font size.  I'm not sure this is a good idea, and I'm not sure if this
%a good implementation of this idea.  But you are free to play with this
%package as you like.  Comments are welcomed.
\PackageWarningNoLine{AutoPageWidth}{This is an experimental style^^J
 It is provided for evaluation only.}
\def\APW@text{\normalfont A rule of thumb is that no line should contain 
              more than 70 characters} %this is a text containing 70 char's
%In cmr10 it is 311pt long. Which compares to a default textwith of 345pt
%Thus the effect of this package is to widen the margins still further
%(to the chagrin of the MSword crowd no doubt)
  \setlength\@tempdima{\paperwidth}
  \addtolength\@tempdima{-2in}
  \settowidth\@tempdimb{\APW@text}
  \if@twocolumn
    \ifdim\@tempdima>2\@tempdimb\relax
      \setlength\textwidth{2\@tempdimb}
    \else
      \setlength\textwidth{\@tempdima}
    \fi
  \else
    \ifdim\@tempdima>\@tempdimb\relax
      \setlength\textwidth{\@tempdimb}
    \else
      \setlength\textwidth{\@tempdima}
    \fi
  \fi
  \@settopoint\textwidth
  \if@twoside
    \setlength\@tempdima        {\paperwidth}
    \addtolength\@tempdima      {-\textwidth}
    \setlength\oddsidemargin    {.4\@tempdima}
    \addtolength\oddsidemargin  {-1in}
    \setlength\marginparwidth   {.6\@tempdima}
    \addtolength\marginparwidth {-\marginparsep}
    \addtolength\marginparwidth {-0.4in}
  \else
    \setlength\@tempdima        {\paperwidth}
    \addtolength\@tempdima      {-\textwidth}
    \setlength\oddsidemargin    {.5\@tempdima}
    \addtolength\oddsidemargin  {-1in}
    \setlength\marginparwidth   {.5\@tempdima}
    \addtolength\marginparwidth {-\marginparsep}
    \addtolength\marginparwidth {-0.4in}
    \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
