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

  • \vspace*{-\abovedisplayskip}\begin{align}? – Henri Menke Sep 12 '17 at 6:01
  • Save and restore won't work, because align (and others) read the content as an argument and evaluate it delayed. – Henri Menke Sep 12 '17 at 6:02
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

  • How to remove the residual? – Artificial Stupidity Sep 12 '17 at 6:22
  • 1
    @ArtificialStupidity - Just change \vspace*{-\abovedisplayskip} to \vspace*{-1.25\abovedisplayskip}. – Mico Sep 12 '17 at 6:44
  • @Mico: A trial and error number? – Artificial Stupidity Sep 12 '17 at 7:26
  • @ArtificialStupidity See updated answer. – Henri Menke Sep 12 '17 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.