Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using

\usepackage[margin=1in]{geometry}

I can create a margin of 1 inch around my document. What would be the equivalent commands if I used the native LaTeX commands such as \textwidth, \evensidemargin, etc?

share|improve this question
add comment

3 Answers 3

\documentclass{article} 
%\usepackage[margin=1in]{geometry}
\setlength\topmargin{0pt}
\addtolength\topmargin{-\headheight}
\addtolength\topmargin{-\headsep}
\setlength\oddsidemargin{0pt}
\setlength\textwidth{\paperwidth}
\addtolength\textwidth{-2in}
\setlength\textheight{\paperheight}
\addtolength\textheight{-2in}
\usepackage{layout}

\begin{document} 
\layout
\end{document}
share|improve this answer
add comment

Make it a little bit more sophisticated by setting the text height to an integer number of text lines and setting the margin pars

\usepackage{calc}

\makeatletter
\normalsize
\setlength\textheight{\paperheight-2in}%
\setlength\textwidth{\paperwidth-2in}%

\newlength\my@tdima
\newlength\my@tdimb
\newcounter{my@tcnta}
\newcounter{my@tcntb}

\setlength\my@tdima{\textheight-\topskip}%
\setcounter{my@tcnta}{\my@tdima}%
\setcounter{my@tcntb}{\baselineskip}%
\setcounter{my@tcnta}{\value{my@tcnta}/\value{my@tcntb}}%
\setlength\textheight{\baselineskip*\value{my@tcnta}+\topskip}%
\setlength\my@tdima{\paperheight-\textheight}%
\setlength\topmargin{0.5\my@tdima-\headheight-\headsep-1in}%-- Can add a ratio here
\@settopoint\topmargin

\@settopoint\textwidth
\setlength\my@tdima{\paperwidth-\textwidth}%
\setlength\oddsidemargin{0.5\my@tdima-1in}%------------------- Can add a ratio here
\@settopoint\oddsidemargin
\setlength\evensidemargin{\my@tdima-\oddsidemargin-2in}%
\@settopoint\evensidemargin

\setlength\marginparwidth{\evensidemargin+1in-\marginparsep-0.25in}%
\@settopoint\marginparwidth
\setlength\marginparsep {7pt}%
\setlength\marginparpush{7pt}%
\makeatother
share|improve this answer
add comment
\addtolength{\oddsidemargin}{-.875in}
\addtolength{\evensidemargin}{-.875in}
\addtolength{\textwidth}{1.75in}

\addtolength{\topmargin}{-.875in}
\addtolength{\textheight}{1.75in}

If I remember correctly, these are the measurements for a 1 inch margin.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.