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.

By default, LaTeX appends one inch (72.27pt) to the left (and top) of document. Here I want to prove it as follows. But I missed some other page layout macros to subtract from \paperwidth.

% the objective is to prove that
% left padding of 1in  = 72.27pt
% has been added by default
% by LaTeX

\documentclass{article}

\begin{document}
    \the
    \dimexpr
        \paperwidth
        -\hoffset
        -\oddsidemargin
        -\textwidth
        -\marginparsep
        -\marginparwidth
        % minus some other page layout macros 
        % should be there but I don't know
    \relax
\end{document}

How to express 72.27pt in terms of \oddsidemargin, \textwidth, ... that are subtracted from \paperwidth?


I need a length macro for the red segment below.

enter image description here


The reason I accepted egreg answer is due to his comment below.

Again: the length you display in red is not available directly, but only through computation: it's \paperwidth-1in-\hoffset-\oddsidemargin-\textwidth-\marginparsep-\marginparwidth

Thus it is impossible to get the required expression to prove 72.27pt.

share|improve this question
    
Load the layout package and say \layout as the only token in the document. –  egreg Jul 17 '11 at 18:04
    
That length is not stored anywhere. –  egreg Jul 17 '11 at 18:15
1  
Again: the length you display in red is not available directly, but only through computation: it's \paperwidth-1in-\hoffset-\oddsidemargin-\textwidth-\marginparsep-\marginparwidt‌​h –  egreg Jul 17 '11 at 18:29
1  
\marginparpush is the minimum vertical separation between margin notes. –  egreg Jul 17 '11 at 18:38

1 Answer 1

up vote 1 down vote accepted

The upper left corner of the text block is placed

1in + \hoffset + \oddsidemargin

from the left border of the page and

1in + \voffset + \topmargin + \headheight + \headsep

from the upper border. Of course \evensidemargin is used when the page is considered to be a right page (only in twosided printing and when the page number is even).

You can "prove" what you want with the following example:

\documentclass[a4paper]{article}
\usepackage{layout}

\addtolength{\marginparwidth}{\dimexpr\paperwidth-1in-\hoffset-\oddsidemargin-\textwidth-\marginparsep-\marginparwidth-1pt\relax}

\begin{document}
\layout
\end{document}

Now the box representing the margin note area will extend just a bit short of the right edge of the paper (1pt, actually, but the image is not perfect because the lines have a thickness).

The length you draw in red is exactly

\paperwidth-1in-\hoffset-\oddsidemargin-\textwidth-\marginparsep-\marginparwidth

If all you need is a nonstandard page size with zero margins, the answer is geometry:

\documentclass{article}
\usepackage[paperwidth=1in,paperheight=1in,margin=0pt]{geometry}

The calculations performed by the package are summarized in the log file:

* paper: custom
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes: 
* h-part:(L,W,R)=(0.0pt, 72.26999pt, 0.0pt)
* v-part:(T,H,B)=(0.0pt, 72.26999pt, 0.0pt)
* \paperwidth=72.26999pt
* \paperheight=72.26999pt
* \textwidth=72.26999pt
* \textheight=72.26999pt
* \oddsidemargin=-72.26999pt
* \evensidemargin=-72.26999pt
* \topmargin=-109.26999pt

Note that 72.27pt is the same as 72.26999pt, as far as TeX is concerned.

share|improve this answer
    
how to prove 1in has been added to the document? Please express it in terms of the available page length macros. It was the objective of my code snippet above. –  xport Jul 17 '11 at 18:17
    
it is totally nonsense to use \hoffset for that. It is meant to correct problems with a printer and not for setting paper margins. Enrico already told you how this can be done. –  Herbert Jul 17 '11 at 18:36
    
No, \hoffsetis never needed! –  Herbert Jul 17 '11 at 18:55
    
see answer for left and top margin. The \layout tells you what to do if right and bottom margin should also be 0pt –  Herbert Jul 17 '11 at 19:17

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.