If you're using one of the AMS document classes (amsart or amsbook) or saying \usepackage{amsthm}
, you can define a new theoremstyle, two parameters of which are the skip above the theorem and the skip below the theorem. For example, I like my theorems to use slanted type in the body instead of italics, and so I use the following:
\newtheoremstyle{slplain}% name
{.5\baselineskip\@plus.2\baselineskip\@minus.2\baselineskip}% Space above
{.5\baselineskip\@plus.2\baselineskip\@minus.2\baselineskip}% Space below
{\slshape}% Body font
{}%Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{.}% Punctuation after thm head
{ }% Space after thm head: " " = normal interword space;
% \newline = linebreak
{}% Thm head spec
\theoremstyle{slplain}
\newtheorem{thm}[equation]{Theorem} % Numbered with the equation counter
\newtheorem{cor}[equation]{Corollary}
\newtheorem{lem}[equation]{Lemma}
\newtheorem{prop}[equation]{Proposition}
Almost all of the parameters I used for that \newtheoremstyle
command are exactly the ones used for the plain theoremstyle in amsart, except that I changed the body font from \itshape
to \slshape
.
As noted in the comments, the second and third parameters to the \newtheoremstyle
command are the space above and the space below. You can change those to whatever you like (and even change the \slshape
that I use back to \itshape
if that's what you prefer).
\documentclass[10pt,danish,a4paper,oneside,fleqn]{report}
\usepackage[english]{babel}
\usepackage{amsmath,lipsum}
\begin{document}
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\lipsum*[2]
\begin{align*}
A\cap B & = \{b,d,e\} \cap \{a,b,f,g\} \\
& = \{b\}
\end{align*}
\lipsum[3]
\end{document}
Note, however, that this is very poor typography. (lipsum
is just to generate dummy text.)
The four parameters state how much vertical space is inserted between text and a math display. The "short" version is used for equation
, when the last line of text is short.
You should also check the way you're inputting math. You're using too much redundant braces (that in some cases give very bad results). It's quite rare to use explicit spacing commands in math.
Here's the result of typesetting the test file
This is the principle. In case you use font size changing commands, you have to tell LaTeX that you want this zero spacing in all sizes by putting this in the preamble
\usepackage{etoolbox}
\newcommand{\zerodisplayskips}{%
\setlength{\abovedisplayskip}{0pt}%
\setlength{\belowdisplayskip}{0pt}%
\setlength{\abovedisplayshortskip}{0pt}%
\setlength{\belowdisplayshortskip}{0pt}}
\appto{\normalsize}{\zerodisplayskips}
\appto{\small}{\zerodisplayskips}
\appto{\footnotesize}{\zerodisplayskips}
so that the example becomes
\documentclass[10pt,danish,a4paper,oneside,fleqn]{report}
\usepackage[english]{babel}
\usepackage{amsmath,lipsum}
\usepackage{etoolbox}
\newcommand{\zerodisplayskips}{%
\setlength{\abovedisplayskip}{0pt}%
\setlength{\belowdisplayskip}{0pt}%
\setlength{\abovedisplayshortskip}{0pt}%
\setlength{\belowdisplayshortskip}{0pt}}
\appto{\normalsize}{\zerodisplayskips}
\appto{\small}{\zerodisplayskips}
\appto{\footnotesize}{\zerodisplayskips}
\begin{document}
\lipsum*[2]
\begin{align*}
A\cap B & = \{b,d,e\} \cap \{a,b,f,g\} \\
& = \{b\}
\end{align*}
\lipsum[3]
\end{document}
Best Answer
Your example is somewhat flawed, as
lipsum
inserts a\par
at the end of every paragraph. As such, you're actually left with an empty line before thealign
(a display math equation) - something you should avoid. One way to avoid this is to loadlipsum
with thenopar
option:Alternatively, use
\lipsum*[<nums>]
.Now for the real changes:
Space above/below a display math equation is regulated by 4 different lengths: Two for the space above and two below. For each of these locations, the two lengths are dependent on whether the preceding/following line is short or not.
You can adjust these to suit your needs, of course. Finally,
align
uses a length\jot
that influences the space between the multi-line equation. Adjust\jot
to suit your needs as well.Here's a minimal example that completely removes any spaces around the
align
as well as the inter-equation spacing (effectively setting all of the above-mentioned lengths to0pt
):