
nengel@7: % simplemargins.sty
nengel@7: %
nengel@7: %   by Jonathan Kamens (jik@GZA.COM)
nengel@7: %   March 15, 1993
nengel@7: %
nengel@7: % This is something that non-hacker-type \LaTeX users have needed for
nengel@7: % a long time.  It's just really stupid to have to explain how all of
nengel@7: % the page dimensions work, and how to use \setlength and \addtolength
nengel@7: % to change them, evey time someone who doesn't really care about it
nengel@7: % wants to change their margins.  This file gives them the ability to
nengel@7: % do that easily.
nengel@7: %
nengel@7: % \setleftmargin{dimen} sets the left margin to that width
nengel@7: % \setrightmargin{dimen} sets the right margin to that width
nengel@7: % \settopmargin{dimen} sets the top margin to that width
nengel@7: % \setbottommargin{dimen} sets the bottommargin to that width
nengel@7: % \setallmargins{dimen} sets all four margins to that width
nengel@7: % 
nengel@7: % \setpagewidth{dimen} sets the page width to that width
nengel@7: % \setpageheight{dimen} sets the page height to that width
nengel@7: % 
nengel@7: % The page is assumed to be 8.5 x 11 when this file is initially
nengel@7: % loaded.  If this is not the case, then use
nengel@7: % 
nengel@7: % 	\setlength{\smpagewidth}{dimen}
nengel@7: %	\setlength{\smpageheight}{dimen}
nengel@7: % 
nengel@7: % after loading simplemargins to set the actual page width and height,
nengel@7: % before using any of the other simplemargins command (*including*
nengel@7: % \setpagewidth or \setpageheight, which depend on the previous values
nengel@7: % for \smpagewidth and \smpageheight).
nengel@7: 
nengel@7: \typeout{Simplemargins margin control commands <15 Mar 93>.}
nengel@7: 
nengel@7: \newlength{\smpagewidth}
nengel@7: \newlength{\smpageheight}
nengel@7: 
nengel@7: \setlength{\smpagewidth}{8.5in}
nengel@7: \setlength{\smpageheight}{11in}
nengel@7: 
nengel@7: \newcommand{\setpagewidth}[1]{
nengel@7: 	\addtolength{\smpagewidth}{-#1}
nengel@7: 	\addtolength{\textwidth}{-\smpagewidth}
nengel@7: 	\setlength{\smpagewidth}{#1}
nengel@7: }
nengel@7: \newcommand{\setpageheight}[1]{
nengel@7: 	\addtolength{\smpageheight}{-#1}
nengel@7: 	\addtolength{\textheight}{-\smpageheight}
nengel@7: 	\setlength{\smpageheight}{#1}
nengel@7: }
nengel@7: \newcommand{\setleftmargin}[1]{
nengel@7: 	\addtolength{\textwidth}{\oddsidemargin}
nengel@7: 	\addtolength{\textwidth}{1in}
nengel@7: 	\addtolength{\textwidth}{-#1}
nengel@7: 	\setlength{\oddsidemargin}{-1in}
nengel@7: 	\addtolength{\oddsidemargin}{#1}
nengel@7: 	\setlength{\evensidemargin}{\oddsidemargin}
nengel@7: }
nengel@7: \newcommand{\setrightmargin}[1]{
nengel@7: 	\setlength{\textwidth}{\smpagewidth}
nengel@7: 	\addtolength{\textwidth}{-\oddsidemargin}
nengel@7: 	\addtolength{\textwidth}{-1in}
nengel@7: 	\addtolength{\textwidth}{-#1}
nengel@7: }
nengel@7: \newcommand{\settopmargin}[1]{
nengel@7: 	\addtolength{\textheight}{\topmargin}
nengel@7: 	\addtolength{\textheight}{1in}
nengel@7: 	\addtolength{\textheight}{\headheight}
nengel@7: 	\addtolength{\textheight}{\headsep}
nengel@7: 	\addtolength{\textheight}{-#1}
nengel@7: 	\setlength{\topmargin}{-1in}
nengel@7: 	\addtolength{\topmargin}{-\headheight}
nengel@7: 	\addtolength{\topmargin}{-\headsep}
nengel@7: 	\addtolength{\topmargin}{#1}
nengel@7: }
nengel@7: \newcommand{\setbottommargin}[1]{
nengel@7: 	\setlength{\textheight}{\smpageheight}
nengel@7: 	\addtolength{\textheight}{-\topmargin}
nengel@7: 	\addtolength{\textheight}{-1in}
nengel@7: 	\addtolength{\textheight}{-\footskip}
nengel@7: 	\addtolength{\textheight}{-#1}
nengel@7: }
nengel@7: \newcommand{\setallmargins}[1]{
nengel@7: 	\settopmargin{#1}
nengel@7: 	\setbottommargin{#1}
nengel@7: 	\setleftmargin{#1}
nengel@7: 	\setrightmargin{#1}
nengel@7: }




