Layout (LaTeX2e unofficial reference manual (October 2018))

## Layout

Commands for controlling the general page layout.

### `\onecolumn`

Synopsis:

    \onecolumn

Start a new page and produce single-column output. If the document is given the class option `onecolumn` then this is the default behavior (see Document class options). This command is fragile (see \protect).

### `\twocolumn`

Synopses:

    \twocolumn
    \twocolumn[prelim one column text]

Start a new page and produce two-column output. If the document is given the class option `twocolumn` then this is the default (see Document class options). This command is fragile (see \protect).

If the optional prelim one column text argument is present, it is typeset in one-column mode before the two-column typesetting starts.

These parameters control typesetting in two-column output:

`\columnsep`

  The distance between columns. The default is 35pt. Change it with a command such as `\setlength{\columnsep}{40pt}` You must change it before the two column environment starts; in the preamble is a good place.

`\columnseprule`

  The width of the rule between columns. The rule appears halfway between the two columns. The default is 0pt, meaning that there is no rule. Change it with a command such as `\setlength{\columnseprule}{0.4pt}`, before the two-column environment starts.

`\columnwidth`

  The width of a single column. In one-column mode this is equal to `\textwidth`. In two-column mode by default LaTeX sets the width of each of the two columns to be half of `\textwidth` minus `\columnsep`.

In a two-column document, the starred environments `table*` and `figure*` are two columns wide, whereas the unstarred environments `table` and `figure` take up only one column (see figure and see table). LaTeX places starred floats at the top of a page. The following parameters control float behavior of two-column output.

`\dbltopfraction`

  The maximum fraction at the top of a two-column page that may be occupied by two-column wide floats. The default is 0.7, meaning that the height of a `table*` or `figure*` environment must not exceed `0.7\textheight` . If the height of your starred float environment exceeds this then you can take one of the following actions to prevent it from floating all the way to the back of the document:

  - Use the `[tp]` location specifier to tell LaTeX to try to put the bulky float on a page by itself, as well as at the top of a page.
  - Use the `[t!]` location specifier to override the effect of `\dbltopfraction` for this particular float.
  - Increase the value of `\dbltopfraction` to a suitably large number, to avoid going to float pages so soon.

  You can redefine it, as with `\renewcommand{\dbltopfraction}{0.9}`.

`\dblfloatpagefraction`

  For a float page of two-column wide floats, this is the minimum fraction that must be occupied by floats, limiting the amount of blank space. LaTeX’s default is `0.5`. Change it with `\renewcommand`.

`\dblfloatsep`

  On a float page of two-column wide floats, this length is the distance between floats, at both the top and bottom of the page. The default is `12pt plus2pt minus2pt` for a document set at `10pt` or `11pt`, and `14pt plus2pt minus4pt` for a document set at `12pt`.

`\dbltextfloatsep`

  This length is the distance between a multi-column float at the top or bottom of a page and the main text. The default is `20pt plus2pt minus4pt`.

`\dbltopnumber`

  On a float page of two-column wide floats, this counter gives the maximum number of floats allowed at the top of the page. The LaTeX default is `2`.

This example uses `\twocolumn`’s optional argument of to create a title that spans the two-column article:

    \documentclass[twocolumn]{article}
    \newcommand{\authormark}[1]{\textsuperscript{#1}}
    \begin{document}
    \twocolumn[{% inside this optional argument goes one-column text
      \centering
      \LARGE The Title \\[1.5em]
      \large Author One\authormark{1},
             Author Two\authormark{2},
             Author Three\authormark{1} \\[1em]
      \normalsize
      \begin{tabular}{p{.2\textwidth}@{\hspace{2em}}p{.2\textwidth}}
        \authormark{1}Department one  &\authormark{2}Department two \\
         School one                   &School two
      \end{tabular}\\[3em] % space below title part
      }]

    Two column text here.

### `\flushbottom`

Make all pages in the documents after this declaration have the same height, by stretching the vertical space where necessary to fill out the page. This is most often used when making two-sided documents since the differences in facing pages can be glaring.

If TeX cannot satisfactorily stretch the vertical space in a page then you get a message like ‘`Underfull \vbox (badness 10000) has occurred while \output is active`’. If you get that, one option is to change to `\raggedbottom` (see \raggedbottom). Alternatively, you can adjust the `textheight` to make compatible pages, or you can add some vertical stretch glue between lines or between paragraphs, as in `\setlength{\parskip}{0ex plus0.1ex}`. Your last option is to, in a final editing stage, adjust the height of individual pages (see \enlargethispage).

The `\flushbottom` state is the default only if you select the `twoside` document class option (see Document class options).

### `\raggedbottom`

Make all later pages the natural height of the material on that page; no rubber vertical lengths will be stretched. Thus, in a two-sided document the facing pages may be different heights. This command can go at any point in the document body. See \flushbottom.

This is the default unless you select the `twoside` document class option (see Document class options).

### Page layout parameters

`\columnsep`
`\columnseprule`
`\columnwidth`

  The distance between the two columns, the width of a rule between the columns, and the width of the columns, when the document class option `twocolumn` is in effect (see Document class options). See \twocolumn.

`\headheight`

  Height of the box that contains the running head. The default in the `article`, `report`, and `book` classes is ‘`12pt`’, at all type sizes.

`\headsep`

  Vertical distance between the bottom of the header line and the top of the main text. The default in the `article` and `report` classes is ‘`25pt`’. In the `book` class the default is: if the document is set at 10pt then it is ‘`0.25in`’, and at 11pt and 12pt it is ‘`0.275in`’.

`\footskip`

  Distance from the baseline of the last line of text to the baseline of the page footer. The default in the `article` and `report` classes is ‘`30pt`’. In the `book` class the default is: when the type size is 10pt the default is ‘`0.35in`’, while at 11pt it is ‘`0.38in`’, and at 12pt it is ‘`30pt`’.

`\linewidth`

  Width of the current line, decreased for each nested `list` (see list). That is, the nominal value for `\linewidth` is to equal `\textwidth` but for each nested list the `\linewidth` is decreased by the sum of that list’s `\leftmargin` and `\rightmargin` (see itemize).

`\marginparpush`
`\marginsep`
`\marginparwidth`

  The minimum vertical space between two marginal notes, the horizontal space between the text body and the marginal notes, and the horizontal width of the notes.

  Normally marginal notes appear on the outside of the page, but the declaration `\reversemarginpar` changes that (and `\normalmarginpar` changes it back).

  The defaults for `\marginparpush` in both `book` and `article` classes are: ‘`7pt`’ if the document is set at 12pt, and ‘`5pt`’ if the document is set at 11pt or 10pt.

  For `\marginsep`, in `article` class the default is ‘`10pt`’ except if the document is set at 10pt and in two-column mode where the default is ‘`11pt`’.

  For `\marginsep` in `book` class the default is ‘`10pt`’ in two-column mode and ‘`7pt`’ in one-column mode.

  For `\marginparwidth` in both `book` and `article` classes, in two-column mode the default is 60% of `\paperwidth - \textwidth`, while in one-column mode it is 50% of that distance.

`\oddsidemargin`
`\evensidemargin`

  The `\oddsidemargin` is the extra distance between the left side of the page and the text’s left margin, on odd-numbered pages when the document class option `twoside` is chosen and on all pages when `oneside` is in effect. When `twoside` is in effect, on even-numbered pages the extra distance on the left is `evensidemargin`.

  LaTeX’s default is that `\oddsidemargin` is 40% of the difference between `\paperwidth` and `\textwidth`, and `\evensidemargin` is the remainder.

`\paperheight`

  The height of the paper, as distinct from the height of the print area. Normally set with a document class option, as in `\documentclass[a4paper]{article}` (see Document class options).

`\paperwidth`

  The width of the paper, as distinct from the width of the print area. Normally set with a document class option, as in `\documentclass[a4paper]{article}` (see Document class options).

`\textheight`

  The normal vertical height of the page body. If the document is set at a nominal type size of 10pt then for an `article` or `report` the default is ‘`43\baselineskip`’, while for a `book` it is ‘`41\baselineskip`’. At a type size of 11pt the default is ‘`38\baselineskip`’ for all document classes. At 12pt it is ‘`36\baselineskip`’ for all classes.

`\textwidth`

  The full horizontal width of the entire page body. For an `article` or `report` document, the default is ‘`345pt`’ when the chosen type size is 10pt, the default is ‘`360pt`’ at 11pt, and it is ‘`390pt`’ at 12pt. For a `book` document, the default is ‘`4.5in`’ at a type size of 10pt, and ‘`5in`’ at 11pt or 12pt.

  In multi-column output, `\textwidth` remains the width of the entire page body, while `\columnwidth` is the width of one column (see \twocolumn).

  In lists (see list), `\textwidth` remains the width of the entire page body (and `\columnwidth` the width of the entire column), while `\linewidth` may decrease for nested lists.

  Inside a minipage (see minipage) or `\parbox` (see \parbox), all the width-related parameters are set to the specified width, and revert to their normal values at the end of the `minipage` or `\parbox`.

`\hsize`

  This entry is included for completeness: `\hsize` is the TeX primitive parameter used when text is broken into lines. It should not be used in normal LaTeX documents.

`\topmargin`

  Space between the top of the TeX page (one inch from the top of the paper, by default) and the top of the header. The value is computed based on many other parameters: `\paperheight - 2in - \headheight - \headsep - \textheight - \footskip`, and then divided by two.

`\topskip`

  Minimum distance between the top of the page body and the baseline of the first line of text. For the standard classes, the default is the same as the font size, e.g., ‘`10pt`’ at a type size of 10pt.

### Floats

Some typographic elements, such as figures and tables, cannot be broken across pages. They must be typeset outside of the normal flow of text, for instance floating to the top of a later page.

LaTeX can have a number of different classes of floating material. The default is the two classes, `figure` (see figure) and `table` (see table), but you can create a new class with the package `float`.

Within any one float class LaTeX always respects the order, so that the first figure in a document source must be typeset before the second figure. However, LaTeX may mix the classes, so it can happen that while the first table appears in the source before the first figure, it appears in the output after it.

The placement of floats is subject to parameters, given below, that limit the number of floats that can appear at the top of a page, and the bottom, etc. If so many floats are queued that the limits prevent them all from fitting on a page then LaTeX places what it can and defers the rest to the next page. In this way, floats may end up being typeset far from their place in the source. In particular, a float that is big may migrate to the end of the document. In which event, because all floats in a class must appear in sequential order, every following float in that class also appears at the end.

In addition to changing the parameters, for each float you can tweak where the float placement algorithm tries to place it by using its placement argument. The possible values are a sequence of the letters below. The default for both `figure` and `table`, in both `article` and `book` classes, is `tbp`.

`t`

  (Top)—at the top of a text page.

`b`

  (Bottom)—at the bottom of a text page. (However, `b` is not allowed for full-width floats (`figure*`) with double-column output. To ameliorate this, use the `stfloats` or `dblfloatfix` package, but see the discussion at caveats in the FAQ: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=2colfloat.

`h`

  (Here)—at the position in the text where the `figure` environment appears. However, `h` is not allowed by itself; `t` is automatically added.

  To absolutely force a float to appear “here”, you can `\usepackage{float}` and use the `H` specifier which it defines. For further discussion, see the FAQ entry at http://www.tex.ac.uk/cgi-bin/texfaq2html?label=figurehere.

`p`

  (Page of floats)—on a separate float page, which is a page containing no text, only floats.

`!`

  Used in addition to one of the above; for this float only, LaTeX ignores the restrictions on both the number of floats that can appear and the relative amounts of float and non-float text on the page. The `!` specifier does not mean “put the float here”; see above.

Note: the order in which letters appear in the placement argument does not change the order in which LaTeX tries to place the float; for instance, `btp` has the same effect as `tbp`. All that placement does is that if a letter is not present then the algorithm does not try that location. Thus, LaTeX’s default of `tbp` is to try every location except placing the float where it occurs in the source.

To prevent LaTeX from moving floats to the end of the document or a chapter you can use a `\clearpage` command to start a new page and insert all pending floats. If a pagebreak is undesirable then you can use the `afterpage` package and issue `\afterpage{\clearpage}`. This will wait until the current page is finished and then flush all outstanding floats.

LaTeX can typeset a float before where it appears in the source (although on the same output page) if there is a `t` specifier in the placement parameter. If this is not desired, and deleting the `t` is not acceptable as it keeps the float from being placed at the top of the next page, then you can prevent it by either using the `flafter` package or using the command `\suppressfloats[t]`, which causes floats for the top position on this page to moved to the next page.

Parameters relating to fractions of pages occupied by float and non-float text (change them with `\renewcommand{parameter}{decimal between 0 and 1}`):

`\bottomfraction`

  The maximum fraction of the page allowed to be occupied by floats at the bottom; default ‘`.3`’.

`\floatpagefraction`

  The minimum fraction of a float page that must be occupied by floats; default ‘`.5`’.

`\textfraction`

  Minimum fraction of a page that must be text; if floats take up too much space to preserve this much text, floats will be moved to a different page. The default is ‘`.2`’.

`\topfraction`

  Maximum fraction at the top of a page that may be occupied before floats; default ‘`.7`’.

Parameters relating to vertical space around floats (change them with a command of the form `\setlength{parameter}{length expression}`):

`\floatsep`

  Space between floats at the top or bottom of a page; default ‘`12pt plus2pt minus2pt`’.

`\intextsep`

  Space above and below a float in the middle of the main text; default ‘`12pt plus2pt minus2pt`’ for 10 point and 11 point documents, and ‘`14pt plus4pt minus4pt`’ for 12 point documents.

`\textfloatsep`

  Space between the last (first) float at the top (bottom) of a page; default ‘`20pt plus2pt minus4pt`’.

Counters relating to the number of floats on a page (change them with a command of the form `\setcounter{ctrname}{natural number}`):

`bottomnumber`

  Maximum number of floats that can appear at the bottom of a text page; default 1.

`dbltopnumber`

  Maximum number of full-sized floats that can appear at the top of a two-column page; default 2.

`topnumber`

  Maximum number of floats that can appear at the top of a text page; default 2.

`totalnumber`

  Maximum number of floats that can appear on a text page; default 3.

The principal TeX FAQ entry relating to floats http://www.tex.ac.uk/cgi-bin/texfaq2html?label=floats contains suggestions for relaxing LaTeX’s default parameters to reduce the problem of floats being pushed to the end. A full explanation of the float placement algorithm is in Frank Mittelbach’s article “How to influence the position of float environments like figure and table in LaTeX?” (http://latex-project.org/papers/tb111mitt-float.pdf).