Document layout and layers/Layout parameters and dimensions

From Wiki
Jump to navigation Jump to search

Table of Parameters

The first column is the name by which the variable is set in \setuplayout. The second column is the name by which TeX stores the variable. This name is usually the same, but sometimes different; knowing it allows you to invoke it with code like The paper's height is \the\paperheight. Any remarks (usually a short description) are given in the third column.

\setuplayout[...] dimension Remarks
paperheight \paperheight height of paper page
paperwidth \paperwidth width of paper page
printpaperheight \printpaperheight differs from paperheight when using Imposition (arranging)
printpaperwidth \printpaperwidth differs from paperwidth when using Imposition (arranging)
topspace \topspace above header: from top rim of paper to to top rim of header
backspace \backspace from left rim of paper to left rim of main text area
height \makeupheight sum of heights of text area, header and footer (plus distances)
width \makeupwidth width of the main text area. \makeupwidth is normally same as \textwidth, but it can be different, for example in columns
top \topheight height of the top area
topdistance \topdistance between top and header
header \headerheight height of header area
headerdistance \headerdistance between header and text
textheight \textheight height of text area
footerdistance \footerdistance between text and footer
footer \footerheight height of footer area
bottomdistance \bottomdistance between footer and bottom
bottom \bottomheight space below footer (but isn't calculated automatically)
bottomspace \bottomspace space from bottom footer to bottom rim of paper
cutspace \cutspace from right rim of paper to right rim of main text area
leftedge \leftedgewidth from left rim of paper to left rim of left margin
leftedgedistance \leftedgedistance between leftegde and left margin
leftmargin \leftmarginwidth width of left margin (marginals space)
leftmargindistance \leftmargindistance between left margin and text
textwidth \textwidth width of text area. when columns are used, the value of \textwidth can differ from \makeupwidth
rightmargindistance \rightmargindistance between text area and right margin
rightmargin \rightmarginwidth width of right margin (marginals area)
rightedgedistance \rightedgedistance between right margin and right edge
rightedge \rightedgewidth from right margin to right rim of paper
horoffset ? bleed from left of paper
voroffset ? bleed from top of paper

Note:

  • width=middle
     if cutspace == 0pt then
        cutspace = backspace
     end
     makeupwidth =  paperwidth- backspace -cutspace
  • width=fit
   
       if cutspace == 0pt then
          cutspace = backspace
       end
       makeupwidth = paperwidth-cutspace
       scratchdimen = backspace - leftedgewidth-leftedgedistance-leftmarginwidth-leftmargindistance
       if scratchdimen< 0pt then
          scratchdimen = 0pt
       end
       makeupwidth = makeupwidth - rightmargindistance-rightmarginwidth- rightedgedistance-rightedgewidth- scratchdimen
  • otherwise:
       makeupwidth=width
       if cutspace == 0pt then
          cutspace = paperwidth-makeupwidth-backspace
       else
            % A kind of inconsistent specification, but used
            % in for instance s-pre-19.tex; the cutspace is
            % used only for determining some kind of right
            % margin; don't use this in doublesided mode
       pass 
       end

(From page-lay.mkiv.)