GNU TeXmacsUser manualReferenceAboutEnglishยทDeutsch
Page layout

In this section, we describe how TeXmacs fills pages with typeset 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-type\(:=\)a4
(the size of pages)

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

The known page types, together with their default dimensions and margins, are listed in

Graphics/Renderer/page_type.cpp

. Besides the usual paper formats (a0, …, a10, b0, …, letter, legal, etc.), this includes screen formats such as 4:3 and 16:9, which are used for presentations. Unknown page types fall back to the dimensions of a4.

page-orientation\(:=\)portrait
(page orientation)

The orientation of pages can be either portrait or landscape.

page-crop-marks\(:=\)
(paper type for crop marks)

When non-empty (and when page-medium is paper), this variable specifies a larger paper type (like a3, a4 or letter) on which the pages of type page-type are printed, together with crop marks. It may be set in Document\(\rightarrow\)Page\(\rightarrow\)Crop marks.

page-printed\(:=\)false
(are we printing?)

This flag is set to true by the editor while typesetting a document for printing (or exporting to Pdf or PostScript). It allows the rendering of certain elements (like hyperlinks and scrollable canvases) to differ between the screen and paper. It should not be set by the user.

page-nr\(:=\)0
(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 pageref 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 is \(123\), one may redefine

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

In practice, it is simpler to set page-first for this purpose.

page-first\(:=\)1
(number of the first page)

The number of the first page of the document. This value is read once when the style is initialized (it cannot be changed locally using with). It may be set in the global page format dialog (field “First page”) and is typically used for documents which are part of a larger project.

page-breaking\(:=\)professional
(page breaking algorithm)

This parameter specifies the page breaking algorithm. The default professional algorithm (the older name optimal is treated in the same way) 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 professional algorithm, except for two column content.

page-flexibility\(:=\)1
(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-shrink\(:=\)1fn
(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-extend\(:=\)0fn
(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-medium\(:=\)papyrus
(the page medium)

This environment variable, which is initialized using Document\(\rightarrow\)Page\(\rightarrow\)Type, 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 adjusting 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 select Document\(\rightarrow\)Page\(\rightarrow\)Screen margins\(\rightarrow\)Margins as on paper (and make sure that page-show-hf is true).

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. In the menu, this value is called “Screen”.

beamer

Similar to paper, but each page is given at least the full height of a page, and scroll bars are hidden in full screen mode. This medium is used for presentations.

The additional page “types” book, panorama and slideshow in Document\(\rightarrow\)Page\(\rightarrow\)Type are not values of page-medium: they select the paper medium in combination with suitable values of page-border, page-packet and page-offset (see below).

page-border\(:=\)default
(page border decorations)

Determines how page borders are drawn on the screen in paper mode. With none, no borders are drawn (this value is used when printing). With attached, successive pages in a packet are drawn next to each other without separation, like the facing pages of a book. Any other value (such as the default default) draws a small border around each page.

page-packet\(:=\)1

page-offset\(:=\)0
(display pages side by side)

In paper mode, pages are displayed on the screen by packets of page-packet pages which are placed next to each other. The page-offset specifies the position of the first page inside the first packet; for instance, a book-like layout is obtained with page-packet set to 2, page-offset set to 1 and page-border set to attached.

page-single\(:=\)false
(display page by page)

This flag is read together with the other page parameters, but it is currently not used by the typesetter.

page-screen-width\(:=\)10cm
(width of the rendering window)

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

page-screen-height\(:=\)10cm
(height of the rendering window)

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

page-screen-margin\(:=\)true
(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. It is toggled by Document\(\rightarrow\)Page\(\rightarrow\)Screen margins\(\rightarrow\)Margins as on paper and it is automatically set to false when printing.

page-screen-left\(:=\)5mm

page-screen-right\(:=\)5mm

page-screen-top\(:=\)15mm

page-screen-bot\(:=\)15mm
(margins 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-hf\(:=\)true
(show headers and footers on screen?)

This flag determines whether the page headers and footers should be visible on the screen. It only has an effect in paper mode and it is forced to true when printing. 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-margin\(:=\)false

page-height-margin\(:=\)false
(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 compatibility 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: when false, the height of the main text is determined from the page height, page-top and page-bot; when true, the height of the main text is given by page-user-height and the text is vertically centered on the page; when tex, it is given by page-user-height and the top margin by page-top.

page-width\(:=\)auto

page-height\(:=\)auto
(page size)

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-odd\(:=\)auto

page-even\(:=\)auto
(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-right\(:=\)auto
(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

\(\displaystyle \text{{\text{{\itshape{page-right}}}}} + \text{{\text{{\itshape{page-odd}}}}} - \text{{\text{{\itshape{page-even}}}}}\)

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-shift\(:=\)0mm

page-even-shift\(:=\)0mm
(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

\begin{eqnarray*} \text{{\text{{\itshape{page-odd}}}}} & = & \frac{\text{{\text{{\itshape{page-width}}}}} - \text{{\text{{\itshape{par-width}}}}}}{2} + \text{{\text{{\itshape{page-odd-shift}}}}}\\ \text{{\text{{\itshape{page-even}}}}} & = & \frac{\text{{\text{{\itshape{page-width}}}}} - \text{{\text{{\itshape{par-width}}}}}}{2} + \text{{\text{{\itshape{page-even-shift}}}}} \end{eqnarray*}

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.

page-top\(:=\)auto

page-bot\(:=\)auto
(top and bottom margins)

The top and bottom margins, used when page-height-margin is false (for tex, only page-top is used). When set to auto, a default margin is determined as a function of the page type.

page-user-height\(:=\)522pt
(height of the main text)

The height of the main text on each page, used when page-height-margin is true or tex. Otherwise, it is computed from the page height and the top and bottom margins.

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\(:=\)
(headers and footers)

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

page-this-header\(:=\)

page-this-footer\(:=\)

page-this-top\(:=\)

page-this-bot\(:=\)

page-this-bg-color\(:=\)
(settings for the current page only)

When assigned inside the document, these variables override the header, the footer, the top and bottom margins and the background color for the page on which the assignment occurs only. They are reset after each page. For instance, the beamer style uses <assign|page-this-top|0mm> for slides with a title bar.

page-head-sep\(:=\)8mm

page-foot-sep\(:=\)8mm
(separation between headers/footers 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-sep\(:=\)1.0fn
(space between footnotes and text)

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

page-fnote-barlen\(:=\)7.5fn
(length of footnote bars)

The length of the footnote bar.

page-float-sep\(:=\)1.5fn
(separation between floats and text)

The separation between the main text and floating objects.

page-float-enable\(:=\)paper
(enable floating objects)

Floating objects are really allowed to float if this variable is true or if it coincides with the current page-medium. Otherwise, floats are placed “here”. By default, floats therefore only float in paper mode.

page-mnote-sep\(:=\)5mm
(separation between marginal notes and text)

The separation between marginal notes and the main text (not used by the typesetter; marginal notes in the standard styles use the macro variable marginal-note-sep instead).

page-mnote-width\(:=\)15mm
(width of marginal notes)

The width of marginal notes (not used by the typesetter; marginal notes in the standard styles use marginal-note-width instead).

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".