2

I want to remove the white space of the first displayed equation only without interfering other equations that follow.

If I activate \abovedisplayskip=0pt\relax then the remaining displayed equations after \intertext also get affected.

I also tried the following but it does not work.

\documentclass[margin=0mm,varwidth]{standalone}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{palatino}
\newdimen\temp
\temp=\abovedisplayskip

\begin{document}
\abovedisplayskip=0pt\relax
\begin{align}
\abovedisplayskip=\temp
ax + by &= c\label{eqn:one}\\
px + qy &= r\label{eqn:two}\\
%
\intertext{Multiplying equation~\eqref{eqn:one} by $p$ and equation~\eqref{eqn:two} by $a$, we have}
apx + bpy &= cp\label{eqn:three}\\
apx + aqy &= ar\label{eqn:four}\\
%
\intertext{Subtracting equation~\eqref{eqn:four} from equation~\eqref{eqn:three}, we obtain}
(bp-aq)y &= cp-ar
\end{align}
\end{document}

How to avoid such interference?

Minimal Working Example

\documentclass[margin=0mm,varwidth]{standalone}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{palatino}

\begin{document}
%\abovedisplayskip=0pt\relax
\begin{align}
ax + by &= c\label{eqn:one}\\
px + qy &= r\label{eqn:two}\\
%
\intertext{Multiplying equation~\eqref{eqn:one} by $p$ and equation~\eqref{eqn:two} by $a$, we have}
apx + bpy &= cp\label{eqn:three}\\
apx + aqy &= ar\label{eqn:four}\\
%
\intertext{Subtracting equation~\eqref{eqn:four} from equation~\eqref{eqn:three}, we obtain}
(bp-aq)y &= cp-ar
\end{align}
\end{document}

enter image description here

Display Name
  • 46,933

1 Answers1

3

Since you want to get rid of this whitespace in a one-off situation for cropping purposes it is easiest to just manually remove it by doing

\vspace*{-\abovedisplayskip}

There will be some residual whitespace above the first equation whose size is equal the difference between \baselineskip and the font size.

\documentclass[margin=0mm,varwidth]{standalone}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{palatino}

\begin{document}

\vspace*{-\abovedisplayskip}
\begin{align}
ax + by &= c\label{eqn:one}\\
px + qy &= r\label{eqn:two}\\
%
\intertext{Multiplying equation~\eqref{eqn:one} by $p$ and equation~\eqref{eqn:two} by $a$, we have}
apx + bpy &= cp\label{eqn:three}\\
apx + aqy &= ar\label{eqn:four}\\
%
\intertext{Subtracting equation~\eqref{eqn:four} from equation~\eqref{eqn:three}, we obtain}
(bp-aq)y &= cp-ar
\end{align}

\end{document}

enter image description here

To remove the residual space you have to back up all the spaces which are inserted by amsmath and then skip back down the font size.

[...]
\makeatletter
\vspace*{-\abovedisplayskip}
\vspace*{-\ht\strutbox@}
\vspace*{-\dp\strutbox@}
\vspace*{-\lineskip}
\vspace*{\csname f@size\endcsname pt}
\makeatother
\begin{align}
[...]

I'm still lacking something. There is still about 1pt to the upper edge but I don't know what that is.

enter image description here

Henri Menke
  • 109,596