\abovedisplayskip and related commands
\abovedisplayskip
is one of 4 commands to control the amount of glue (flexible
space) that TEX engines add before, and after, a displayed equation:
\abovedisplayskip[=]
glue\belowdisplayskip[=]
glue\abovedisplayshortskip[=]
glue\belowdisplayshortskip[=]
glue
where glue is some “flexible space” and the “[=]” indicates that an optional “=” can follow after the command.
usage example \abovedisplayskip=12pt plus 3pt minus 9pt
( the “=” sign) is
optional).
Each of the 4 commands above can be used to set (store) your preferred glue value that TEX can use when typesetting display mathematics.
Choosing which glues to use
As with most TEX algorithms, a full description needs to address many fine details but, to a first approximation, TEX checks whether the last line in the paragraph and the equation “overlap”: the outcome of that comparison determines which glue to place above and below the equation. In practice, TEX also tests for the presence of an equation number.
If the equation is preceded by a “sufficiently short” line the glue stored in
\abovedisplayshortskip
will be inserted above the equation and the glue value
stored in \belowdisplayshortskip
will be inserted after it. For longer lines (or
longer equations), TEX will instead insert the glue \abovedisplayskip
above the
equation and \belowdisplayskip
below it.
A detailed explanation of exactly how TEX chooses which glue to place above a
display equation (\abovedisplayskip
or \abovedisplayshortskip
) or below it
(\belowdisplayskip
or \belowdisplayshortskip
) can be found on pages 188–9 of
The TEXbook.
Examples
For demonstration purposes, we’ll use some “extreme” values for the various glues so
that their effect is clearly visible. We’ll choose \abovedisplayshortskip=-20pt
which will moves a display equation upwards by 20pt if that equation is preceded by
a sufficiently short line. We’ll also use \belowdisplayshortskip=100pt
to set the glue (100 pt) inserted below the displayed equation. Here, we’ll
use the Schrödinger equation as the basis for illustrating the effect of these
commands:
\[ \frac{\hbar^2}{2m}\nabla^2\Psi + V(\mathbf{r})\Psi
= -i\hbar \frac{\partial\Psi}{\partial t} \]
which produces the following mathematics:
\[ \frac{\hbar ^2}{2m}\nabla ^2\Psi + V(\mathbf{r})\Psi = -i\hbar \frac{\partial \Psi }{\partial t} \] The following example uses the “extreme” glue values mentioned above:
\abovedisplayshortskip=-20pt
\belowdisplayshortskip=100pt
\noindent A short last line...
\[ \frac{\hbar^2}{2m}\nabla^2\Psi + V(\mathbf{r})\Psi
= -i\hbar \frac{\partial\Psi}{\partial t} \]
... a short concluding line.
The following graphic shows the results:
As you can see, the Schrödinger equation has been shifted upwards by 20pt with 100pt of space added below it.
However, if we now use a much wider equation with \abovedisplayshortskip=-20pt
and \belowdisplayshortskip=100pt
or increase the length of the last line in our
paragraph those two glue settings are ignored because the displayed equation
“overlaps” the last line. Here, TEX now uses the glues \abovedisplayskip
above
the equation and \belowdisplayskip
below it. Here, we have not set values for
\abovedisplayskip
or \belowdisplayskip
but simply use their default
values:
\abovedisplayshortskip=-20pt
\belowdisplayshortskip=100pt
\noindent A short last line...
\[\int_{x^2 + y^2 \leq R^2} f(x,y)\,dx\,dy
= \int_{\theta=0}^{2\pi} \int_{r=0}^R
f(r\cos\theta,r\sin\theta) r\,dr\,d\theta.\]
... a short concluding line.
The following graphic shows the results:
Now we’ll typeset the the Schrödinger equation but make sure the last line is longer:
\abovedisplayshortskip=-20pt
\belowdisplayshortskip=100pt
\noindent A longer last line now precedes our Schr\"{o}dinger equation. As a result,
\TeX{} will use the glues \verb|\abovedisplayskip| above the equation and
\verb|\belowdisplayskip| below it, ignoring the ‘‘extreme’’ values we supplied:
\verb|\abovedisplayshortskip=-20pt| and \verb|\belowdisplayshortskip=100pt|.
\[ \frac{\hbar^2}{2m}\nabla^2\Psi + V(\mathbf{r})\Psi
= -i\hbar \frac{\partial\Psi}{\partial t} \]
... a short concluding line.
The following graphic shows the results:
Related commands
\displaywidth
[=] dimension\displayindent
[=] dimension\predisplaysize
[=] dimension
where dimension is a lenth in units understood by TEX. The “[=]” indicates that an optional equals follows after the command.
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class