summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ncclatex/nccfit.clo
blob: 4bf31fc1d361fe52af8d40d7afe765b3ff750789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
\ProvidesFile{nccfit.clo}
         [2002/01/25 v1.00 Fit to page option (NCC)]
%
% Fits \textwidth, \textheight, and \marginparwidth to paper size.
% Got from standard size options.
%
\ifcase\@ptsize \setlength\textwidth{345\p@}
\or             \setlength\textwidth{360\p@}
\or             \setlength\textwidth{390\p@}
\or\or          \setlength\textwidth{470\p@}
\fi
\if@twocolumn
  \setlength\textwidth{2\textwidth} 
  \addtolength\textwidth{\columnsep}
\fi
\setlength\@tempdima{\paperwidth}
\addtolength\@tempdima{-2in}
\ifdim\@tempdima<\textwidth \setlength\textwidth{\@tempdima} \fi
\@settopoint\textwidth
%
\setlength\@tempdima{\paperheight}
\addtolength\@tempdima{-3.5in}
\divide\@tempdima\baselineskip
\@tempcnta=\@tempdima
\setlength\textheight{\@tempcnta\baselineskip}
\addtolength\textheight{\topskip}
%
\if@twoside
  \setlength\@tempdima        {\paperwidth}
  \addtolength\@tempdima      {-\textwidth}
  \setlength\marginparwidth   {.6\@tempdima}
  \addtolength\marginparwidth {-\marginparsep}
  \addtolength\marginparwidth {-.4in}
\else
  \setlength\@tempdima        {\paperwidth}
  \addtolength\@tempdima      {-\textwidth}
  \setlength\marginparwidth   {.5\@tempdima}
  \addtolength\marginparwidth {-\marginparsep}
  \addtolength\marginparwidth {-.8in}
\fi
\ifdim \marginparwidth >2in \setlength\marginparwidth{2in}\fi
\@settopoint\marginparwidth
\endinput