Page layout

In this section, we describe how TeXmacs fills pages with typesetted content. Besides specifying the settings on how to print a document, the user may also determine the way pages should be rendered on screen. It should be noticed that the number of environment variables is redundant in the sense that some variables are computed as a function of other ones. For instance, by default, the paragraph width is computed as a function of the page size and the left and right margins.

Paper specific variables

page-typea4
(the size of pages)

Specify the size of a page when printing out. Most standard formats are available in DocumentPageSize. By default, the paper size is the one of your printer (the default printer settings may be changed in EditPreferencesPrinter). When the page-type is set to user, then the page size is given by page-width and page-height.

page-orientationportrait
(page orientation)

The orientation of pages can be either portrait or landscape.

page-nr0
(current page number)

The current page number. This environment variable should be manipulated with care, since it is not yet available at typesetting time. For a reliable determination of page numbers, one may combine the label and page-ref primitives. Nevertheless, the page-nr variable can be used in the macros which render page headers and footers.

page-the-page
(display the page number)

This environment variable really contains the macro which is used for rendering the page-number. By default, it renders page-nr. The macro takes no arguments. In order to simulate a document whose first page number os 123, one may redefine

<assign|page-the-page|<macro|<plus|page-nr|122>>>

page-breakingoptimal
(page breaking algorithm)

This parameter specifies the page breaking algorithm. The default optimal algorithm takes into account the global document and tries hard to avoid bad page breaks. The alternative sloppy algorithm uses a fast first-fit algorithm, but produces bad page break with a higher probability. The medium quality algorithm is the same as the optimal algorithm, except for two column content.

page-flexibility1.0
(flexibility for stretching)

This parameter specifies how much stretchable spaces may be extended or reduced in order to fill pages which are too short or too long. A page flexibility of 1 allows spaces to be stretched to their minimal and maximal values. A page flexibility of 0 prevents spaces to be stretched. For other values of page-flexibility the behaviour is linear.

page-shrink1fn
(allowed amount of page shrinking)

In the case when it is very hard to find good page breaks, this parameter specifies an additional amount of space by which a page is allowed to be reduced.

page-extend0fn
(allowed amount of page extensions)

In the case when it is very hard to find good page breaks, this parameter specifies an additional amount of space by which a page is allowed to be extended.

Screen specific variables

page-mediumpapyrus
(the page medium)

This environment variable, which is initialized using DocumentPageType, specifies how pages are rendered on the screen. The following values are available:

paper

Page breaks are visually indicated on the screen. This mode is useful for ajusting the final version of a document before printing or sending it to a publisher. However, the use of this mode slows down the editor since every modification in the document triggers the page-breaking algorithm.

Notice also that the mere selection of this mode does not imply the screen margins and page decorations to be as on paper. In order to previsualize a document in a fully realistic way, you should also set DocumentViewPage layoutShow header and footer and DocumentViewPage layoutMargins as on paper.

papyrus
The paragraph width is the same as on paper, but page breaking is disabled. This mode is most useful during the editing phase of a document which will ultimately be printed out. It combines a reasonable editing speed with realistic line breaks.
automatic
The paragraph width is as large as possible so as to fit into the current window and page breaking is disabled. This setting, which makes optimal use of the available space on your screen, is useful for documents which are not intended to be printed out. It may for instance be selected when using TeXmacs as a browser or as an interface to computer algebra systems.

page-screen-width10cm
(width of the rendering window)

In automatic mode, this environement variable contains the width of the screen.

page-screen-height10cm
(height of the rendering window)

In automatic mode, this environement variable contains the height of the screen.

page-screen-margintrue
(special margins for screen editing?)

This flag specifies whether the screen margins are manually specified by the user, or whether they are the same as on paper.

page-screen-left5mm

page-screen-right5mm

page-screen-top15mm

page-screen-bot15mm
(left margin on screen)

When page-screen-margin is true, then these environment variables determine the margins which are to be used for rendering on the screen.

page-show-hffalse
(show headers and footers on screen?)

This flag determines whether the page headers and footers should be visible on the screen. When set to true, it should be noticed that the headers and footers are not always correctly updated when editing. In the case when you suspect them to be wrong, refreshing the display by scrolling down and up should display the correct values.

Specifying the margins

The parameters for page margins are represented schematically at the left hand side in figure ?. One may either specify the paragraph width as a function of the left and right margins, or vice versa. The left and right margins may depend on whether the page number is odd or even.

page-width-marginfalse

page-height-marginfalse
(compute margins from main text dimensions?)

When page-width-margin is set to false, then the paragraph width par-width is determined automatically from the page size and the left and right margins. When set to true, the left and right margins are determined as a function of the page size, the paragraph width, page-odd-shift and page-even-shift. For compatability with TeX/LaTeX, it is also possible to set page-width-margin to tex, in which case the horizontal margins are determined from page-odd, page-even and par-width. The page-height-margin variable plays a similar role for the vertical margins.

page-widthauto

page-heightauto
(page width)

By default, the width and height of a page are automatically determined from the page type. When page-type is set to user, then the user may manually specify the page size using page-width and page-height.

page-oddauto

page-evenauto
(left margin)

If page-width-margin is set to false, then page-odd and page-even specify the left margins for odd and even pages. If page-width-margin is true, then these values are computed as a function of the page size, the paragraph width, page-odd-shift and page-even-shift. When page-odd and page-even are set to auto, then a nice default left margin is determined as a function of the specified page type.

page-rightauto
(right margin)

If page-width-margin is set to false, then page-right specifies the right margin for odd pages. The right margin for even pages is given by the formula

page-right + page-even - page-odd

If page-width-margin is true or when page-right is set to auto, then the right margin is determined in a similar way as the left margin.

page-odd-shift0mm

page-even-shift0mm
(margin shifts)

If page-width-margin is set to true, then the left margins for odd and even pages are determined from the page size, paragraph width and the margin shifts using the formulas

page-even =
page-width - par-width
2
+ page-odd-shift
page-odd =
page-width - par-width
2
+ page-even-shift

The right margin is always taken to be such that the paragraph width and the left and right margins sum up to the page width.

Figure 1. Schematic representation of the layout of pages. On the left hand side, the parameters l, r, t and b respectively correspond to the left, right, top and bottom margins, and w corresponds to the paragraph width. On the right hand side, h, f, d and m correspond to the header, footer, footnote and marginal note separations, w to the width of marginal notes, and l to the length of the footnote bar.

Page decorations

page-odd-header

page-odd-footer

page-even-header

page-even-footer
(header for odd pages)

These environment variables contain the header and footer texts for odd and even pages.

page-head-sep8mm

page-foot-set8mm
(separation between headers/fotters and text)

These parameters determine the space between the main text and page headers and footers. They correspond to the h and f distances at the right hand side of figure ?.

page-fnote-sep1.0fn
(space between footnotes and text)

The separation between the main text and footnotes, i.e. the distance d in figure ?.

page-fnote-barlen7.5fn
(length of footnote bars)

The length of the foornote bar.

page-float-sep1.5fn
(separation between floats and text)

The separation between the main text and floating objects.

page-mnote-sep5mm
(separation between marginal notes and text)

The separation between marginal notes and the main text (not implemented yet).

page-mnote-width15mm
(width of marginal notes)

The width of marginal notes (not implemented yet).

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".