| 1 |
\ProvidesPackage{autopagewidth} |
| 2 |
%This is a package which attempts to set the text width according to the |
| 3 |
%font size. I'm not sure this is a good idea, and I'm not sure if this |
| 4 |
%a good implementation of this idea. But you are free to play with this |
| 5 |
%package as you like. Comments are welcomed. |
| 6 |
\PackageWarningNoLine{AutoPageWidth}{This is an experimental style^^J |
| 7 |
It is provided for evaluation only.} |
| 8 |
\def\APW@text{\normalfont A rule of thumb is that no line should contain |
| 9 |
more than 70 characters} %this is a text containing 70 char's |
| 10 |
%In cmr10 it is 311pt long. Which compares to a default textwith of 345pt |
| 11 |
%Thus the effect of this package is to widen the margins still further |
| 12 |
%(to the chagrin of the MSword crowd no doubt) |
| 13 |
\setlength\@tempdima{\paperwidth} |
| 14 |
\addtolength\@tempdima{-2in} |
| 15 |
\settowidth\@tempdimb{\APW@text} |
| 16 |
\if@twocolumn |
| 17 |
\ifdim\@tempdima>2\@tempdimb\relax |
| 18 |
\setlength\textwidth{2\@tempdimb} |
| 19 |
\else |
| 20 |
\setlength\textwidth{\@tempdima} |
| 21 |
\fi |
| 22 |
\else |
| 23 |
\ifdim\@tempdima>\@tempdimb\relax |
| 24 |
\setlength\textwidth{\@tempdimb} |
| 25 |
\else |
| 26 |
\setlength\textwidth{\@tempdima} |
| 27 |
\fi |
| 28 |
\fi |
| 29 |
\@settopoint\textwidth |
| 30 |
\if@twoside |
| 31 |
\setlength\@tempdima {\paperwidth} |
| 32 |
\addtolength\@tempdima {-\textwidth} |
| 33 |
\setlength\oddsidemargin {.4\@tempdima} |
| 34 |
\addtolength\oddsidemargin {-1in} |
| 35 |
\setlength\marginparwidth {.6\@tempdima} |
| 36 |
\addtolength\marginparwidth {-\marginparsep} |
| 37 |
\addtolength\marginparwidth {-0.4in} |
| 38 |
\else |
| 39 |
\setlength\@tempdima {\paperwidth} |
| 40 |
\addtolength\@tempdima {-\textwidth} |
| 41 |
\setlength\oddsidemargin {.5\@tempdima} |
| 42 |
\addtolength\oddsidemargin {-1in} |
| 43 |
\setlength\marginparwidth {.5\@tempdima} |
| 44 |
\addtolength\marginparwidth {-\marginparsep} |
| 45 |
\addtolength\marginparwidth {-0.4in} |
| 46 |
\addtolength\marginparwidth {-.4in} |
| 47 |
\fi |
| 48 |
\ifdim \marginparwidth >2in |
| 49 |
\setlength\marginparwidth{2in} |
| 50 |
\fi |
| 51 |
\@settopoint\oddsidemargin |
| 52 |
\@settopoint\marginparwidth |
| 53 |
\setlength\evensidemargin {\paperwidth} |
| 54 |
\addtolength\evensidemargin{-2in} |
| 55 |
\addtolength\evensidemargin{-\textwidth} |
| 56 |
\addtolength\evensidemargin{-\oddsidemargin} |
| 57 |
\@settopoint\evensidemargin |