home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / programs / amiga / pastex / macros / script / typearea.sty < prev   
Text File  |  1992-09-07  |  3KB  |  111 lines

  1. % typearea.sty -- by Frank Neukam  (06 Jun 1992)
  2.  
  3. \newif\if@hincl
  4. \def\headincludeon{\@hincltrue}
  5. \def\headincludeoff{\@hinclfalse}
  6. \@hinclfalse
  7. \newdimen\ta@pw
  8. \newdimen\ta@ph
  9. \newdimen\ta@bcor
  10. \newcount\ta@div
  11. \newdimen\ta@hblk
  12. \newdimen\ta@vblk
  13. \newdimen\ta@temp
  14. \ta@pw 210mm
  15. \ta@ph 297mm
  16. \def\typearea{\@ifnextchar [{\@typearea}{\@typearea[0mm]}}
  17. \def\@typearea[#1]#2{
  18.  \normalsize
  19.  \ta@bcor #1
  20.  \ta@div=#2
  21.  \ta@hblk \ta@pw
  22.  \advance \ta@hblk by -\ta@bcor
  23.  \divide\ta@hblk by \ta@div
  24.  \oddsidemargin -1in
  25.  \evensidemargin -1in
  26.  \if@twoside
  27.   \advance\oddsidemargin by \ta@hblk
  28.   \advance\oddsidemargin by \ta@bcor
  29.   \advance\evensidemargin by 2\ta@hblk
  30.  \else
  31.   \advance\oddsidemargin by 1.5\ta@hblk
  32.   \advance\oddsidemargin by \ta@bcor
  33.   \evensidemargin\oddsidemargin
  34.  \fi
  35.  \textwidth \ta@pw
  36.  \advance\textwidth by -\ta@bcor
  37.  \advance\textwidth by -3\ta@hblk
  38.  \headheight 15pt
  39.  \headsep 1.5\baselineskip
  40.  \ta@vblk \ta@ph
  41.  \divide\ta@vblk by \ta@div
  42.  \ta@temp \ta@ph
  43.  \advance\ta@temp by -3\ta@vblk
  44.  \if@hincl
  45.   \advance\ta@temp by -\headheight
  46.   \advance\ta@temp by -\headsep
  47.  \fi
  48.  \textheight \topskip
  49.  \@whiledim\textheight<\ta@temp
  50.   \do{\advance\textheight by \baselineskip}
  51.  \topmargin \ta@vblk
  52.  \advance\topmargin by -1in
  53.  \if@hincl \else
  54.   \advance\topmargin by -\headheight
  55.   \advance\topmargin by -\headsep
  56.  \fi
  57.  \footskip 3.5\baselineskip
  58.  \if@twoside
  59.   \marginparwidth 1.5\ta@hblk
  60.  \else
  61.   \marginparwidth \ta@hblk
  62.  \fi
  63.  \marginparsep 1cc
  64.  \marginparpush 0.45\baselineskip}
  65. \def\areaset{\@ifnextchar [{\@areaset}{\@areaset[0mm]}}
  66. \def\@areaset[#1]#2#3{
  67.  \normalsize
  68.  \ta@bcor #1
  69.  \textwidth #2
  70.  \textheight #3
  71.  \ta@hblk \ta@pw
  72.  \advance\ta@hblk by -\ta@bcor
  73.  \advance\ta@hblk by -\textwidth
  74.  \divide\ta@hblk by 3
  75.  \oddsidemargin -1in
  76.  \evensidemargin -1in
  77.  \if@twoside
  78.   \advance\oddsidemargin by \ta@hblk
  79.   \advance\oddsidemargin by \ta@bcor
  80.   \advance\evensidemargin by 2\ta@hblk
  81.  \else
  82.   \advance\oddsidemargin by 1.5\ta@hblk
  83.   \advance\oddsidemargin by \ta@bcor
  84.   \evensidemargin\oddsidemargin
  85.  \fi
  86.  \headheight 15pt
  87.  \headsep 1.5\baselineskip
  88.  \ta@vblk \ta@ph
  89.  \advance\ta@vblk by -\textheight
  90.  \divide\ta@vblk by 3
  91.  \if@hincl
  92.   \advance\textheight by -\headheight
  93.   \advance\textheight by -\headsep
  94.  \fi
  95.  \topmargin \ta@vblk
  96.  \advance\topmargin by -1in
  97.  \if@hincl \else
  98.   \advance\topmargin by -\headheight
  99.   \advance\topmargin by -\headsep
  100.  \fi
  101.  \footskip 3.5\baselineskip
  102.  \if@twoside
  103.   \marginparwidth 1.5\ta@hblk
  104.  \else
  105.   \marginparwidth \ta@hblk
  106.  \fi
  107.  \marginparsep 1cc
  108.  \marginparpush 0.45\baselineskip}
  109. \ifcase \@ptsize\relax \typearea{8} \or \typearea{10} \or \typearea{12} \fi
  110.  
  111.